query returns false after successful LOAD DATA query
| Bug #53503 | mysqli::query returns false after successful LOAD DATA query | ||||
|---|---|---|---|---|---|
| Submitted: | 2010-12-09 01:16 UTC | Modified: | 2010-12-12 17:18 UTC | ||
| From: | clewis at myfonts dot com | Assigned: | kalle (profile) | ||
| Status: | Closed | Package: | MySQLi related | ||
| PHP Version: | 5.3.3 | OS: | Linux - CentOS | ||
| Private report: | No | CVE-ID: | None | ||
[2010-12-09 01:16 UTC] clewis at myfonts dot com
Description: ------------ When a LOAD DATA LOCAL INFILE query is run after a previous SELECT query on the same mysqli handle, mysqli::query returns false even though the LOAD DATA query is successful. Additionally, PHP outputs two warnings during the mysqli::query call: PHP Warning: mysqli::query(): (00000/0): in /path/to/script.php on line 16 Warning: mysqli::query(): (00000/0): in /path/to/script.php on line 16 Properties of the mysqli object, such as errorno and affected_rows, indicate success. If the LOAD DATA query is the first query run on a particular mysqli object, it works fine. We are using the mysqlnd lib. Configuration: ./configure --prefix=/usr/local --with-xmlrpc --with-apxs2 --with- mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-curl --with-curlwrappers -- enable-bcmath --with-gd=/usr --with-mcrypt=/usr/local --enable-mbstring --with- zlib --with-iconv --enable-soap --enable-ftp --without-sqlite --with-xsl -- enable-pcntl --enable-sockets --with-openssl This may be the same as inactive Bug #47387. Test script: --------------- $db = new mysqli($host,$user,$pass,$dbname); $tempfile = tempnam("/tmp","loaddata_"); file_put_contents($tempfile, "1"); $db->query("create table if not exists LoadDataTest (Column1 int unsigned not null primary key)"); $db->query("select * from LoadDataTest limit 1"); //LOAD DATA works properly without this $result = $db->query("load data local infile '$tempfile' replace into table LoadDataTest (Column1)"); if ($result) print "Load data success.\n"; else print "Error {$db->errno}: {$db->error}\n"; unlink($tempfile); Expected result: ---------------- mysqli::query returns result object Actual result: -------------- mysqli::query returns false
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2010-12-12 01:51 UTC] kalle@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: kalle
[2010-12-12 17:18 UTC] kalle@php.net
-Status: Assigned +Status: Closed
[2010-12-12 17:18 UTC] kalle@php.net
[2011-01-05 20:48 UTC] jeremy dot archuleta at gmail dot com
[2011-01-07 15:22 UTC] andrey@php.net
[2015-07-10 11:33 UTC] spam2 at rhsoft dot net