mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Don't try to open temporary tables if there are no temporary tables.
This was done to increase performance when not using temporary tables as checking if a table is a temporary table involves a lot of code.
This commit is contained in:
@ -3691,9 +3691,9 @@ open_and_process_table(THD *thd, TABLE_LIST *tables, uint *counter, uint flags,
|
||||
The problem is that since those attributes are not set in merge
|
||||
children, another round of PREPARE will not help.
|
||||
*/
|
||||
error= thd->open_temporary_table(tables);
|
||||
|
||||
if (!error && !tables->table)
|
||||
if (!thd->has_temporary_tables() ||
|
||||
(!(error= thd->open_temporary_table(tables)) &&
|
||||
!tables->table))
|
||||
error= open_table(thd, tables, ot_ctx);
|
||||
|
||||
thd->pop_internal_handler();
|
||||
@ -3710,9 +3710,9 @@ open_and_process_table(THD *thd, TABLE_LIST *tables, uint *counter, uint flags,
|
||||
Repair_mrg_table_error_handler repair_mrg_table_handler;
|
||||
thd->push_internal_handler(&repair_mrg_table_handler);
|
||||
|
||||
error= thd->open_temporary_table(tables);
|
||||
|
||||
if (!error && !tables->table)
|
||||
if (!thd->has_temporary_tables() ||
|
||||
(!(error= thd->open_temporary_table(tables)) &&
|
||||
!tables->table))
|
||||
error= open_table(thd, tables, ot_ctx);
|
||||
|
||||
thd->pop_internal_handler();
|
||||
@ -3727,7 +3727,8 @@ open_and_process_table(THD *thd, TABLE_LIST *tables, uint *counter, uint flags,
|
||||
still might need to look for a temporary table if this table
|
||||
list element corresponds to underlying table of a merge table.
|
||||
*/
|
||||
error= thd->open_temporary_table(tables);
|
||||
if (thd->has_temporary_tables())
|
||||
error= thd->open_temporary_table(tables);
|
||||
}
|
||||
|
||||
if (!error && !tables->table)
|
||||
|
Reference in New Issue
Block a user