Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The diff command does not work with diffTypes=views for DB2Z #2710

Closed
michaelmatthiaskern opened this issue Apr 3, 2022 · 0 comments · Fixed by #2712
Closed

The diff command does not work with diffTypes=views for DB2Z #2710

michaelmatthiaskern opened this issue Apr 3, 2022 · 0 comments · Fixed by #2712

Comments

@michaelmatthiaskern
Copy link
Contributor

Environment

Liquibase Version: 4.8.0

Liquibase Integration & Version: CLI

Liquibase Extension(s) & Version: -

Database Vendor & Version: DB2Z 12

Operating System Type & Version: Windows 10 Pro

Description

The diff command does not work with diffTypes=views for DB2Z, DB2LUW is not affected.

The error occurs when comparing the views of the ENTW Schema with another schema.

The obviously happens because we use multiple schemas that have similar names (ENTW, ENTW10, ENTW20, ...) and views with the same names exist in all of the schemas.

Steps To Reproduce

Start the diff command.

Actual Behavior

Liquibase aborts with the stacktrace below.

Expected/Desired Behavior

Liquibase should work correctly.

Additional Context

Stacktrace:

`Unexpected error running Liquibase: Expected single row from liquibase.statement.core.GetViewDefinitionStatement@7a0e1b5e but got 7

liquibase.exception.CommandExecutionException: liquibase.exception.LiquibaseException: Unerwarteter Fehler bei der Ausführung von Liquibase: liquibase.exception.DatabaseException: Error getting jdbc:db2://10.1.110.100:50080/DB2EHA view with liquibase.statement.core.GetViewDefinitionStatement@702ed190
at liquibase.command.CommandScope.execute(CommandScope.java:163)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:51)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:1)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2078)
at liquibase.integration.commandline.LiquibaseCommandLine.lambda$1(LiquibaseCommandLine.java:325)
at liquibase.Scope.child(Scope.java:189)
at liquibase.Scope.child(Scope.java:165)
at liquibase.integration.commandline.LiquibaseCommandLine.execute(LiquibaseCommandLine.java:291)
at liquibase.integration.commandline.LiquibaseCommandLine.main(LiquibaseCommandLine.java:80)
Caused by: liquibase.exception.LiquibaseException: Unerwarteter Fehler bei der Ausführung von Liquibase: liquibase.exception.DatabaseException: Error getting jdbc:db2://10.1.110.100:50080/DB2EHA view with liquibase.statement.core.GetViewDefinitionStatement@702ed190
at liquibase.integration.commandline.Main$1.run(Main.java:443)
at liquibase.integration.commandline.Main$1.run(Main.java:1)
at liquibase.Scope.child(Scope.java:189)
at liquibase.Scope.child(Scope.java:165)
at liquibase.integration.commandline.Main.run(Main.java:221)
at liquibase.command.AbstractCliWrapperCommandStep.run(AbstractCliWrapperCommandStep.java:32)
at liquibase.command.CommandScope.execute(CommandScope.java:157)
... 14 more
Caused by: liquibase.exception.LiquibaseException: liquibase.exception.CommandExecutionException: liquibase.exception.DatabaseException: Error getting jdbc:db2://10.1.110.100:50080/DB2EHA view with liquibase.statement.core.GetViewDefinitionStatement@702ed190
at liquibase.integration.commandline.CommandLineUtils.doDiff(CommandLineUtils.java:183)
at liquibase.integration.commandline.Main.doMigration(Main.java:1594)
at liquibase.integration.commandline.Main$1.lambda$0(Main.java:398)
at liquibase.Scope.lambda$0(Scope.java:180)
at liquibase.Scope.child(Scope.java:189)
at liquibase.Scope.child(Scope.java:179)
at liquibase.Scope.child(Scope.java:158)
at liquibase.integration.commandline.Main$1.run(Main.java:397)
... 20 more
Caused by: liquibase.exception.CommandExecutionException: liquibase.exception.DatabaseException: Error getting jdbc:db2://10.1.110.100:50080/DB2EHA view with liquibase.statement.core.GetViewDefinitionStatement@702ed190
at liquibase.command.CommandScope.execute(CommandScope.java:163)
at liquibase.integration.commandline.CommandLineUtils.doDiff(CommandLineUtils.java:181)
... 27 more
Caused by: liquibase.exception.DatabaseException: Error getting jdbc:db2://10.1.110.100:50080/DB2EHA view with liquibase.statement.core.GetViewDefinitionStatement@702ed190
at liquibase.snapshot.jvm.ViewSnapshotGenerator.snapshotObject(ViewSnapshotGenerator.java:129)
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.DatabaseSnapshot.include(DatabaseSnapshot.java:312)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:445)
at liquibase.snapshot.DatabaseSnapshot.replaceObject(DatabaseSnapshot.java:467)
at liquibase.snapshot.DatabaseSnapshot.includeNestedObjects(DatabaseSnapshot.java:373)
at liquibase.snapshot.DatabaseSnapshot.include(DatabaseSnapshot.java:335)
at liquibase.snapshot.DatabaseSnapshot.init(DatabaseSnapshot.java:105)
at liquibase.snapshot.DatabaseSnapshot.(DatabaseSnapshot.java:58)
at liquibase.snapshot.JdbcDatabaseSnapshot.(JdbcDatabaseSnapshot.java:34)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:215)
at liquibase.snapshot.SnapshotGeneratorFactory.createSnapshot(SnapshotGeneratorFactory.java:188)
at liquibase.command.core.InternalDiffCommandStep.createTargetSnapshot(InternalDiffCommandStep.java:145)
at liquibase.command.core.InternalDiffCommandStep.createDiffResult(InternalDiffCommandStep.java:99)
at liquibase.command.core.InternalDiffCommandStep.run(InternalDiffCommandStep.java:82)
at liquibase.command.CommandScope.execute(CommandScope.java:157)
... 28 more
Caused by: liquibase.exception.DatabaseException: Expected single row from liquibase.statement.core.GetViewDefinitionStatement@7a0e1b5e but got 7
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:192)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:203)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:198)
at liquibase.database.core.AbstractDb2Database.getViewDefinition(AbstractDb2Database.java:150)
at liquibase.snapshot.jvm.ViewSnapshotGenerator.snapshotObject(ViewSnapshotGenerator.java:81)
... 48 more
Caused by: liquibase.exception.DatabaseException: Result set larger than one row
at liquibase.util.JdbcUtil.requiredSingleResult(JdbcUtil.java:135)
at liquibase.executor.jvm.JdbcExecutor.queryForObject(JdbcExecutor.java:190)
... 52 more`

@kataggart kataggart linked a pull request Apr 4, 2022 that will close this issue
8 tasks
@kataggart kataggart added this to To Do in Conditioning++ via automation Apr 4, 2022
@kataggart kataggart added the views label Jun 7, 2022
@ecarneiro01 ecarneiro01 self-assigned this Jun 28, 2022
Conditioning++ automation moved this from To Do to Done Jul 28, 2022
@kataggart kataggart modified the milestone: NEXT Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants