1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Fix the client_test failure (due to failing cursors tests after the merge).

This commit is contained in:
konstantin@mysql.com
2004-11-05 22:39:19 +03:00
parent fe5889dee5
commit 97a5fe8e65
2 changed files with 33 additions and 53 deletions

View File

@ -1898,7 +1898,7 @@ void mysql_stmt_execute(THD *thd, char *packet, uint packet_length)
{
if (stmt->cursor->is_open())
stmt->cursor->init_from_thd(thd);
thd->set_item_arena(&thd->stmt_backup);
stmt->cursor->state= stmt->state;
}
else
{
@ -2044,6 +2044,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
DBUG_ENTER("mysql_stmt_fetch");
thd->current_arena= stmt;
if (!(stmt= thd->stmt_map.find(stmt_id)) ||
!stmt->cursor ||
!stmt->cursor->is_open())
@ -2053,9 +2054,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
DBUG_VOID_RETURN;
}
thd->stmt_backup.set_statement(thd);
thd->stmt_backup.set_item_arena(thd);
thd->set_statement(stmt);
thd->set_n_backup_statement(stmt, &thd->stmt_backup);
stmt->cursor->init_thd(thd);
if (!(specialflag & SPECIAL_NO_PRIOR))
@ -2070,11 +2069,8 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
/* Restore THD state */
stmt->cursor->reset_thd(thd);
thd->set_statement(&thd->stmt_backup);
thd->set_item_arena(&thd->stmt_backup);
if (error && error != -4)
send_error(thd, ER_OUT_OF_RESOURCES);
thd->restore_backup_statement(stmt, &thd->stmt_backup);
thd->current_arena= thd;
DBUG_VOID_RETURN;
}
@ -2085,7 +2081,7 @@ void mysql_stmt_fetch(THD *thd, char *packet, uint packet_length)
SYNOPSIS
mysql_stmt_reset()
thd Thread handle
packet Packet with stmt id
packet Packet with stmt id
DESCRIPTION
This function resets statement to the state it was right after prepare.