[
http://jira.codehaus.org/browse/MSQL-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=230020#action_230020
]
Laurent Prévost commented on MSQL-59:
-------------------------------------
The file does not changed between the different tries (version 1.1, 1.2, 1.3
and 1.4). There are other update requests done correctly in the same file.
Examples:
UPDATE
`databaseToUpdate`.`tableToUpdate`
SET
`fieldOne` = 'valueOne',
`fieldTwo` = 'valueTwo'
WHERE
`ID` = 1;
There are three other similar request done correctly (I see the output with the
option printResultSet that the request before the one that causes the exception
are done properly).
For the quotes (` for field, table and database names, ' for strings), they
come from MySQL statements used through tools like phpMyAdmin.
So if the quotes are illegal characters, it seems to be an inconsistent
behavior between some request in the same files. We use these quotes in all our
requests (we have more than one sql file with a lot of SQL statements).
In addition, I just did a test without the special quotes and it does not work.
It produces the same exception.
It seems that I previously forget to provide some usefull data about the
database product and version:
database name=MySQL
database version=5.1.48-log
database major version=5
database minor version=1
jdbc driver name=MySQL-AB JDBC Driver
jdbc driver version=mysql-connector-java-5.1.13 ( Revision:
${bzr.revision-id} )
jdbc driver major version=5
jdbc driver minor version=1
I also tried different MySQL connectors (5.1.10 to 5.1.13) without success.
> Update statement failed
> -----------------------
>
> Key: MSQL-59
> URL: http://jira.codehaus.org/browse/MSQL-59
> Project: Maven 2.x SQL Plugin
> Issue Type: Bug
> Affects Versions: 1.4
> Environment: Mac OS X 10.6.3
> Maven 2.2.1
> Java 1.6.x
> Reporter: Laurent Prévost
>
> Actually, I tried to use the version 1.4 of the sql-maven-plugin with this
> configuration:
> <plugin>
> <groupId>org.codehaus.mojo</groupId>
> <artifactId>sql-maven-plugin</artifactId>
> <version>1.4</version>
> <configuration>
> <driver>com.mysql.jdbc.Driver</driver>
> <url>jdbc:mysql://localhost:3306</url>
> <username>userWeUsed</username>
> <password>passwordWeUsed</password>
> <autocommit>true</autocommit>
> <srcFiles>
> <srcFile>target/classes/update.sql</srcFile>
> </srcFiles>
> </configuration>
> <dependencies>
> <dependency>
> <groupId>mysql</groupId>
> <artifactId>mysql-connector-java</artifactId>
> <version>5.1.13</version>
> </dependency>
> </dependencies>
> </plugin>
> The request is the following one:
> UPDATE
> `databaseToUpdate`.`tableToUpdate`
> SET
> `XMLCONFIGURATION` = '<?xml version="1.0" encoding="UTF-8"
> standalone="yes"?>
> <xmlConfiguration>
> <params>
> <entry>
> <key>keyOne</key>
> <value>valueOne</value>
> </entry>
> <entry>
> <key>keyTwo</key>
> <value>valueTwo</value>
> </entry>
> <entry>
> <key>keyThree</key>
> <value>valueThree</value>
> </entry>
> </params>
> </xmlConfiguration>'
> WHERE
> `NAMESPACE` = 'system';
> With version 1.1 or 1.3 of the sql-maven-plugin, the request goes well. With
> the version 1.4, the result is the following:
> ------------------------------------------------------------------------
> [ERROR]BUILD ERROR
> ------------------------------------------------------------------------
> You have an error in your SQL syntax; check the manual that corresponds to
> your MySQL server version for the right syntax to use near ''<?xml
> version="1.0" encoding="UTF-8" standalone="yes"?>
> <xmlConfiguration>
> <p' at line 4
> ------------------------------------------------------------------------
> Trace
> org.apache.maven.lifecycle.LifecycleExecutionException: You have an error in
> your SQL syntax; check the manual that corresponds to your MySQL server
> version for the right syntax to use near ''<?xml version="1.0"
> encoding="UTF-8" standalone="yes"?>
> <xmlConfiguration>
> <p' at line 4
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
> at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
> at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
> at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
> at
> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.maven.plugin.MojoExecutionException: You have an error
> in your SQL syntax; check the manual that corresponds to your MySQL server
> version for the right syntax to use near ''<?xml version="1.0"
> encoding="UTF-8" standalone="yes"?>
> <xmlConfiguration>
> <p' at line 4
> at org.codehaus.mojo.sql.SqlExecMojo.execute(SqlExecMojo.java:646)
> at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
> at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
> ... 17 more
> Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You
> have an error in your SQL syntax; check the manual that corresponds to your
> MySQL server version for the right syntax to use near ''<?xml version="1.0"
> encoding="UTF-8" standalone="yes"?>
> <xmlConfiguration>
> <p' at line 4
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
> at com.mysql.jdbc.Util.getInstance(Util.java:384)
> at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3566)
> at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3498)
> at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1959)
> at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2113)
> at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2562)
> at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2512)
> at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:781)
> at com.mysql.jdbc.StatementImpl.execute(StatementImpl.java:624)
> at org.codehaus.mojo.sql.SqlExecMojo.execSQL(SqlExecMojo.java:1011)
> at
> org.codehaus.mojo.sql.SqlExecMojo.runStatements(SqlExecMojo.java:975)
> at org.codehaus.mojo.sql.SqlExecMojo.access$200(SqlExecMojo.java:66)
> at
> org.codehaus.mojo.sql.SqlExecMojo$Transaction.runTransaction(SqlExecMojo.java:1207)
> at
> org.codehaus.mojo.sql.SqlExecMojo$Transaction.access$100(SqlExecMojo.java:1154)
> at org.codehaus.mojo.sql.SqlExecMojo.execute(SqlExecMojo.java:612)
> ... 19 more
> I tried to use some configuration values of the plugin without success.
--
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