Details
-
Type:
Task
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Fix Version/s: None
-
Component/s: Parser
-
Labels:None
Description
It would be great to have "reversed executable comments", that is, commented code that is only parsed on versions older ##.##.##.
An example is when we want to execute CREATE OR REPLACE TABLE on 10.0, and CREATE TABLE IF NOT EXISTS on older versions.
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
It looks like a generic feature request, not a bug anyhow related to CREATE OR REPLACE TABLE.
If it's a bug about CREATE OR REPLACE, I would close it as not-a-bug, because
a) indeed, CREATE OR REPLACE TABLE IF NOT EXISTS does not work, simply because it makes no logical sense,
b) CREATE OR REPLACE is not a replacement for CREATE IF NOT EXISTS, they serve different purposes, and I'd say in general trying to juggle them in the same context is more dangerous than beneficial, because your application will have to take into account that maybe the table was re-created and hence is empty and might have a different structure, or it was not touched and hence it has contents etc.; and
c) new syntax does not normally come with some means for backward compatibility.
Of course, in some specific situations (and yours might be one of those, I can't know) it can make sense.
I suggest you modify the subject to the request about reversed executable comments, having CREATE OR REPLACE vs NOT EXISTS as a mere example of what you're trying to achieve, and I'll convert the issue into a task.