mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +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
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