[ 
https://jira.codehaus.org/browse/MSQL-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=284948#comment-284948
 ] 

Dmitry Matyukhin edited comment on MSQL-33 at 12/5/11 1:35 PM:
---------------------------------------------------------------

Not sure what the fix was but having the same issue with 1.5.
Tried to set both <encoding> for the execution and 
<project.build.sourceEncoding> for the project to UTF-8.
Still get the error like 

[INFO] Executing file: C:\Users\MATYUK~1\AppData\Local\Temp\init.1014934885sql
[ERROR] Failed to execute:  ?DROP INDEX IF EXISTS idx_money_data_date


[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.486s
[INFO] Finished at: Mon Dec 05 14:33:21 EST 2011
[INFO] Final Memory: 9M/23M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sql-maven-plugin:1.5:execute 
(preparedb) on project money: Syntax error in SQL statement " ?DROP[*] INDEX IF 
EXISTS IDX_MONEY_DATA_DATE "; SQL statement:
[ERROR] ?DROP INDEX IF EXISTS idx_money_data_date [42000-161]

The plugin is configured like this:

     <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>sql-maven-plugin</artifactId>
        <version>1.5</version>

        <dependencies>
          <!-- specify the dependent JDBC driver here -->
                        <dependency>
                            <groupId>com.h2database</groupId>
                            <artifactId>h2</artifactId>
                            <version>1.3.161</version>
                        </dependency>
        </dependencies>

        <!-- common configuration shared by all executions -->
        <configuration>
          <driver>org.h2.Driver</driver>
          <url>jdbc:h2:file:./db/moneydb</url>
          <username>sa</username>
          <password></password>
              <srcFiles>
                <srcFile>src/main/resources/init.sql</srcFile>
                <srcFile>src/main/resources/expense.sql</srcFile>
                <srcFile>src/main/resources/income.sql</srcFile>
              </srcFiles>
                        <encoding>UTF-8</encoding>
        </configuration>
        <executions>
                <execution>
                                        <id>preparedb</id>
                                        <phase>package</phase>
                                        <goals><goal>execute</goal></goals>
                                        <configuration>
                                                <encoding>UTF-8</encoding>
                                        </configuration>
                </execution>
        </executions>
        </plugin>

The H2 is UTF-8 by default, so it doesn't seem to be the driver's issue.


      was (Author: nskmda):
    Not sure what the fix was but having the same issue with 1.5.
Tried to set both <encoding> for the execution and 
<project.build.sourceEncoding> for the project to UTF-8.
Still get the error like 

[INFO] Executing file: C:\Users\MATYUK~1\AppData\Local\Temp\init.1014934885sql
[ERROR] Failed to execute:  ?DROP INDEX IF EXISTS idx_money_data_date


[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10.486s
[INFO] Finished at: Mon Dec 05 14:33:21 EST 2011
[INFO] Final Memory: 9M/23M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:sql-maven-plugin:1.5:execute 
(preparedb) on project money: Syntax error in SQL statement " ?DROP[*] INDEX IF 
EXISTS IDX_MONEY_DATA_DATE "; SQL statement:
[ERROR] ?DROP INDEX IF EXISTS idx_money_data_date [42000-161]

  
> UTF-8 Files with byte order mark are not handled correctly
> ----------------------------------------------------------
>
>                 Key: MSQL-33
>                 URL: https://jira.codehaus.org/browse/MSQL-33
>             Project: Maven 2.x SQL Plugin
>          Issue Type: Bug
>            Reporter: John Newman
>            Assignee: David J. M. Karlsen
>             Fix For: 1.1, 1.4
>
>         Attachments: MSQL-33.zip
>
>   Original Estimate: 0 minutes
>  Remaining Estimate: 0 minutes
>
> Hi,
> If a UTF-8 file does include the BOM, it will always fail with "Incorrect 
> syntax near ?" where ? is the first character of the file.  UTF-8 files 
> without the BOM work fine.
> Thanks

--
This message is automatically generated by JIRA.
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