Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 447 by
t...@stordy-allison.com: Nested multi-line SQL comments
pased in a possible incorrect manner
http://code.google.com/p/flyway/issues/detail?id=447
The following SQL would cause the final line to be executed incorrectly:
/*comment line
/*nested comment*/
more comment text*/
Flyway currently attempts to execute 'more comment text*/'.
---
It it not clear if a nested comment is even valid though: the SQL 2003
standard defines the comments using BNF, which is context-free and I don't
believe can support the idea of a comment that is nested. The Eclipse
parser does however allow for a nested comment, behaving as expected.
See:
http://stackoverflow.com/questions/728172/are-there-multiline-comment-delimiters-in-sql-that-are-vendor-agnostic
for the BNF notation.
Alex: I'll leave you to decide on this one.
--
Rationale for use:
We are in some cases using the placeholders to give us conditionally
executed block of SQL in our scripts. This is as some environments we need
to create SYNONYMs, and in other we would rather a test table. In
production, we have the SYNONYM and in local development the test table.
To achieve this we use a multi-line comment start (/*) and end (*/) to
activate/deactivate the code. If there are any multi-line comments in the
block that we try to deactivate, flyway attempts to execute invalid
statements due to the behavior above.
--
Patch and test to fix attached.
Attachments:
patch.txt 2.4 KB
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings