Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Not a Bug
-
N/A
-
None
Description
sys.table_exists shows TEMPORARY SEQUENCE - for temporary sequence, but just TEMPORARY if there exist also base table with the same name:
MariaDB [db]> create temporary sequence s1;
|
Query OK, 0 rows affected (0,003 sec)
|
|
MariaDB [db]> create temporary sequence s2;
|
Query OK, 0 rows affected (0,004 sec)
|
|
MariaDB [db]> create sequence s1;
|
Query OK, 0 rows affected (0,018 sec)
|
|
MariaDB [db]> show full tables;
|
+--------------+--------------------+
|
| Tables_in_db | Table_type |
|
+--------------+--------------------+
|
| s2 | TEMPORARY SEQUENCE |
|
| s1 | TEMPORARY SEQUENCE |
|
| s1 | SEQUENCE |
|
+--------------+--------------------+
|
3 rows in set (0,003 sec)
|
|
MariaDB [db]> CALL sys.table_exists('db', 's1', @table_type); SELECT @table_type;
|
Query OK, 0 rows affected (0,005 sec)
|
|
+-------------+
|
| @table_type |
|
+-------------+
|
| TEMPORARY |
|
+-------------+
|
1 row in set (0,001 sec)
|
|
MariaDB [db]> CALL sys.table_exists('db', 's2', @table_type); SELECT @table_type;
|
Query OK, 0 rows affected (0,005 sec)
|
|
+--------------------+
|
| @table_type |
|
+--------------------+
|
| TEMPORARY SEQUENCE |
|
+--------------------+
|
1 row in set (0,001 sec)
|
maybe we should change that procedure – currently there is:
SET v_table_type = (SELECT GROUP_CONCAT(TABLE_TYPE) FROM information_schema.TABLES WHERE
|
TABLE_SCHEMA = in_db AND TABLE_NAME = in_table);
|
IF v_table_type LIKE '%,%' THEN
|
SET out_exists = 'TEMPORARY';
|
Attachments
Issue Links
- relates to
-
MDEV-12459 The information_schema tables for getting temporary tables info is missing, at least for innodb there is no INNODB_TEMP_TABLE_INFO
- Closed