[MDEV-6425] CREATE TEMPORARY TABLE name LIKE same_name Created: 2014-07-08  Updated: 2022-09-08

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.38, 10.0.12
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Federico Razzoli Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: upstream


 Description   

MariaDB [test]> CREATE TABLE tab (c INT) ENGINE = InnoDB;
Query OK, 0 rows affected (0.43 sec)
MariaDB [test]> CREATE TEMPORARY TABLE tab LIKE tab;
ERROR 1066 (42000): Not unique table/alias: 'tab'

I suppose that this error should only appear if I omit the TEMPORARY keyword, or if a temporary table with that name already exists. In this case, the old table and the new table are distinct entities...



 Comments   
Comment by Elena Stepanova [ 2014-07-08 ]

I agree that it looks weird, especially since CREATE TEMPORARY TABLE tab AS SELECT * FROM tab works, although I suppose there is an explanation for this, since it's an upstream issue that has survived so long. Do you want to file one at bugs.mysql.com and see what they say?

Comment by Federico Razzoli [ 2014-07-09 ]

Ok, I reported it:

http://bugs.mysql.com/?id=73236

Generated at Thu Feb 08 07:11:48 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.