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

can't use two statements per connection

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • 3.0.0, 2.3.1
    • 3.0.1, 2.3.2
    • None
    • None

    Description

      Follow code have a bug

      static int stmt_cursor_fetch(MYSQL_STMT *stmt, uchar **row)
      {
        uchar buf[STMT_ID_LENGTH + 4];
        MYSQL_DATA *result= &stmt->result;
       
        DBUG_ENTER("stmt_cursor_fetch");
       
        if (stmt->state < MYSQL_STMT_USE_OR_STORE_CALLED)
        {
          SET_CLIENT_STMT_ERROR(stmt, CR_COMMANDS_OUT_OF_SYNC, SQLSTATE_UNKNOWN, 0);
          DBUG_RETURN(1);
        }
       
        /* do we have some prefetched rows available ? */
        if (stmt->result_cursor)
          DBUG_RETURN(stmt_buffered_fetch(stmt, row));
        if (stmt->mysql->server_status & SERVER_STATUS_LAST_ROW_SENT)
          stmt->mysql->server_status&=  ~SERVER_STATUS_LAST_ROW_SENT;
      

      stmt->mysql is used for all smts for this mysql connect, so one stmt fetch over, will cause other stmt return MYSQL_NO_DATA. cann't fetch real data.
      should use stmt->upsert_status->server_status.

      Attachments

        Activity

          People

            georg Georg Richter
            shuianle shuianle
            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.