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
ColumnExistsPrecondition throws error when table is missing #5271
Comments
@MalloD12 Sure, I can submit a PR. |
…is missing - asd - Added integration test Fixes liquibase#5271
…is missing - asd - Added integration test Fixes liquibase#5271
…is missing - Handled DatabaseException thrown by PreparedStatement when the table is missing - Added integration test Fixes liquibase#5271
Hi @Januson and @MalloD12, I looked into this issue (as well as #5246 ) and I found that it's database-specific, and only the This is reproducible using H2 and HyperSQL databases It is not reproducible using:
Analysing the error logs, here's the output for PostgreSQL:
Note that it says "Preconditions Failed". Now, for H2:
In this case, it says "Precondition Error". And for HyperSQL:
Also outputs "Precondition Error". |
- Handled DatabaseException thrown by PreparedStatement when the table is missing - Added integration test Fixes #5271
…is missing - Handled DatabaseException thrown by PreparedStatement when the table is missing - Added integration test Fixes liquibase#5271
#5282) * Fix #5271: ColumnExistsPrecondition throws error when table is missing - Handled DatabaseException thrown by PreparedStatement when the table is missing - Added integration test Fixes #5271 * Column exists precondition checkfast clean up. * - Moved result set assignment inside try, in order to trigger its close method automatically. - Extract nested tries in separate methods to resolve existent code smells reported by sonar. --------- Co-authored-by: Daniel Mallorga <dmallorga@liquibase.com>
… 4.25.0 of liquibase. liquibase/liquibase#5271. Using liquibase 4.24.0.
… 4.25.0 of liquibase. liquibase/liquibase#5271. Using liquibase 4.24.0.
… 4.25.0 of liquibase. liquibase/liquibase#5271. Using liquibase 4.24.0.
Search first
Description
In Liquibase version
4.24.0
preconditioncolumnExists
evaluated as false when the target table was missing. In version4.25.0
the precondition throws PreconditionErrorException. Documentation of columnExists doesn't specify this behavior and 4.25.0 release notes do not mention any changes to it so I suppose it wasn't intentional.Steps To Reproduce
Run any changeset with a precondition
columnExists
targeting a table that does not exist.Reproducer: https://github.com/Januson/liquibase-error
Expected/Desired Behavior
Precondition should not fail and instead should evaluate as false.
Liquibase Version
4.25.0
Database Vendor & Version
HSQLDB
Liquibase Integration
No response
Liquibase Extensions
No response
OS and/or Infrastructure Type/Provider
No response
Additional Context
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: