From cade744a5dc601769acba1d6ccced2ff2bd0690d Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 Jan 2003 23:39:28 +0200 Subject: ha_innodb.cc: Remove the question of Monty about user_thd / NULL after a merge from 4.0 to 4.1, user_thd is the right value in 4.1 sql/ha_innodb.cc: Remove the question of Monty about user_thd / NULL after a merge from 4.0 to 4.1, user_thd is the right value in 4.1 --- sql/ha_innodb.cc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index 86544542613..c5b9f7004d4 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -2511,11 +2511,6 @@ ha_innobase::change_active_index( the flag ROW_MYSQL_WHOLE_ROW below, but that caused unnecessary copying. Starting from MySQL-4.1 we use a more efficient flag here. */ - /* - TODO: In 4.0 the below user_thd was changed to NULL. - Heikki, please delete this comment after you have read this and may - acted upon it. - */ build_template(prebuilt, user_thd, table, ROW_MYSQL_REC_FIELDS); DBUG_RETURN(0); -- cgit v1.2.1 From f8c2477a3dc0ab1f3283feef50d54a0e197574c4 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 20 Jan 2003 14:00:50 -0800 Subject: Multi query fix the recursion (SCRUM - For Monty) --- sql/sql_parse.cc | 33 ++++++++++++++++++++++++--------- sql/sql_prepare.cc | 6 +++++- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index a44c95188fd..b5949b93297 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1200,6 +1200,29 @@ bool dispatch_command(enum enum_server_command command, THD *thd, mysql_log.write(thd,command,"%s",thd->query); DBUG_PRINT("query",("%-.4096s",thd->query)); mysql_parse(thd,thd->query, thd->query_length); + + while (!thd->fatal_error && thd->lex.found_colon) + { + /* + Multiple queries exits, execute them individually + */ + if (thd->lock || thd->open_tables || thd->derived_tables) + close_thread_tables(thd); + + uint length= thd->query_length-(uint)(thd->lex.found_colon-thd->query); + + /* Remove garbage at start of query */ + char *packet= thd->lex.found_colon; + while (my_isspace(system_charset_info,packet[0]) && length > 0) + { + packet++; + length--; + } + thd->query= packet; + thd->query_length= length; + mysql_parse(thd, packet, length); + } + if (!(specialflag & SPECIAL_NO_PRIOR)) my_pthread_setprio(pthread_self(),WAIT_PRIOR); DBUG_PRINT("info",("query ready")); @@ -1427,14 +1450,6 @@ bool dispatch_command(enum enum_server_command command, THD *thd, mysql_slow_log.write(thd, thd->query, thd->query_length, start_of_query); } } - if (command == COM_QUERY && thd->lex.found_colon) - { - /* - Multiple queries exits, execute them individually - */ - uint length= thd->query_length-(uint)(thd->lex.found_colon-thd->query)+1; - dispatch_command(command, thd, thd->lex.found_colon, length); - } thd->proc_info="cleaning up"; VOID(pthread_mutex_lock(&LOCK_thread_count)); // For process list thd->proc_info=0; @@ -1465,7 +1480,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd, bool alloc_query(THD *thd, char *packet, ulong packet_length) { packet_length--; // Remove end null - /* Remove garage at start and end of query */ + /* Remove garbage at start and end of query */ while (my_isspace(system_charset_info,packet[0]) && packet_length > 0) { packet++; diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc index 8e0c031065e..1c6a618427e 100644 --- a/sql/sql_prepare.cc +++ b/sql/sql_prepare.cc @@ -30,7 +30,11 @@ Prepare: - Without executing the query, return back to client the total number of parameters along with result-set metadata information (if any) in the following format: - [STMT_ID:4][Columns:2][Param_count:2][Columns meta info][Params meta info] + [STMT_ID:4] + [Column_count:2] + [Param_count:2] + [Columns meta info] (if Column_count > 0) + [Params meta info] (if Param_count > 0 ) (TODO : 4.1.1) Prepare-execute: -- cgit v1.2.1