Add 8.4 and 9.x reserved keywords to the upgrade check - #41
Open
y2kwak wants to merge 1 commit into
Open
Conversation
The reserved keywords check only knew about words reserved up to 8.0.31, and wasn't registered for any later version, so it missed newer keywords and didn't run at all for upgrades starting past 8.0.31 (e.g. 8.0 to 8.4). Add the words reserved since then -- QUALIFY and TABLESAMPLE (8.4.0), LIBRARY (9.2.0) and EXTERNAL (9.4.0) -- and register the check for those crossings. MANUAL and PARALLEL were reserved in 8.4.0 but nonreserved again in 8.4.11, so add_keywords gains an optional upper-bound version to report them only below 8.4.11. Adds unit tests for the generated keyword list (including the 8.4.11 boundary) and the new registry crossings. This contribution is under the OCA signed by Amazon and covering submissions to the MySQL project.
|
Hi, thank you for submitting this pull request. In order to consider your code we need you to sign the Oracle Contribution Agreement (OCA). Please review the details and follow the instructions at https://oca.opensource.oracle.com/ |
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.
Description
The upgrade checker's reserved-keywords check reports database objects whose names collide with words that become reserved in the target server version (get_reserved_keywords_check in modules/util/upgrade_checker/upgrade_check_creators.cc). It builds an IN (...) list of keywords via an add_keywords(version, words) helper that includes a set of words only when the upgrade crosses that version, and the check is registered against the same crossing versions (register_reserved in modules/util/upgrade_checker/upgrade_check_registry.cc).
Both the keyword list and the registration stopped at 8.0.31. This caused two problems for upgrades to 8.4 and the 9.x series:
As a result, the objects upgrade fine, but referencing their names unquoted afterward fails on the target (the word is now reserved), and util.checkForServerUpgrade() flagged nothing - so there was no prompt to add backticks or rename before upgrading.
Fix
Add the words reserved since 8.0.31 and register the check for their crossings:
To express the MANUAL/PARALLEL window, add_keywords gains an optional upper-bound version; those words are contributed only for targets below 8.4.11. register_reserved is extended with 8.4.0, 9.2.0 and 9.4.0 so the check is scheduled for those upgrade paths (including 8.0 → 8.4, which previously skipped it). Words that were already reserved on the source server are not re-reported.
Release Notes
Fixed an upgrade-checker issue where objects (schemas, tables, columns, routines, views, triggers, events) whose names match keywords that became reserved in MySQL 8.4 or 9.x — QUALIFY, TABLESAMPLE, LIBRARY, EXTERNAL — were not reported during util.checkForServerUpgrade(). For upgrades from a source newer than 8.0.31 (for example 8.0 to 8.4), the reserved-keywords check was not run at all; it now runs and reports such names so they can be quoted before the upgrade.
Testing
New/updated cases:
unittest/modules/util/upgrade_checker/upgrade_check_creators_t.cc- asserts the generated keyword list per source/target pair: 8.0→8.4.8 includes QUALIFY/TABLESAMPLE/MANUAL/PARALLEL; 8.0→8.4.11 drops MANUAL/PARALLEL (the un-reserved boundary) while keeping QUALIFY/TABLESAMPLE; 8.4.0→9.2.0 adds only LIBRARY; 8.4.0→9.4.0 adds LIBRARY and EXTERNAL; 9.2.0→9.4.0 adds only EXTERNAL (source already reserves LIBRARY).unittest/modules/util/upgrade_checker/upgrade_check_registry_t.cc- extended to assert the check is available for the 8.4.0, 9.2.0 and 9.4.0 crossings and unavailable for ranges that cross none (e.g. 8.4.0→8.4.11), correcting the prior assertion that treated 8.0.31→ as unavailable.Copyright
This contribution is under the OCA signed by Amazon and covering submissions to the MySQL project.