diff options
author | Anel Husakovic <anel@mariadb.org> | 2022-02-20 19:43:50 +0100 |
---|---|---|
committer | Anel Husakovic <anel@mariadb.org> | 2022-03-15 13:15:42 +0100 |
commit | f19fab1dad67f67f04b8b9c868675b6645ef571c (patch) | |
tree | 9312e01ce3e04ab60eae9ff9e73c811215ac7645 | |
parent | ca83ea9482e1452d3e73fa1cdba1f90434b62af7 (diff) | |
download | mariadb-git-bb-10.7-anel-MDEV-12459-temp-tables.tar.gz |
Part of MDEV-12459: Update tests and cosmetic fixesbb-10.7-anel-MDEV-12459-temp-tables
1. Update the tests
2. Compress the logic and handle indentation based on that
Reviewed by: monty@mariadb.org
-rw-r--r-- | sql/sql_show.cc | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 2083c086409..5c09edd7b00 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -5234,21 +5234,18 @@ int get_all_tables(THD *thd, TABLE_LIST *tables, COND *cond) init_alloc_root(PSI_INSTRUMENT_ME, &tmp_mem_root, SHOW_ALLOC_BLOCK_SIZE, SHOW_ALLOC_BLOCK_SIZE, MY_THREAD_SPECIFIC); - /* Handling session temporary tables from the backup state*/ - if (schema_table_idx == SCH_TABLES) + /* Handling session temporary tables from the backup state */ + if (schema_table_idx == SCH_TABLES && open_tables_state_backup.temporary_tables) { - if (open_tables_state_backup.temporary_tables) + All_tmp_tables_list::Iterator it(*open_tables_state_backup.temporary_tables); + TMP_TABLE_SHARE *share_temp; + while ((share_temp= it++)) { - All_tmp_tables_list::Iterator it(*open_tables_state_backup.temporary_tables); - TMP_TABLE_SHARE *share_temp; - while ((share_temp= it++)) + All_share_tables_list::Iterator it2(share_temp->all_tmp_tables); + while (TABLE *tmp_tbl= it2++) { - All_share_tables_list::Iterator it2(share_temp->all_tmp_tables); - while (TABLE *tmp_tbl= it2++) - { - if (IS_USER_TEMP_TABLE(share_temp)) - process_i_s_table_temporary_tables(thd, table, tmp_tbl); - } + if (IS_USER_TEMP_TABLE(share_temp)) + process_i_s_table_temporary_tables(thd, table, tmp_tbl); } } } @@ -5805,7 +5802,6 @@ err: /** @brief Fill IS.table with temporary tables - @details The function does... @param[in] table I_S table (TABLE) @param[in] db_name db name of temporary table @param[in] table_name table name of temporary table |