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