Details
-
Task
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
Description
Currently, before Mysql 5.7, there was no way to get information from a temporary table (session table) using the information_schema. Now with Mysql 5.7 there is a new table named 'INNODB_TEMP_TABLE_INFO'.
According to documentation: https://mariadb.com/kb/en/mariadb/information-schema-temp_tables_info-table/
There was a table names 'TEMP_TABLES_INFO' which was introduced in 10.2.2 but removed in 10.2.4. I think maybe you're thinking to implement another solution which can cover all the needs.
The example shows how to use 'INNODB_TEMP_TABLE_INFO' but it doesn't exist
BTW that mysql's implementation is very limited, there no way you can query against temporary tables fields using a SELECT statement.
Summary from comments
This is what will be implemented:
1. list session ([#1]) temporary tables in I_S.TABLES with column TABLE_TYPE="TEMPORARY"([#2])
2. by design they will not be listed in I_S.COLUMNS and other I_S tables ([#3]). This MDEV will not implement changes related to the temporary table and I_S.COLUMNS .
3. issue a warning on CREATE if a new temp table shadows non-temp table ([#4]), not vice-versa.
References:
[#1] - No need for connection_id column to list all threads (MDEV-15623 should do that).
[#2] - Standard prescribes "GLOBAL TEMPORARY" or "LOCAL TEMPORARY" but our tables are neither, so let's just use "TEMPORARY".
[#3] - I_S.COLUMNS, I_S.STATISTICS, I_S.TABLE_CONSTRAINTS, I_S.KEY_COLUMN_USAGE, I_S.PARTITIONS, I_S.FILES ( ? ), I_S.CHECK_CONSTRAINTS. Comment.
MariaDB should be also able to show their fields in INFORMATION_SCHEMA.COLUMNS, and any other metadata associated to a normal table. But at least, implementing INFORMATION_SCHEMA.TABLES and INFORMATION_SCHEMA.COLUMNS will help a lot.
[#4] - Based on comment
Attachments
Issue Links
- causes
-
MDEV-28332 Alter on temporary table causes ER_TABLE_EXISTS_ERROR note
- Closed
-
MDEV-28334 SHOW TABLE STATUS shows all temporary tables ignoring database and conditions
- Closed
-
MDEV-28335 TABLE_TYPE for temporary sequences is the same as for permanent ones
- Closed
-
MDEV-28343 sys.create_synonym_db fails with ER_VIEW_SELECT_TMPTABLE when schema contains temporary tables
- Closed
-
MDEV-28351 Assertion `this->file->children_attached' failed in ha_myisammrg::info
- Closed
-
MDEV-28453 SHOW commands are inconsistent for temporary tables
- Closed
-
MDEV-31618 Server crashes in process_i_s_table_temporary_tables/get_all_tables
- Closed
-
MDEV-31837 Server crashes in process_i_s_table_temporary_tables/get_all_tables
- Closed
- is part of
-
MDEV-28112 prepare 10.9.0 preview releases
- Closed
- relates to
-
MDEV-10356 rpl.rpl_parallel_temptable failure due to incorrect commit optimization of temptables
- Closed
-
MDEV-11785 Remove INFORMATION_SCHEMA.INNODB_TEMP_TABLE_INFO (was: Server crashes in i_s_innodb_temp_table_info_fill_table)
- Closed
-
MDEV-15623 Show temporary tables for all sessions in information schema
- Open
-
MDEV-17805 Do not add temporary tables to dict_sys->table_hash
- Stalled
-
MDEV-23643 Column information of a TEMPORARY table as a server side CURSOR
- Open
-
MDEV-25064 rpl.rpl_parallel_temptable failed in bb, ASAN heap-use-after-free in std::__atomic_base<long>::store
- Closed
-
MDEV-28325 I_S.CHECK_CONSTRAINTS, COLUMNS etc. do not show temporary tables
- Closed
-
MDEV-28333 CREATE_TIME is not populated for temporary InnoDB tables
- Closed
-
MDEV-28455 CREATE TEMPORARY TABLES privilege is insufficient for SHOW COLUMNS
- Closed
-
CONJ-1108 Database metadata listing TEMPORARY tables/sequences
- Closed
-
MDEV-31773 sys.table_exists results for temporary sequence differ
- Closed