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

mysql_reset_connection doesn't work with multiple results

    XMLWordPrintable

Details

    • Task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.1.19, 3.3.3
    • 3.1.21
    • Other
    • None

    Description

      mysql_reset_connection returns error 2014 (commands out of sync) if there are multiple result sets.

      static int test_reset2(MYSQL *my __attribute__((unused)))
      {
        MYSQL *mysql= mysql_init(NULL);
        int rc;
       
        if (!my_test_connect(mysql, hostname, username, password, schema, port, socketname, CLIENT_REMEMBER_OPTIONS))
        {
          diag("Connection failed. Error: %s", mysql_error(mysql));
          mysql_close(mysql);
          return FAIL;
        }
       
        rc= mysql_query(mysql, "CREATE OR REPLACE PROCEDURE test_reset() "
                               "BEGIN "
                               "  SELECT 1;"
                               "  SELECT 2;"
                               "END");
        check_mysql_rc(rc, mysql);
       
        rc= mysql_query(mysql, "CALL test_reset()");
        check_mysql_rc(rc, mysql);
       
        rc= mysql_reset_connection(mysql);
        check_mysql_rc(rc, mysql);
       
        rc= mysql_ping(mysql);
        check_mysql_rc(rc, mysql);
       
        rc= mysql_query(mysql, "DROP PROCEDIRE test_reset");
        check_mysql_rc(rc, mysql);
       
        mysql_close(mysql);
        return OK;
      }
      

      Attachments

        Activity

          People

            georg Georg Richter
            georg Georg Richter
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.