Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
3.0.0, 2.3.1
-
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.