Liquibase generateChangeLog выдает исключение: SQLServerException: не удается разрешить конфликт сортировки между ... в операции INTERSECT - PullRequest
0 голосов
/ 01 марта 2020

Я следую руководству Liquibase по добавлению 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

1 Ответ

1 голос
/ 01 марта 2020

Я решил проблему, загрузив последнюю версию драйвера SQL -сервера, а именно версию 8.2. Оказалось, что я использовал (крайне) устаревший драйвер, который содержал ошибку, описанную здесь . Ошибка связана с методом getSchemas драйвера, который Liquibase вызывает во время команды generateChangeLog, как видно из трассировки стека.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...