Liquibase generateChangeLog 抛出异常:SQLServerException:无法解决 INTERSECT 操作中...之间的排序规则冲突
Liquibase generateChangeLog throws exception: SQLServerException: Cannot resolve the collation conflict between ... in the INTERSECT operation
我正在关注 adding Liquibase on an Existing project 上的 Liquibase 教程。当我 运行:
liquibase --changeLogFile=dbchangelog.xml --logLevel=info generateChangeLog
命令以错误结束(请参阅下面的完整堆栈跟踪):
SQLServerException: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Hebrew_BIN" in the INTERSECT operation.
我错过了什么?我使用的是最新的 Liquibase 版本 (3.8.7)。
完整堆栈跟踪:
16:13:50.205 ERROR [liquibase.integration.commandline.Main]: Unexpected error running Liquibase: liquibase.exception.DatabaseException: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Hebrew_BIN" in the INTERSECT operation.
liquibase.exception.LiquibaseException: liquibase.command.CommandExecutionException: liquibase.exception.DatabaseException: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Hebrew_BIN" in the INTERSECT operation.
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:289)
at liquibase.integration.commandline.Main.doMigration(Main.java:1412)
at liquibase.integration.commandline.Main.run(Main.java:303)
at liquibase.integration.commandline.Main.main(Main.java:163)
Caused by: liquibase.command.CommandExecutionException: liquibase.exception.DatabaseException: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Hebrew_BIN" in the INTERSECT operation.
at liquibase.command.AbstractCommand.execute(AbstractCommand.java:24)
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:287)
... 3 common frames omitted
Caused by: liquibase.exception.DatabaseException: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Hebrew_BIN" in the INTERSECT operation.
at liquibase.snapshot.jvm.SchemaSnapshotGenerator.snapshotObject(SchemaSnapshotGenerator.java:97)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:66)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:69)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:69)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:69)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:316)
at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:107)
at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:60)
at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:39)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:217)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:190)
at liquibase.command.core.DiffCommand.createReferenceSnapshot(DiffCommand.java:229)
at liquibase.command.core.DiffCommand.createDiffResult(DiffCommand.java:151)
at liquibase.command.core.GenerateChangeLogCommand.run(GenerateChangeLogCommand.java:60)
at liquibase.command.AbstractCommand.execute(AbstractCommand.java:19)
... 4 common frames omitted
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Hebrew_BIN" in the INTERSECT operation.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:197)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1493)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:775)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:676)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:179)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:154)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQueryInternal(SQLServerStatement.java:619)
at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getResultSetFromInternalQueries(SQLServerDatabaseMetaData.java:224)
at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getSchemasInternal(SQLServerDatabaseMetaData.java:1292)
at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getSchemas(SQLServerDatabaseMetaData.java:1227)
at liquibase.snapshot.jvm.SchemaSnapshotGenerator.getDatabaseSchemaNames(SchemaSnapshotGenerator.java:130)
at liquibase.snapshot.jvm.SchemaSnapshotGenerator.snapshotObject(SchemaSnapshotGenerator.java:63)
... 22 common frames omitted
我通过下载最新的 SQL 服务器驱动程序解决了这个问题,特别是 8.2 版。原来我使用的是一个(极其)过时的驱动程序,其中包含 here 描述的错误。该错误与 Liquibase 在 generateChangeLog
命令期间调用的驱动程序的 getSchemas
方法有关,如堆栈跟踪中所示。
我正在关注 adding Liquibase on an Existing project 上的 Liquibase 教程。当我 运行:
liquibase --changeLogFile=dbchangelog.xml --logLevel=info generateChangeLog
命令以错误结束(请参阅下面的完整堆栈跟踪):
SQLServerException: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Hebrew_BIN" in the INTERSECT operation.
我错过了什么?我使用的是最新的 Liquibase 版本 (3.8.7)。
完整堆栈跟踪:
16:13:50.205 ERROR [liquibase.integration.commandline.Main]: Unexpected error running Liquibase: liquibase.exception.DatabaseException: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Hebrew_BIN" in the INTERSECT operation.
liquibase.exception.LiquibaseException: liquibase.command.CommandExecutionException: liquibase.exception.DatabaseException: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Hebrew_BIN" in the INTERSECT operation.
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:289)
at liquibase.integration.commandline.Main.doMigration(Main.java:1412)
at liquibase.integration.commandline.Main.run(Main.java:303)
at liquibase.integration.commandline.Main.main(Main.java:163)
Caused by: liquibase.command.CommandExecutionException: liquibase.exception.DatabaseException: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Hebrew_BIN" in the INTERSECT operation.
at liquibase.command.AbstractCommand.execute(AbstractCommand.java:24)
at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:287)
... 3 common frames omitted
Caused by: liquibase.exception.DatabaseException: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Hebrew_BIN" in the INTERSECT operation.
at liquibase.snapshot.jvm.SchemaSnapshotGenerator.snapshotObject(SchemaSnapshotGenerator.java:97)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:66)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:69)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:69)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:69)
at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:316)
at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:107)
at liquibase.snapshot.DatabaseSnapshot.<init>(DatabaseSnapshot.java:60)
at liquibase.snapshot.JdbcDatabaseSnapshot.<init>(JdbcDatabaseSnapshot.java:39)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:217)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:190)
at liquibase.command.core.DiffCommand.createReferenceSnapshot(DiffCommand.java:229)
at liquibase.command.core.DiffCommand.createDiffResult(DiffCommand.java:151)
at liquibase.command.core.GenerateChangeLogCommand.run(GenerateChangeLogCommand.java:60)
at liquibase.command.AbstractCommand.execute(AbstractCommand.java:19)
... 4 common frames omitted
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Hebrew_BIN" in the INTERSECT operation.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:197)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1493)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteStatement(SQLServerStatement.java:775)
at com.microsoft.sqlserver.jdbc.SQLServerStatement$StmtExecCmd.doExecute(SQLServerStatement.java:676)
at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4575)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1400)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:179)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:154)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeQueryInternal(SQLServerStatement.java:619)
at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getResultSetFromInternalQueries(SQLServerDatabaseMetaData.java:224)
at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getSchemasInternal(SQLServerDatabaseMetaData.java:1292)
at com.microsoft.sqlserver.jdbc.SQLServerDatabaseMetaData.getSchemas(SQLServerDatabaseMetaData.java:1227)
at liquibase.snapshot.jvm.SchemaSnapshotGenerator.getDatabaseSchemaNames(SchemaSnapshotGenerator.java:130)
at liquibase.snapshot.jvm.SchemaSnapshotGenerator.snapshotObject(SchemaSnapshotGenerator.java:63)
... 22 common frames omitted
我通过下载最新的 SQL 服务器驱动程序解决了这个问题,特别是 8.2 版。原来我使用的是一个(极其)过时的驱动程序,其中包含 here 描述的错误。该错误与 Liquibase 在 generateChangeLog
命令期间调用的驱动程序的 getSchemas
方法有关,如堆栈跟踪中所示。