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