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

can't use two statements per connection

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0, 2.3.1
    • Fix Version/s: 3.0.1, 2.3.2
    • Component/s: None
    • Labels:
      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

            Assignee:
            georg Georg Richter
            Reporter:
            shuianle shuianle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: