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

SQLite regression bug after Liquibase 4.8.0 release. Generated sql syntax errors for addAutoIncrement, addDefaultValue, dropColumn, mergeColumns #2644

Closed
AlexanderSashchenko opened this issue Mar 16, 2022 · 6 comments

Comments

@AlexanderSashchenko
Copy link
Contributor

AlexanderSashchenko commented Mar 16, 2022

Environment

Liquibase Version: 4.8.0

Liquibase Integration & Version: CLI, test-harness(Command Framework)

Liquibase Extension(s) & Version: na

Database Vendor & Version: sqlite 3.34.0

Operating System Type & Version: windows 10

Description

After the release of Liquibase 4.8.0 a bug was found. This bug doesn't get reproduced on previous versions. The bug is reproduced in case you try to use Liquibase 'update' command against SQLite database (version 3.34.0 in my case) for the change types:
_- addAutoIncrement;

  • addDefaultValue (also applicable for attributes defaultValueBoolean, defaultValueDate, defaultValueNumeric in case you use it);
  • dropColumn
  • mergeColumns_
    The bug is about generating wrong SQL queries for named above change types. For addAutoIncrement, addDefaultValue and dropColumn Liquibase generates "CREATE TABLE table_name ()" query. For mergeColumns it generates "UPDATE full_name_table SET full_name = first_name || ' ' || last_name". Examples of used changelogs and full exception logs are attached.

Steps To Reproduce

Run Liquibase 'update' command on version 4.8.0 against SQLite database for named above change types.

Actual Behavior

SQL exceptions described in description section get thrown. Detailed logs are attached (.xml files are saved as .txt files).

Expected/Desired Behavior

Successful deployment of named change types
dropColumn full exception log.txt
dropColumn.txt
addDefaultValue full exception log.txt
addDefaultValue.txt
mergeColumns full exception log.txt
mergeColumns.txt
addAutoIncrement full exception log.txt
addAutoIncrement.txt

@kataggart
Copy link
Contributor

@AlexanderSashchenko thanks for all the detail here; we will definitely take a look

@bamthomas
Copy link

bamthomas commented Apr 29, 2022

Any news on this issue ?
(we are having the same problem, and dependabot asks us to use the 4.8.0)
Thanks

AlexanderSashchenko added a commit to liquibase/liquibase-test-harness that referenced this issue May 16, 2022
KushnirykOleh pushed a commit to liquibase/liquibase-test-harness that referenced this issue May 16, 2022
KushnirykOleh pushed a commit to liquibase/liquibase-test-harness that referenced this issue May 16, 2022
Better standardization of data checks on h2

Better standardization of data checks on h2

Updated setPrimaryKeyColumnRemarks.sql to match updated SQL

[DAT-9954] Created tests for EDB with EDB driver (#209)

* [DAT-9954] Created tests for EDB with EDB driver

* [DAT-9954] Config file fix

* [DAT-9954] Made requested fixes

* [DAT-9954]Made distinguishing EDB with PostgreSQL and EDB drivers more clear

* [DAT-9954]Made changes for github actions to run tests against both EDB with Postgres and EDB drivers

* [DAT-9954]Fixed automation-runner

* [DAT-9954]Fixed create-infra.sh and teardown-infra.sh

* [DAT-9954]Fixed create-infra.sh and teardown-infra.sh

* [DAT-9954]Fixed changeData tests

* fixed setPrimaryKeyColumnRemarks

Co-authored-by: KushnirykOleh <kushnirykoleh@gmail.com>

Added platform to mysql docker instances for compatability with Mac M1 machines

Revert "Added platform to mysql docker instances for compatability with Mac M1 machines"

This reverts commit 1414399.

Add platforms to ensure compatability with Mac M1 machines

paginate through results of workflow runs on client side

only paginate through a maximum of 10 pages

add missing values to returnData in workflow-helper.js (#215)

Updated jdbc driver versions to match new liquibase versions

Updated jaybird driver to 4.0.6

Updated build logic to rely on liquibase-sdk-maven-plugin (#225)

* Updated build logic to use liquibase-sdk-maven-plugin more heavily

Fall back to master build if branch is being computed

Corectly configure 0-SNAPSHOT liquibase in tests

Run 0-SNAPSHOT liquibase in tests in

Giving cockroachdb a bit more time to start

Log cockroach startup

Fixing build logic

removed comments from ignored tests

unignored sqlite for develop branch

reverted changes in CICD files
KushnirykOleh pushed a commit to liquibase/liquibase-test-harness that referenced this issue May 20, 2022
jnewton03 pushed a commit to liquibase/liquibase-test-harness that referenced this issue Jun 2, 2022
@nvoxland nvoxland assigned MalloD12 and unassigned nvoxland Sep 8, 2022
@MalloD12
Copy link
Contributor

MalloD12 commented Sep 12, 2022

I was not able to reproduce this issue on below environment:

Liquibase Version: 4.15.0

Liquibase Integration & Version: CLI

Liquibase Extension(s) & Version: N/A

Database Vendor & Version: Sqlite 3.36.0 

Operating System Type & Version: Mac OS (M1)

I tried using examples (changelogs) provided here and all of them have been executed successfully.

Closing this issue by now. @AlexanderSashchenko could you please try again on a recent version and please let me know if you are still able to reproduce it?

Thanks,
Daniel.

Conditioning++ automation moved this from To Do to Done Sep 12, 2022
@MalloD12 MalloD12 removed their assignment Sep 12, 2022
@Jerbell
Copy link

Jerbell commented Sep 13, 2022

Closing this issue by now. @Jerbell could you please try again on a recent version and please let me know if you are still able to reproduce it?

Hi @MalloD12
I don't see an issue that I reported related to this one, so I'm not sure what to test. I also don't use Mac OS.

@MalloD12
Copy link
Contributor

Closing this issue by now. @Jerbell could you please try again on a recent version and please let me know if you are still able to reproduce it?

Hi @MalloD12 I don't see an issue that I reported related to this one, so I'm not sure what to test. I also don't use Mac OS.

My apologies @Jerbell I did not mean to tag you on this one. Please ignore my comment.

@maloewe-ona
Copy link

For future reference, it looks like this bug might have been introduced by pull request #2398, and was fixed for 4.11.0 by pull request #2778.

I was investigating this some time ago, and if I remember it correctly, Liquibase is looking up the tables at some point during changelog execution, but due to the broken table name escaping it wasn't finding the tables and then in subsequent steps used an empty string as table name. But I might be misremembering this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

7 participants