[ 
http://jira.codehaus.org/browse/MSQL-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=230016#action_230016
 ] 

Robert Scholte commented on MSQL-59:
------------------------------------

The query contains some special types of single quotes. Is this coincidence or 
is this really the content of the sql-file? AFAIK these are illegal characters 
for referring to tables.

> 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


Reply via email to