Commit 667a81eb authored by unknown's avatar unknown

Fix to make the tables re-inited for every execute call

parent a3ffb06a
......@@ -628,7 +628,7 @@ static bool parse_prepare_query(PREP_STMT *stmt,
Initialize parameter items in statement
*/
static bool init_param_items( PREP_STMT *stmt)
static bool init_param_items(PREP_STMT *stmt)
{
List<Item> &params= stmt->thd->lex.param_list;
Item_param **to;
......@@ -642,6 +642,24 @@ static bool init_param_items( PREP_STMT *stmt)
return 0;
}
/*
Initialize stmt execution
*/
static void init_stmt_execute(PREP_STMT *stmt)
{
THD *thd= stmt->thd;
TABLE_LIST *tables=(TABLE_LIST*) thd->lex.select_lex.table_list.first;
/*
TODO: When the new table structure is ready, then have a status bit
to indicate the table is altered, and re-do the setup_*
and open the tables back.
*/
if (tables)
tables->table=0; //safety - nasty init
}
/*
Parse the query and send the total number of parameters
and resultset metadata information back to client (if any),
......@@ -722,6 +740,8 @@ void mysql_stmt_execute(THD *thd, char *packet)
DBUG_VOID_RETURN;
}
init_stmt_execute(stmt);
if (stmt->param_count && setup_params_data(stmt))
DBUG_VOID_RETURN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment