MDEV-39164 Deprecate MYSQL323 and MYSQL40 SQL modes#4862
Draft
itzanway wants to merge 1 commit intoMariaDB:mainfrom
Draft
MDEV-39164 Deprecate MYSQL323 and MYSQL40 SQL modes#4862itzanway wants to merge 1 commit intoMariaDB:mainfrom
itzanway wants to merge 1 commit intoMariaDB:mainfrom
Conversation
gkodinov
requested changes
Mar 26, 2026
Member
gkodinov
left a comment
There was a problem hiding this comment.
Thank you for your contribution! This is a preliminary review.
Please also rebase to main (a new feature). And fix the failing tests in buildbot.
| MODE_NO_ENGINE_SUBSTITUTION); | ||
| return sql_mode; | ||
| } | ||
| static bool check_sql_mode(sys_var *self, THD *thd, set_var *var) |
Member
There was a problem hiding this comment.
I believe this will only produce warnings if set via the SET command. Please add a test that sets the mode on the command line and make sure a warning is produced.
sql/sys_vars.cc
Outdated
| static Sys_var_ulong Sys_wsrep_max_ws_rows ( | ||
| "wsrep_max_ws_rows", "Max number of rows in write set", | ||
| GLOBAL_VAR(wsrep_max_ws_rows), CMD_LINE(REQUIRED_ARG), | ||
| VALID_RANGE(0, 1048576), DEFAULT(0), |
sql/sys_vars.cc
Outdated
| DEFAULT(WSREP_START_POSITION_ZERO), | ||
| NO_MUTEX_GUARD, NOT_IN_BINLOG, | ||
| ON_CHECK(wsrep_start_position_check), | ||
| ON_CHECK(wsrep_start_position_check), |
sql/sys_vars.cc
Outdated
| set_to_string(thd, ls, sql_mode, sql_mode_names); | ||
| return ls->str == 0; | ||
| } | ||
|
|
sql/sys_vars.cc
Outdated
| static bool check_sql_mode(sys_var *self, THD *thd, set_var *var) | ||
| { | ||
| var->save_result.ulonglong_value= | ||
| var->save_result.ulonglong_value = |
Member
There was a problem hiding this comment.
no whitespace only changes please
- Marked MYSQL323 and MYSQL40 as deprecated - Added warnings in check_sql_mode() - Added MTR test for deprecated SQL modes Behavior preserved for backward compatibility.
39cc7ed to
cf38a9b
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.
Description
This PR deprecates the
MYSQL323andMYSQL40SQL modes, as they have little practical use and lack test coverage against actual backend servers.Implementation Details
Deprecation Marking:
Updated
sql_mode_namesinsql/sys_vars.ccto markMYSQL323andMYSQL40as deprecated.Runtime Warnings:
Modified
check_sql_mode()to emit warnings when eitherMYSQL323orMYSQL40is used, informing users that these modes are deprecated and will be removed in future versions.Backward Compatibility:
Existing behavior of both SQL modes is preserved to avoid breaking compatibility with legacy systems.
Testing
Added an MTR test to verify that appropriate warnings are generated when deprecated SQL modes are enabled.
Due to local hardware constraints, full test execution was not performed. CI will validate correctness and ensure no regressions.