|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37674 exception not thrown in multi_query's
Submitted: 2006-06-02 09:55 UTC Modified: 2008-11-10 01:00 UTC
Avg. Score:4.8 ± 0.4
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:1 (25.0%)
From: camka at email dot ee Assigned: andrey (profile)
Status: No Feedback Package: MySQLi related
PHP Version: 5.1.4 OS: Windows XP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
33 - 2 = ?
Subscribe to this entry?

 [2006-06-02 09:55 UTC] camka at email dot ee
When trying to execute multiple queryes with multi_query method, when first query is ok, and second one is broken, the exception is not thrown when iterating second function's resultset of the multiquery. Only ::error is set.

Reproduce code:

	$m = new mysqli('**', '**', '**', '**');
	$m->multi_query('select 1; bug;');
	do {

       /* store first result set */
       if ($result = $m->store_result())
           while ($row = $result->fetch_row())
               printf("%s\n", $row[0]);
       /* print divider */
       if ($m->more_results()) {
   while ($m->next_result());
   echo $m->error;
catch (mysqli_sql_exception  $e)

Expected result:
1 ----------------- You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bug' at line 1

Actual result:
1 ----------------- 
  protected 'message' => 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near &apos;bug; bug&apos; at line 1' (length=154)
  private 'string' => '' (length=0)
  protected 'code' => 1064
  protected 'file' => '**' (length=35)
  protected 'line' => 7
  private 'trace' => 
      0 => 
          'file' => '**' (length=35)
          'line' => 7
          'function' => 'multi_query' (length=11)
          'class' => 'mysqli' (length=6)
          'type' => '->' (length=2)
          'args' => 
              0 => 'bug; bug;' (length=9)
  protected 'sqlstate' => '42000' (length=5)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-02 09:56 UTC] camka at email dot ee
Sorry. Expected and actual results are mixed.
 [2006-06-05 07:21 UTC] camka at email dot ee
Same problem with latest cvs snapshot.
 [2006-06-26 11:03 UTC] camka at email dot ee
any hope the issue is on the way to be solved?
 [2008-07-21 18:27 UTC]
 [2008-11-02 12:36 UTC]
Please try using this CVS snapshot:
For Windows:

 [2008-11-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Thu Jun 08 05:03:37 2023 UTC