Repository navigation
dialect(mysql): version checks and fixes, tested on MySQL in Docker - #98
Merged
Merged
Conversation
The dialect wrote SQL that MySQL refused or that lost data. Each case is now run against the server, on the versions around its boundary: - PERCENTILE_DISC/CONT: none on any version; MySQL has no such functions and refused WITHIN GROUP with a syntax error - regular expressions in SQL from 8.0, whose REGEXP is ICU's; 5.7's Henry Spencer REGEXP refused (?-i), \A and \z, and the expression is matched in Java there - upsert without update columns: ON DUPLICATE KEY UPDATE key = key, insert-or-ignore as UpsertSpec says, not a plain INSERT that failed with "Duplicate entry" - upsert with update columns: the row alias from 8.0.19, INSERT ... AS new_row ... UPDATE col = new_row.col, instead of VALUES(col), which 8.0.20 deprecates with warning 1287; VALUES(col) before; a dialect without a version writes the alias - GROUP_CONCAT: the separator a string literal of its own, a quote or a backslash in it no longer ends it; NULLS FIRST/LAST, which MySQL has not, as an order of col IS NULL before the column; a list longer than group_concat_max_len is cut, as the Javadoc now says - triggers: WHEN, which MySQL has not, as an IF around the body; no FOR EACH STATEMENT, which MySQL has not either and a row trigger cannot stand in for: UnsupportedOperationException - RENAME INDEX from 5.7; before, renameIndex gives null - a column renamed before 8.0 with CHANGE keeps its AUTO_INCREMENT and its COMMENT; a generated column is not renamed Tested as they were: users from 5.7.8, roles from 8.0, recursive CTEs from 8.0, descending index columns from 8.0, the order by an alias from 5.7. The Docker tests are in the container package and run with -Dintegration.docker=true on MySQL 5.6, 5.7, 8.0, 8.4 and 9. Their server has a my.cnf of its own: Testcontainers' default sets Signed-off-by: <bulahovdenis@gmail.com>
dbulahov
force-pushed
the
main231126_3
branch
from
November 23, 2026 15:32
ed38f4c to
c89eb4d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
The dialect wrote SQL that MySQL refused or that lost data. Each case is now run against the server, on the versions around its boundary:
Tested as they were: users from 5.7.8, roles from 8.0, recursive CTEs from 8.0, descending index columns from 8.0, the order by an alias from 5.7.
The Docker tests are in the container package and run with -Dintegration.docker=true on MySQL 5.6, 5.7, 8.0, 8.4 and 9. Their server has a my.cnf of its own: Testcontainers' default sets