mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
PS fixed to be compatible with derived tables (BUG#2641)
sql/mysql_priv.h: description moved to be accessable from sql_class.h sql/sql_base.cc: put all derived table preparation in temporary memory pull sql/sql_class.h: close tables to close derived tables before freeing memory pool where they are placed sql/sql_prepare.cc: now temporary memory pool for prrepared statements registration is oppened in open_and_lock_tables thd->current_statement set only for tables preparation, because we do not need memory pool tricks for PS executing tests/client_test.c: derived table added to test expression with aggregate functions added to test
This commit is contained in:
@ -1590,6 +1590,14 @@ int open_and_lock_tables(THD *thd, TABLE_LIST *tables)
|
||||
if (open_tables(thd, tables, &counter) || lock_tables(thd, tables, counter))
|
||||
DBUG_RETURN(-1); /* purecov: inspected */
|
||||
fix_tables_pointers(thd->lex->all_selects_list);
|
||||
|
||||
/*
|
||||
open temporary memory pool, which will be closed in
|
||||
mysql_test_select_fields, mysql_test_upd_fields or
|
||||
mysql_test_insert_fields
|
||||
*/
|
||||
if (thd->current_statement)
|
||||
thd->ps_setup_prepare_memory();
|
||||
DBUG_RETURN(mysql_handle_derived(thd->lex));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user