mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Better handling of ensuring that setup_tables() are not called twice
This fixed a bug in prepared statements when used with outher joins Fixed a bug in SUM(DISTINCT) when used with prepared statements. Some safety fixes in test scripts to ensure that previous test failures shouldn't affect other tests mysql-test/r/mysqldump.result: Safety fix if a previous test would fail mysql-test/r/show_check.result: Safety fix if a previous test would fail mysql-test/r/sp.result: Fix for --ps-protocol mysql-test/r/synchronization.result: Safety fix if a previous test would fail mysql-test/r/system_mysql_db.result: Safety fix if a previous test would fail mysql-test/t/mysqldump.test: Safety fix if a previous test would fail mysql-test/t/select.test: Safety fix if a previous test would fail mysql-test/t/show_check.test: Safety fix if a previous test would fail mysql-test/t/sp.test: fix for --ps-protocol mysql-test/t/strict.test: Fix for --ps-protocol mysql-test/t/synchronization.test: Safety fix if a previous test would fail mysql-test/t/system_mysql_db.test: Safety fix if a previous test would fail sql/item_sum.cc: Fix bug in SUM(DISTINCT...) when using with prepared statements sql/item_sum.h: Fix bug in SUM(DISTINCT...) when using with prepared statements sql/mysql_priv.h: Better handling of ensuring that setup_tables() are not called twice sql/sql_base.cc: Better handling of ensuring that setup_tables() are not called twice sql/sql_insert.cc: Better handling of ensuring that setup_tables() are not called twice sql/sql_parse.cc: Better handling of ensuring that setup_tables() are not called twice sql/sql_prepare.cc: Better handling of ensuring that setup_tables() are not called twice sql/sql_select.cc: Better handling of ensuring that setup_tables() are not called twice sql/sql_union.cc: Better handling of ensuring that setup_tables() are not called twice sql/sql_update.cc: Better handling of ensuring that setup_tables() are not called twice sql/table.h: Better handling of ensuring that setup_tables() are not called twice
This commit is contained in:
@ -2212,7 +2212,7 @@ mysql_execute_command(THD *thd)
|
||||
if (!result && !(result= new select_send()))
|
||||
goto error;
|
||||
query_cache_store_query(thd, all_tables);
|
||||
res= handle_select(thd, lex, result);
|
||||
res= handle_select(thd, lex, result, 0);
|
||||
if (result != lex->result)
|
||||
delete result;
|
||||
}
|
||||
@ -2635,7 +2635,7 @@ mysql_execute_command(THD *thd)
|
||||
and item_list belong to SELECT
|
||||
*/
|
||||
select_lex->resolve_mode= SELECT_LEX::SELECT_MODE;
|
||||
res=handle_select(thd, lex, result);
|
||||
res= handle_select(thd, lex, result, 0);
|
||||
select_lex->resolve_mode= SELECT_LEX::NOMATTER_MODE;
|
||||
delete result;
|
||||
}
|
||||
@ -3005,7 +3005,7 @@ create_error:
|
||||
and item_list belong to SELECT
|
||||
*/
|
||||
lex->select_lex.resolve_mode= SELECT_LEX::SELECT_MODE;
|
||||
res= handle_select(thd, lex, result);
|
||||
res= handle_select(thd, lex, result, OPTION_SETUP_TABLES_DONE);
|
||||
lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE;
|
||||
delete result;
|
||||
}
|
||||
@ -3092,7 +3092,8 @@ create_error:
|
||||
0, (ORDER *)NULL, (ORDER *)NULL, (Item *)NULL,
|
||||
(ORDER *)NULL,
|
||||
select_lex->options | thd->options |
|
||||
SELECT_NO_JOIN_CACHE | SELECT_NO_UNLOCK,
|
||||
SELECT_NO_JOIN_CACHE | SELECT_NO_UNLOCK |
|
||||
OPTION_SETUP_TABLES_DONE,
|
||||
result, unit, select_lex);
|
||||
delete result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user