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

Fix BLOBs in loadData for MySQL/MariaDB #2595

Conversation

MichaelCkr
Copy link
Contributor

@MichaelCkr MichaelCkr commented Mar 3, 2022

Environment

Liquibase Version: 4.6.2, 4.8.0

Liquibase Integration & Version: maven

Liquibase Extension(s) & Version: -

Database Vendor & Version: MariaDB 10.3.27

Operating System Type & Version: linux

Pull Request Type

  • Bug fix (non-breaking change which fixes an issue.)
  • Enhancement/New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

closes #2519

Description

When we use loadData and there exists a BLOB column (preparedStatement necessary), then no data are populated in the DB at all. Even no exception is thrown, but in databasechangelog table the changeset is set as run.

Steps To Reproduce

see #2519

Actual Behavior

  • changeset with loadData is marked as successful in databasechangelog table
  • no data are populated in database
  • no exception or warning can be found in log

Expected/Desired Behavior

  • changeset with loadData is marked as successful in databasechangelog table
  • data are populated in database

Screenshots (if appropriate)

Additional Context

see #2519 and #2215

I'm not sure, if the intention of #2215, increasing the performance of MySql data loading, is still fulfilled with this change. The probably slow batch update is not used, but prepared statements are used.

Fast Track PR Acceptance Checklist:

Need Help?

Come chat with us on our discord channel

@kataggart
Copy link
Contributor

@MichaelCkr Thanks for your work here! We will review and move it through the process.

@kataggart kataggart added this to To Do in Conditioning++ via automation Mar 3, 2022
@nvoxland nvoxland added the SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions label Mar 8, 2022
@MichaelCkr MichaelCkr force-pushed the bugfix/#2519_fixed-loadDataChange-for-MySQL-regarding-preparedStatements branch from 8a398f5 to 2c0d201 Compare March 10, 2022 14:11
@MichaelCkr
Copy link
Contributor Author

I have no clue, why the java 17 integration test failed regarding my changes. I'm quite sure, this is not related, therefore I have done a rebase on the current master.

Rebuild would be nice.

@MichaelCkr
Copy link
Contributor Author

@nvoxland If possible, could you please set the SafeToBuild label again or sth similar to trigger another build?

…reparedStatements' of https://github.com/MichaelCkr/liquibase into 'MichaelCkr-bugfix/#2519_fixed-loadDataChange-for-MySQL-regarding-preparedStatements'
@nvoxland nvoxland changed the title #2519 fixed using preparedStatements on loadData for MySQL/MariaDB Fix BLOBs in loadData for MySQL/MariaDB Apr 20, 2022
@nvoxland nvoxland added SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions and removed SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions labels Apr 20, 2022
@github-actions
Copy link

github-actions bot commented Apr 20, 2022

Unit Test Results

  4 512 files  ±  0    4 512 suites  ±0   35m 11s ⏱️ - 1m 25s
  4 414 tests  - 92    4 200 ✔️  - 92     214 💤 ±0  0 ±0 
52 248 runs  ±  0  47 240 ✔️ ±  0  5 008 💤 ±0  0 ±0 

Results for commit e5736dd. ± Comparison against base commit a574d1e.

♻️ This comment has been updated with latest results.

@nvoxland nvoxland changed the base branch from master to 1_9 April 20, 2022 14:35
@nvoxland nvoxland changed the base branch from 1_9 to master April 20, 2022 14:36
@nvoxland nvoxland added SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions and removed SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions labels Apr 20, 2022
@nvoxland
Copy link
Contributor

Code review and test results:

It looks like the if statement this PR removes shouldn't have been there. It probably got left from a bad merge, and the performance issue it's trying to address is handled correctly already on line 521. Having the if statement there made it so we didn't load anything which is obviously wrong.

I created #liquibase/liquibase-test-harness#216 to test the change

Things to be aware of

  • Impacts mysql and mariadb

Things to worry about

  • Nothing

@MichaelCkr
Copy link
Contributor Author

Thank you very much for adding the test, I commented on your PR.

The failure in the "Run Test Harness" check seems not to be related to my change, is it?

@nvoxland
Copy link
Contributor

Correct, @MichaelCkr the failure in the test is not related to your PR. The automation that pulls the correct build of liquibase to test isn't correctly handling PRs from forks. I'm looking into that.

@MichaelCkr
Copy link
Contributor Author

Simple workaround would be, to merge my commit into another bugfix branch within the original liquibase repo (and open another PR from the newly created branch to master).

@XDelphiGrl
Copy link
Contributor

@nvoxland, there were MariaDB failures in the test-harness run. Can you take a look, please?

Test Harness Results

@nvoxland nvoxland added SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions and removed SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions labels May 9, 2022
@MichaelCkr
Copy link
Contributor Author

MichaelCkr commented May 11, 2022

Note for myself: Test Harness Results

(I'm quite curios, how these checks may run against my branch. :) )

…#2519_fixed-loadDataChange-for-MySQL-regarding-preparedStatements'
@nvoxland nvoxland added SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions and removed SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions labels May 16, 2022
@nvoxland nvoxland removed their assignment May 16, 2022
…nge-for-MySQL-regarding-preparedStatements'

# Conflicts:
#	liquibase-core/src/main/java/liquibase/change/core/LoadDataChange.java
@nvoxland
Copy link
Contributor

@MichaelCkr there is a build job in liquibase/liquibase-test-harness which can pull snapshot builds from liquibase PRs. We trigger that job as part of the PR build process

@nvoxland nvoxland added SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions and removed SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions labels May 17, 2022
Copy link
Contributor

@XDelphiGrl XDelphiGrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've requested changes in the associated liquibase-test-harness PR. When those are done, let me know and I can take a look and finalize my review for this PR.

CC @nvoxland , @MichaelCkr

Copy link
Contributor

@XDelphiGrl XDelphiGrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix removes an IF that applied only to MySQL and excluded MariaDB (and others).
  • Validating test cases added to test harness for MariaDB and MySQL.
    • The requested test harness PR changes are complete.
  • No additional testing required.

APPROVED

Passing Test Harness Execution
Passing Functional Tests

@nvoxland nvoxland merged commit f4561cb into liquibase:master May 25, 2022
Conditioning++ automation moved this from To Do to Done May 25, 2022
@nvoxland nvoxland added this to the NEXT milestone May 25, 2022
@MichaelCkr
Copy link
Contributor Author

Thanks for adding the Test Harness Tests, the review and the merge.

@MichaelCkr MichaelCkr deleted the bugfix/#2519_fixed-loadDataChange-for-MySQL-regarding-preparedStatements branch June 13, 2022 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autocandidate DBMariaDB IntegrationMaven OSLinux SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions TypeBug TypeIncorrectSQL ver4.6.2 ver4.8.0
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

LoadData - MariaDB - does not work with BLOB column type
5 participants