ID:               31668
 Comment by:       camka at email dot ee
 Reported By:      exaton at free dot fr
 Status:           Open
 Bug Type:         MySQLi related
 Operating System: WinXP
 PHP Version:      5CVS-2005-01-23 (dev)
 New Comment:

setting query_cache_type to OFF didn't change anything. still the same
error.


Previous Comments:
------------------------------------------------------------------------

[2005-02-22 10:55:59] camka at email dot ee

I used exaton at free dot fr 's code to reproduce the problem. And I
succeeded.
The following code works just as it was described above, giving the
"You have an error in your SQL syntax" error or workind just fine.
<?php
$SQL = new mysqli(/* ... */);

$SQL -> multi_query('SELECT 1;SELECT 2');

do {
  $res = $SQL -> store_result();
  if ($SQL -> errno == 0)
  {
    while ($arr = $res -> fetch_assoc())
      print_r($arr);
    $res -> free();
  }
  else
    echo $SQL -> error; // (*)
}
while ($SQL -> next_result());

$SQL -> close();
?>

setting SQL_NO_CACHE directive didn't do the thing as ingmar at
hackthenet dot org suggested. The query_cache_size server variable
value is 0.

mysql> show variables like '%query_cache%';
+------------------------------+---------+
| Variable_name                | Value   |
+------------------------------+---------+
| have_query_cache             | YES     |
| query_cache_limit            | 1048576 |
| query_cache_min_res_unit     | 4096    |
| query_cache_size             | 0       |
| query_cache_type             | ON      |
| query_cache_wlock_invalidate | OFF     |
+------------------------------+---------+
6 rows in set (0.00 sec)

and finally: explicite calling the query method before multy_query
$SQL->query('select 343'); causes the "syntax error" error not to
occure anymore.

i'll try to set query_cache_type to OFF value and share the results
soon.

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

[2005-02-12 13:25:06] ingmar at hackthenet dot org

hello,
i had a very similar problem.

The MySQL-Server hung up (SHOW PROCESSLIST says process is in the
sleep-state) every time I refreshed the page where $db->multi_query()
was called.

But I found a workaround at least for SELECT-Queries. Simply use
SELECT SQL_NO_CACHE * FROM tbl
instead of
SELECT * FROM tbl.

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

[2005-02-11 19:11:33] exaton at free dot fr

I'm afraid I can no longer help out here ; I needed to upgrade the DB
layer my comany's web application framework fast, and have therefore
switched to PostgreSQL in the meantime.

camka at email dot ee, I leave this in your hands...

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

[2005-02-11 16:15:00] [EMAIL PROTECTED]

Does this problem still occur when you disable MySQL's 
query cache? 

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

[2005-02-11 10:41:27] camka at email dot ee

I'm facing the same problem on Linux environment.
Looking forward to get the bug fixed.

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

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/31668

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

Reply via email to