[
http://jira.codehaus.org/browse/MSQL-59?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=230813#action_230813
]
Laurent Prévost commented on MSQL-59:
-------------------------------------
I am sorry, but I wrongly done the patch on your integration test MSQL-59. I
did the test again from scratch and checked the files carrefully. At this step,
I am sure that the temp file is the same as the file contained in
/src/main/sql/update.sql. Previously, this file contained the pom.xml data. I
am sorry for the trouble I occured.
Now, the content of the file seems to be correct but the test fail again. with
this log:
[DEBUG] copy
/Users/user/Desktop/sql-maven-plugin/target/it/msql-59/src/main/sql/update.sql
to /var/folders/7o/7ofiJPKHFk832PaysV69ME+++TI/-Tmp-/update.1672718519sql
[DEBUG] connecting to
jdbc:derby:/Users/user/Desktop/sql-maven-plugin/target/it/msql-59/target/testdb;create=true
[DEBUG] Committing transaction
[INFO] Executing file:
/var/folders/7o/7ofiJPKHFk832PaysV69ME+++TI/-Tmp-/update.1672718519sql
[DEBUG] SQL: 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' [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'
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Lexical error at line 2, column 2. Encountered: "`" (96), after : "".
[INFO] ------------------------------------------------------------------------
[DEBUG] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Lexical
error at line 2, column 2. Encountered: "`" (96), after : "". at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
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: Lexical error at line 2, column
2. Encountered: "`" (96), after : "". 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: java.sql.SQLSyntaxErrorException: Lexical error at line
2, column 2. Encountered: "`" (96), after : "". at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
Source) at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown
Source) at
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown
Source) at
org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown
Source) at org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown
Source) at org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown
Source) at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) at
org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source) 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
Caused by: java.sql.SQLException: Lexical error at line 2, column 2.
Encountered: "`" (96), after : "". at
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown Source)
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossDRDA(Unknown
Source) ... 33 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 39 seconds
[INFO] Finished at: Wed Aug 04 09:27:36 CEST 2010
[INFO] Final Memory: 13M/81M
[INFO] ------------------------------------------------------------------------
We can see that the ` is not allowed. I do not know if it is a derby limitation
or the sql-maven-plugin. Without the `, the output says that the database does
not exist. Now the problem seems to be unknown database items. I never worked
with derby database so I cannot easily do other tests now.
> 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: build.log, 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