DML Transactions Not Honored in Liquibase #142015
Labels
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
T-sql-foundations
SQL Foundations Team (formerly SQL Schema + SQL Sessions)
Describe the problem
Please describe the issue you observed, and any steps we can take to reproduce it:
Liquibase is a schema migration tool that tracks schema changes through an XML based change log, which contains a series of change sets. The contract with a change set is that all statements will execute autonomously and this works as expected with other DBMS systems. However, cockroachdb appears to commit each statement independently and a failure in the change set will leave the database in an unpredictable state.
To Reproduce
What did you do? Describe in your own words.
I created a simple example that inserts two records as individual statements of the same change set. The first insert succeeds but the second insert is setup to fail. After running the change log I would expect the first record to have been rolled back but it looks like it was committed as part of the migration.
If possible, provide steps to reproduce the behavior:
I've created a sample demo of the issue at https://github.com/roachlong/liquibase-demo with instruction on how to setup and execute the change log test documented in the README file.
Expected behavior
A clear and concise description of what you expected to happen.
I expect that the inserted record would have been rolled back and the event table to be empty at the end of the test.
Additional data / screenshots
If the problem is SQL-related, include a copy of the SQL query and the schema
of the supporting tables.
All information is included in the https://github.com/roachlong/liquibase-demo repo.
If a node in your cluster encountered a fatal error, supply the contents of the
log directories (at minimum of the affected node(s), but preferably all nodes).
Note that log files can contain confidential information. Please continue
creating this issue, but contact support@cockroachlabs.com to submit the log
files in private.
If applicable, add screenshots to help explain your problem.
Environment:
cockroach sql
, JDBC, ...]: JDBC org.postgresql.Driver 42.7.4Additional context
What was the impact?
Add any other context about the problem here.
Jira issue: CRDB-48120
The text was updated successfully, but these errors were encountered: