Details
-
New Feature
-
Status: In Testing (View Workflow)
-
Critical
-
Resolution: Unresolved
-
None
-
Q4/2025 Server Maintenance
Description
GLOBAL TEMPORARY TABLE is a feature found in Oracle, MSSQL, PostgreSQL etc.
Syntax in Oracle:
CREATE GLOBAL TEMPORARY TABLE tmp_table |
{ (create_definition, ...)
|
| [SELECT * FROM tbl_NAME WHERE conditions ] } |
ON COMMIT [DELETE | PRESERVE] ROWS |
The purpose of this syntax is to create temporary table where each user can have
their own data, which is destroyed at the end of the session.
Any user with access right to this table can access and use it.
One suggested way to implement this in MariaDB is to have "CREATE GLOBAL TEMPORARY t1" create a 'template' for future temporary tables with name t1.
Internally in MariaDB we would only create a .frm file for the table.
On first access to the table, MariaDB would internally execute
"CREATE TEMPORARY TABLE t1 LIKE t1" on the engine used when "CREATE GLOBAL ..." was created. Any future usage of t1 would use the temporary table t1.
"DROP TABLE t1" would drop the internal temporary table.
To drop the global one, one would have to use "DROP GLOBAL TEMPORARY TABLE".
Before starting implementing this, please check with SQL Standard, Oracle, MSSQL and PostgreSQL that the above implementation would work as GLOBAL TEMPORARY tables are expected to work
Attachments
Issue Links
- blocks
-
MCOL-5642 support querying temporary tables with cross engine joins
-
- Open
-
- causes
-
MDEV-37368 Assertion failed in close_thread_tables on UPDATE referring bad field
-
- Closed
-
-
MDEV-37369 SIGSEGV on NEXTVAL from Global temporary table
-
- Closed
-
-
MDEV-37378 SIGSEGV in MDL_ticket::has_stronger_or_equal_type and Assertion `!table->s->tmp_table' failed in wait_while_table_is_used on CREATE TRIGGER
-
- Closed
-
-
MDEV-37379 Assertion `index->is_readable()' failed in dict_create_index_tree_in_mem on REPLACE DELAYED
-
- Open
-
-
MDEV-37380 SIGSEGV in thr_upgrade_write_delay_lock and ASAN use-after-poison in Delayed_insert::handle_inserts on INSERT DELAYED
-
- Closed
-
-
MDEV-37381 SIGSEGV in mysql_ha_close_table after HANDLER OPEN of Global temporary table
-
- Confirmed
-
-
MDEV-37382 SIGSEGV and UBSAN null-pointer-use in wait_while_table_is_used on CoR GTT
-
- Closed
-
-
MDEV-37383 Crash in end_read_record after REPAIR of Global temporary table
-
- In Progress
-
-
MDEV-37384 SIGSEGV in mysql_unpack_partition on CREATE GTT ... LIKE partitioned table
-
- Open
-
-
MDEV-37385 Thread hang on CoR where the original table is a GTT
-
- Open
-
-
MDEV-37394 SIGSEGV in handler::ha_external_lock on CREATE GTT ... ENGINE=INNODB SELECT, ASAN heap-use-after-free in unlock_external
-
- In Progress
-
-
MDEV-37395 SIGSEGV on CREATE TABLE ... SELECT where source table is a GTT
-
- Closed
-
-
MDEV-37576 Assertion `!global_table.versioned()' failed after ALTER TABLE GTT ADD SYSTEM VERSIONING
-
- Closed
-
-
MDEV-37577 Assertion `has_temporary_tables() || (rgi_slave && rgi_slave->is_parallel_exec)' failed in THD::open_temporary_table on CREATE TABLE
-
- Stalled
-
-
MDEV-37578 Assertion failed in TDC_element::flush on ALTER TABLE GTT DISCARD TABLESPACE
-
- Closed
-
-
MDEV-37579 use-after-free in MDL_context::release_lock on FLUSH TABLE GTT
-
- Closed
-
-
MDEV-37594 Thread hang on TRUNCATE GTT after server_id change
-
- In Testing
-
-
MDEV-37595 Assertion `thd->transaction->stmt.is_empty()' failed in mysql_ha_open when using mrg_myisam GTT
-
- Closed
-
-
MDEV-37596 Inconsistencies in handling of BINLOG commands for GTT vs TT
-
- Open
-
-
MDEV-37597 InnoDB: Failing assertion: table->get_ref_count() == 0 in dict_sys_t::remove on UPDATE
-
- Closed
-
-
MDEV-37612 SIGSEGV in mysql_ha_close_table (opt) and in MDL_ticket::has_pending_conflicting_lock (dbg) after HANDLER OPEN
-
- Confirmed
-
- is blocked by
-
MDEV-37348 Logged CREATE TEMPORARY TABLE LIKE from unlogged table fails
-
- Closed
-
- is part of
-
MDEV-32521 SQL Server compatibility
-
- Open
-
-
MDEV-35388 PostgreSQL-compatible syntax
-
- Open
-
-
MDEV-35973 Oracle Compatibility Project 1 for 2025
-
- Stalled
-
- relates to
-
MDEV-10872 Providing compatibility Oracle database
-
- Open
-
- links to