TEMPORARY Table Problems
The following list indicates limitations on the use of TEMPORARY tables:
- A
TEMPORARYtable can only be of typeMEMORY,MyISAM,MERGE, orInnoDB.Temporary tables are not supported for MariaDB Cluster.
- You cannot refer to a
TEMPORARYtable more than once in the same query. For example, the following does not work:mysql>
SELECT * FROM temp_table, temp_table AS t2;ERROR 1137: Can't reopen table: 'temp_table'This error also occurs if you refer to a temporary table multiple times in a stored function under different aliases, even if the references occur in different statements within the function.
- The
SHOW TABLESstatement does not listTEMPORARYtables. - You cannot use
RENAMEto rename aTEMPORARYtable. However, you can useALTER TABLEinstead:mysql>
ALTER TABLE orig_name RENAME new_name; - There are known issues in using temporary tables with replication. See , "Replication Features and Issues", for more information.