#37674 [Ver->Asn]: exception not thrown in multi_query's

[email protected]
Newsgroups php.bugs
Message-ID <[email protected]>
 ID:               37674
 Updated by:       [email protected]
 Reported By:      camka at email dot ee
-Status:           Verified
+Status:           Assigned
 Bug Type:         MySQLi related
 Operating System: Windows XP
 PHP Version:      5.1.4
 Assigned To:      andrey


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

[2008-07-21 18:27:33] [email protected]

Reassigning

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

[2006-06-26 11:03:45] camka at email dot ee

any hope the issue is on the way to be solved?

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

[2006-06-05 07:21:48] camka at email dot ee

Same problem with latest cvs snapshot.

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

[2006-06-02 09:56:46] camka at email dot ee

Sorry. Expected and actual results are mixed.

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

[2006-06-02 09:55:03] camka at email dot ee

Description:
------------
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:
---------------
<?php
mysqli_report( MYSQLI_REPORT_STRICT | MYSQLI_REPORT_ERROR );

try
{
	$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]);
           }
           $result->close();
       }
       /* print divider */
       if ($m->more_results()) {
           printf("-----------------\n");
       }
   }
   while ($m->next_result());
   echo $m->error;
}
catch (mysqli_sql_exception  $e)
{
	var_dump($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 ----------------- 
object(mysqli_sql_exception)[2]
  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' => 
    array
      0 => 
        array
          'file' => '**' (length=35)
          'line' => 7
          'function' => 'multi_query' (length=11)
          'class' => 'mysqli' (length=6)
          'type' => '->' (length=2)
          'args' => 
            array
              0 => 'bug; bug;' (length=9)
  protected 'sqlstate' => '42000' (length=5)




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


-- 
Edit this bug report at http://bugs.php.net/?id=37674&edit=1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.