Skip to content
/ server Public

MDEV-39164 Deprecate MYSQL323 and MYSQL40 SQL modes#4862

Draft
itzanway wants to merge 1 commit intoMariaDB:mainfrom
itzanway:clean-MDEV-39164
Draft

MDEV-39164 Deprecate MYSQL323 and MYSQL40 SQL modes#4862
itzanway wants to merge 1 commit intoMariaDB:mainfrom
itzanway:clean-MDEV-39164

Conversation

@itzanway
Copy link
Copy Markdown
Contributor

Description

This PR deprecates the MYSQL323 and MYSQL40 SQL modes, as they have little practical use and lack test coverage against actual backend servers.


Implementation Details

Deprecation Marking:
Updated sql_mode_names in sql/sys_vars.cc to mark MYSQL323 and MYSQL40 as deprecated.

Runtime Warnings:
Modified check_sql_mode() to emit warnings when either MYSQL323 or MYSQL40 is 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.

@gkodinov gkodinov added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Mar 26, 2026
Copy link
Copy Markdown
Member

@gkodinov gkodinov left a comment

Choose a reason for hiding this comment

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

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)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

revert this please.

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),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

revert this please.

sql/sys_vars.cc Outdated
set_to_string(thd, ls, sql_mode, sql_mode_names);
return ls->str == 0;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

revert this please

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 =
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

no whitespace only changes please

@itzanway itzanway changed the base branch from 10.11 to main March 26, 2026 09:36
- Marked MYSQL323 and MYSQL40 as deprecated
- Added warnings in check_sql_mode()
- Added MTR test for deprecated SQL modes

Behavior preserved for backward compatibility.
@ParadoxV5 ParadoxV5 marked this pull request as draft March 26, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.

Development

Successfully merging this pull request may close these issues.

2 participants