[
http://jira.codehaus.org/browse/MSQL-47?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=207002#action_207002
]
Mark Struberg commented on MSQL-47:
-----------------------------------
It looks like our algorithm to split SQL commands is broken if a line contains
parts of a SQL command plus a -- comment. In this case the following SQL
command will get concatenated to the first one and cause a crash in
statement.execute(sql);
A simple example:
{noformat}
INSERT INTO testTable (thevalue) VALUES ('value !'); -- comment at the end
INSERT INTO testTable (thevalue) VALUES ('value2');
{noformat}
But we cannot simply look if the command contains a ';' because that may also
appear inside the comment
And the other way round: the '--' may be contained in a value of the SQL
statement (which currently also causes a crash:
{noformat}
INSERT INTO testTable (thevalue) VALUES ('value containing a -- which is not a
comment!');
INSERT INTO testTable (thevalue) VALUES ('value2');
{noformat}
> Syntax error if "--" is in escaped strings in sourced sql files
> ---------------------------------------------------------------
>
> Key: MSQL-47
> URL: http://jira.codehaus.org/browse/MSQL-47
> Project: Maven 2.x SQL Plugin
> Issue Type: Bug
> Environment: linux, maven 2.2.1, mysql 5.1.37, java 1.6.0_17
> Reporter: Ronald Steininger
> Assignee: Mark Struberg
> Priority: Minor
> Attachments: sql-maven-plugin-test.tgz
>
>
> see attached maven project.
> I get an syntax error if testcase.sql gets sourced via sql-maven-plugin. Said
> sql script works if sourced via mysql <testcase.sql
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email