Details

    • Type: Task
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Fix Version/s: N/A
    • Component/s: OTHER
    • Labels:

      Description

      There are cases when I want to use CREATE OR REPLACE TABLE, but also want the statement to work on pre-10.0 versions with an IF NOT EXISTS clause. But OR REPLACE and IF NOT EXISTS can't be both specified, because an error occurs.

      So, I have a feature request. Pre-10.0 versions could treat OR REPLACE like IF NOT EXISTS. I understand that the behaviour would be internally different, but it would be ok in most cases I can think.

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

            I think it would be a pretty weird behavior. Because, precisely, the semantics is different.
            It's like replacing UPDATE with DELETE+INSERT.

            But if we implement MDEV-7381, then you could achieve the same effect with

            CREATE /*!1000 OR REPLACE */ TABLE /*!<1000 IF NOT EXISTS */ t1 ...
            

            (I don't know what syntax will be implemented in MDEV-7381, so I've arbitrarily used /*!<####)

            Show
            serg Sergei Golubchik added a comment - I think it would be a pretty weird behavior. Because, precisely, the semantics is different. It's like replacing UPDATE with DELETE+INSERT. But if we implement MDEV-7381 , then you could achieve the same effect with CREATE /*!1000 OR REPLACE */ TABLE /*!<1000 IF NOT EXISTS */ t1 ... (I don't know what syntax will be implemented in MDEV-7381 , so I've arbitrarily used /*!<#### )

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                f_razzoli Federico Razzoli
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: