I just noticed this when it was causing a statement from my migration not to run:
update blabla ...; -- something helpful
alter table ...
The comment ends up prepended to the second statement, turning it into a comment.
This patch just adds a test. Not sure what the best fix is, as just looking for a "--" anywhere in the line could also match in a quoted string (even though that is somewhat unlikely) or how exactly you want to handle it within stored procs.
A simple fix might be to to join multiple lines of a statement with "\n" rather than " ", so that if a comment does pass through subsequent lines don't get merged into the comment (which is what happened in my migration case) and the driver /db itself will handle it.
I just noticed this when it was causing a statement from my migration not to run:
The comment ends up prepended to the second statement, turning it into a comment.
This patch just adds a test. Not sure what the best fix is, as just looking for a "--" anywhere in the line could also match in a quoted string (even though that is somewhat unlikely) or how exactly you want to handle it within stored procs.
A simple fix might be to to join multiple lines of a statement with "\n" rather than " ", so that if a comment does pass through subsequent lines don't get merged into the comment (which is what happened in my migration case) and the driver /db itself will handle it.