Uploaded image for project: 'MariaDB Connector/C'
  1. MariaDB Connector/C
  2. CONC-586

Connector returns out of sync errors / packets out of order

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 3.1.16
    • N/A
    • API
    • None
    • macOS 10.15.7, Ubuntu 20.04

    Description

      The following PHP code code causes a packets out of order error

      <?php
       
      mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
      $mysqli = new mysqli( "127.0.0.1", "", "", "" );
       
      $select1 = $mysqli->prepare( "SELECT 1" );
      $select1->execute();
      $select1->store_result();
       
      $select2 = $mysqli->prepare( "SELECT 2" );
      $select2->execute();
       
      while ( $select1->fetch() )
      {
      	;
      }
       
      $select1->free_result();
       
      $select1 = $mysqli->prepare( "SELECT 1" );
      $select1->execute();
      $select1->store_result();
       
      $select2 = $mysqli->prepare( "SELECT 2" );
      $select2->execute();
      
      

      Error

      dcarver@dcarver:/private/tmp$ php test.php
       
      Warning: Packets out of order. Expected 1 received 4. Packet size=10 in /private/tmp/test.php on line 8
       
      Warning: mysqli::prepare(): MySQL server has gone away in /private/tmp/test.php on line 8
       
      Fatal error: Uncaught mysqli_sql_exception: MySQL server has gone away in /private/tmp/test.php:8
      Stack trace:
      #0 /private/tmp/test.php(8): mysqli->prepare('SELECT 1')
      #1 {main}
        thrown in /private/tmp/test.php on line 8
      dcarver@dcarver:/private/tmp$ php test.php
       
      Warning: Packets out of order. Expected 1 received 4. Packet size=10 in /private/tmp/test.php on line 20
       
      Warning: mysqli::prepare(): MySQL server has gone away in /private/tmp/test.php on line 20
       
      Fatal error: Uncaught mysqli_sql_exception: MySQL server has gone away in /private/tmp/test.php:20
      Stack trace:
      #0 /private/tmp/test.php(20): mysqli->prepare('SELECT 1')
      #1 {main}
        thrown in /private/tmp/test.php on line 20
      

      The following code cause an out of sync error

      <?php
       
      mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
      $mysqli = new mysqli( "127.0.0.1", "", "", "" );
       
      $select1 = $mysqli->prepare( "SELECT 1" );
      $select1->execute();
      $select1->store_result();
       
      $select2 = $mysqli->prepare( "SELECT 2" );
      $select2->execute();
       
      while ( $select1->fetch() )
      {
      	;
      }
       
      $select3 = $mysqli->prepare( "SELECT 3" );
      $select3->execute();
       
      ?>
      

      Error

      dcarver@dcarver:/private/tmp$ php test.php
       
      Fatal error: Uncaught mysqli_sql_exception: Commands out of sync; you can't run this command now in /private/tmp/test.php:18
      Stack trace:
      #0 /private/tmp/test.php(18): mysqli->prepare('SELECT 3')
      #1 {main}
        thrown in /private/tmp/test.php on line 18
      dcarver@dcarver:/private/tmp$ php test.php
       
      Fatal error: Uncaught mysqli_sql_exception: Commands out of sync; you can't run this command now in /private/tmp/test.php:18
      Stack trace:
      #0 /private/tmp/test.php(18): mysqli->prepare('SELECT 3')
      #1 {main}
        thrown in /private/tmp/test.php on line 18
      

      Attachments

        Activity

          People

            georg Georg Richter
            dcarver David Carver
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.