xref: /PHP-7.0/ext/mysqli/tests/bug36745.phpt (revision eb0e09f5)
1--TEST--
2Bug #36745 (LOAD DATA LOCAL INFILE doesn't return correct error message)
3--SKIPIF--
4<?php
5require_once('skipif.inc');
6require_once('skipifconnectfailure.inc');
7?>
8--FILE--
9<?php
10	require_once("connect.inc");
11
12	/*** test mysqli_connect 127.0.0.1 ***/
13	$mysql = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket);
14
15	$mysql->query("DROP TABLE IF EXISTS litest");
16	$mysql->query("CREATE TABLE litest (a VARCHAR(20))");
17
18	$mysql->query("LOAD DATA LOCAL INFILE 'filenotfound' INTO TABLE litest");
19	var_dump($mysql->error);
20
21	$mysql->close();
22	printf("Done");
23?>
24--CLEAN--
25<?php
26require_once("connect.inc");
27if (!$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket))
28   printf("[c001] [%d] %s\n", mysqli_connect_errno(), mysqli_connect_error());
29
30if (!mysqli_query($link, "DROP TABLE IF EXISTS litest"))
31	printf("[c002] Cannot drop table, [%d] %s\n", mysqli_errno($link), mysqli_error($link));
32
33mysqli_close($link);
34?>
35--EXPECTF--
36%s(%d) "%s"
37Done
38