[
http://jira.codehaus.org/browse/MSQL-59?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Scholte updated MSQL-59:
-------------------------------
Attachment: MSQL-59-IT.patch
Laurent,
I've written an integration-test for your case (see attachment). We're using
Derby instead of MySQL because of it embedded JDBC driver. What's more
interesting is the output of the sql-m-p. Here the sql-statement is complete.
{code:sql}
[ERROR] Failed to execute: 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'
{code}
So I would expect there's a difference between the two sql files. It would be
great if you could could check out the current code and apply my patch. Next
execute 'mvn verify' to see the results.
btw, here my {{mvn -v}}
{noformat}Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0_12
Java home: C:\Java\jdk1.6.0_12\jre
Default locale: nl_NL, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"{noformat}
> 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
> Attachments: MSQL-59-IT.patch
>
>
> 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