diff options
author | unknown <venu@myvenu.com> | 2003-01-30 00:38:11 -0800 |
---|---|---|
committer | unknown <venu@myvenu.com> | 2003-01-30 00:38:11 -0800 |
commit | 7d0d2d4f85f921f567ebf46d75b9aab32b5f486e (patch) | |
tree | b44894af687099c5f4b6788966f6f5eab2fafbd3 /sql/sql_prepare.cc | |
parent | a8abb0471ea4792fc002b817f130501e63e9507b (diff) | |
download | mariadb-git-7d0d2d4f85f921f567ebf46d75b9aab32b5f486e.tar.gz |
Fix 'n' concurrent prepared executions
sql/sql_prepare.cc:
Fix 'n' concurrent executions
libmysql/errmsg.c:
Fix the missing semicolon for errors
libmysql/libmysql.c:
Fix the result meta info for non-SELECT statements
Diffstat (limited to 'sql/sql_prepare.cc')
-rw-r--r-- | sql/sql_prepare.cc | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 820a153f855..775ecf17fb2 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -684,6 +684,7 @@ static bool init_param_items(PREP_STMT *stmt) List<Item> ¶ms= stmt->thd->lex.param_list; Item_param **to; + stmt->lex= stmt->thd->lex; if (!stmt->param_count) stmt->param= (Item_param **)0; else @@ -705,7 +706,7 @@ static bool init_param_items(PREP_STMT *stmt) static void init_stmt_execute(PREP_STMT *stmt) { THD *thd= stmt->thd; - TABLE_LIST *tables=(TABLE_LIST*) thd->lex.select_lex.table_list.first; + 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 @@ -713,7 +714,7 @@ static void init_stmt_execute(PREP_STMT *stmt) and open the tables back. */ if (tables) - tables->table=0; //safety - nasty init + tables->table= 0; //safety - nasty init } /* @@ -796,10 +797,8 @@ void mysql_stmt_execute(THD *thd, char *packet) DBUG_VOID_RETURN; } - if (my_pthread_setspecific_ptr(THR_THD, stmt->thd) || - my_pthread_setspecific_ptr(THR_MALLOC, &stmt->thd->mem_root)) - DBUG_VOID_RETURN; - + LEX thd_lex= thd->lex; + thd->lex= stmt->lex; init_stmt_execute(stmt); if (stmt->param_count && setup_params_data(stmt)) @@ -814,17 +813,14 @@ void mysql_stmt_execute(THD *thd, char *packet) mysql_delete(), mysql_update() and mysql_select() to not to have re-check on setup_* and other things .. */ - THD *cur_thd= stmt->thd; - cur_thd->protocol= &cur_thd->protocol_prep; // Switch to binary protocol - mysql_execute_command(cur_thd); - cur_thd->protocol= &cur_thd->protocol_simple; // Use normal protocol + thd->protocol= &thd->protocol_prep; // Switch to binary protocol + mysql_execute_command(thd); + thd->protocol= &thd->protocol_simple; // Use normal protocol if (!(specialflag & SPECIAL_NO_PRIOR)) my_pthread_setprio(pthread_self(), WAIT_PRIOR); - my_pthread_setspecific_ptr(THR_THD, thd); - my_pthread_setspecific_ptr(THR_MALLOC, &thd->mem_root); - + thd->lex= thd_lex; DBUG_VOID_RETURN; } |