Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-6425

CREATE TEMPORARY TABLE name LIKE same_name

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.5.38, 10.0.12
    • Fix Version/s: 10.0
    • Component/s: None
    • Labels:

      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...

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              elenst Elena Stepanova added a comment -

              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?

              Show
              elenst Elena Stepanova added a comment - 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?
              Hide
              f_razzoli Federico Razzoli added a comment -
              Show
              f_razzoli Federico Razzoli added a comment - Ok, I reported it: http://bugs.mysql.com/?id=73236

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  f_razzoli Federico Razzoli
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated: