Edit report at http://bugs.php.net/bug.php?id=53649&edit=1

 ID:                 53649
 Updated by:         and...@php.net
 Reported by:        jeremy dot archuleta at gmail dot com
 Summary:            mysql_query with "load data" unable to save result
                     set
-Status:             Assigned
+Status:             Duplicate
 Type:               Bug
 Package:            MySQL related
 Operating System:   Mac OS
 PHP Version:        5.3.4
 Assigned To:        mysql
 Block user comment: N
 Private report:     N

 New Comment:

Duplicate of 53503, because of a bug in mysqlnd. No need for a change in
ext/mysql


Previous Comments:
------------------------------------------------------------------------
[2011-01-05 20:49:52] jeremy dot archuleta at gmail dot com

Bug is also reported in MySQLi package:
http://bugs.php.net/bug.php?id=53503



And reported to be fixed in PHP 5.3.5

------------------------------------------------------------------------
[2011-01-04 16:24:03] jeremy dot archuleta at gmail dot com

Description:
------------
I believe that using mysql_query() with "load data" should always be a 

TRUE/FALSE return value. However, if a mysql_query() call that returns a
result 

set is performed *before* the "load data" query, then there is a warning
stating 

that the result set can not be saved.



In short:

Warning:

 mysql_query("SELECT ..."); // result set *before*

 mysql_query("LOAD DATA ..."); // warning



Works:

 mysql_query("LOAD DATA ..."); // works

 mysql_query("SELECT ..."); // result set *after*



Works:

 mysql_query("UPDATE ..."); // *no* result set

 mysql_query("LOAD DATA ..."); // works



Works and Warning:

 mysql_query("LOAD DATA ..."); // works

 mysql_query("SELECT ..."); // result set *after*

 mysql_query("LOAD DATA ..."); // warning





MacOS 10.5.8

$ uname -a

Darwin clark-kent-2.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15
16:55:01 

PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386



Using PHP from macports

$ php --version

PHP 5.3.3 (cli) (built: Oct 25 2010 17:21:53) 

Copyright (c) 1997-2010 The PHP Group

Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies



$ php -i

phpinfo()

PHP Version => 5.3.3



System => Darwin clark-kent-2.local 9.8.0 Darwin Kernel Version 9.8.0:
Wed Jul 

15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386

Build Date => Oct 25 2010 17:19:57

Configure Command =>  './configure'  '--prefix=/opt/local' '--

mandir=/opt/local/share/man' '--infodir=/opt/local/share/info'
'--with-config-

file-path=/opt/local/etc/php5' '--with-config-file-scan-

dir=/opt/local/var/db/php5' '--disable-all' '--enable-bcmath'
'--enable-ctype' 

'--enable-dom' '--enable-fileinfo' '--enable-filter' '--enable-hash'
'--enable-

json' '--enable-libxml' '--enable-pdo' '--enable-phar'
'--enable-session' '--

enable-simplexml' '--enable-tokenizer' '--enable-xml'
'--enable-xmlreader' '--

enable-xmlwriter' '--with-bz2=/opt/local' '--with-mhash=/opt/local'
'--with-

pcre-regex=/opt/local' '--with-readline=/opt/local' '--with-libxml-

dir=/opt/local' '--with-zlib=/opt/local' '--disable-cgi' '--with-

apxs2=/opt/local/apache2/bin/apxs' '--with-pear=/opt/local/lib/php'





Using MySQL from macports

$ mysql --version

mysql  Ver 14.14 Distrib 5.1.51, for apple-darwin9.8.0 (i386) using
readline 6.1





Test script:
---------------
<?php

error_reporting(E_ALL | E_STRICT);

$sql = "LOAD DATA LOCAL INFILE '/tmp/a.out' INTO TABLE tmp (value)";

$db = mysql_connect('localhost', 'root', 'password');

mysql_select_db('some_database');



// "load data" *before* another query will work

// (this will return TRUE)

print ("This works\n");

$works = mysql_query($sql, $db);



print ("This also works\n");

$also_works = mysql_query("SELECT * FROM tmp", $db);



// "load data" *after* a query produces warning about not saving result
set

// (should return TRUE/FALSE I believe)

print ("This fails with warning\n");

$fails_with_warning = mysql_query($sql, $db);

?>

Expected result:
----------------
This works

This also works

This fails with warning

Actual result:
--------------
This works

This also works

This fails with warning

Warning: mysql_query(): Unable to save result set in tmp.php on line 18




------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53649&edit=1

Reply via email to