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 order of enum values on MySQL 8 #3150

Merged
merged 2 commits into from
Aug 31, 2022
Merged

fix order of enum values on MySQL 8 #3150

merged 2 commits into from
Aug 31, 2022

Conversation

Tantalon
Copy link
Contributor

@Tantalon Tantalon commented Aug 5, 2022

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Fixes #3147.

On MySQL 5.7.12 enums values are retrieved in the correct order.
On MySQL 8.0.28 enums values are retrieved in this order: 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 20, 19, 18, 17...

This fix adds an order by so enums are explicitly retrieved in the correct order.

@nvoxland nvoxland added the SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions label Aug 30, 2022
@github-actions
Copy link

Unit Test Results

  4 620 files  ±0    4 620 suites  ±0   37m 44s ⏱️ +17s
  4 617 tests ±0    4 398 ✔️ ±0     219 💤 ±0  0 ±0 
54 576 runs  ±0  49 552 ✔️ ±0  5 024 💤 ±0  0 ±0 

Results for commit e49d0c2. ± Comparison against base commit e742a88.

Copy link
Contributor

@nvoxland nvoxland left a comment

Choose a reason for hiding this comment

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

Code review and test results:

Things to be aware of:

  • Code change makes sense
  • There is not a great way currently to explicit test for enum ordering automatically, but existing tests would fail if the SQL is invalid

Things to worry about:

  • Nothing

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.

  • PR enforces chronological order of enums during column snapshot generation by including an ORDER BY clause to the generated SQL.
    • Fix addresses an issue specific to MySQL 8.
  • No additional testing required.

APPROVED

@nvoxland nvoxland merged commit 0cf9b87 into liquibase:master Aug 31, 2022
Conditioning++ automation moved this from To Do to Done Aug 31, 2022
@kataggart kataggart removed this from Done in Conditioning++ Aug 31, 2022
@kataggart kataggart added this to the NEXT milestone Aug 31, 2022
@Tantalon Tantalon deleted the patch-1 branch August 31, 2022 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autocandidate complexityLocal criticalityBlocker DBMySQL SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions Severity3 sprint2022-32 TypeBug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

ENUMs on MySQL 8 are returned in the wrong order
5 participants