1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

MDEV-24920: Merge "old" SQL variable to "old_mode" sql variable

Analysis: There are 2 server variables- "old_mode" and "old". "old" is no
longer needed as "old_mode" has replaced it (however still used in some places
 in the code). "old_mode" and "old" has same purpose- emulate behavior from
previous MariaDB versions. So they can be merged to avoid confusion.
Fix: Deprecate "old" variable and create another mode for @@old_mode to mimic
behavior of previous "old" variable. Create specific modes for specifix task
that --old sql variable was doing earlier and use the new modes instead.
This commit is contained in:
Rucha Deodhar
2021-08-13 15:49:16 +05:30
parent c132bce1a1
commit 5945e420f1
14 changed files with 131 additions and 15 deletions

View File

@@ -114,8 +114,8 @@ SET @@global.old_mode = 4;
SELECT @@global.old_mode;
@@global.old_mode
ZERO_DATE_TIME_CAST
SET @@global.old_mode = 16;
ERROR 42000: Variable 'old_mode' can't be set to the value of '16'
SET @@global.old_mode = 64;
ERROR 42000: Variable 'old_mode' can't be set to the value of '64'
SELECT @@global.old_mode;
@@global.old_mode
ZERO_DATE_TIME_CAST
@@ -264,3 +264,42 @@ SET @@collation_database = @save_collation_database;
#
# End of 10.6 test
#
#
# Beginning of 10.9 test
#
#
# MDEV-24920: Merge "old" SQL variable to "old_mode" sql variable
#
# Checking that setting old will also set old_mode
SELECT @@OLD_MODE;
@@OLD_MODE
UTF8_IS_UTF8MB3
SET old= 1;
Warnings:
Warning 1287 '@@old' is deprecated and will be removed in a future release. Please use '@@old_mode' instead
SELECT @@OLD_MODE;
@@OLD_MODE
NO_PROGRESS_INFO,UTF8_IS_UTF8MB3,IGNORE_INDEX_ONLY_FOR_JOIN,COMPAT_5_1_CHECKSUM
SET old= DEFAULT;
Warnings:
Warning 1287 '@@old' is deprecated and will be removed in a future release. Please use '@@old_mode' instead
SELECT @@OLD_MODE;
@@OLD_MODE
UTF8_IS_UTF8MB3
# Checking that old_mode can be set independently as well
SELECT @@OLD_MODE;
@@OLD_MODE
UTF8_IS_UTF8MB3
SET @save_old_mode = @@OLD_MODE;
SET @@OLD_MODE= IGNORE_INDEX_ONLY_FOR_JOIN;
SELECT @@OLD_MODE;
@@OLD_MODE
IGNORE_INDEX_ONLY_FOR_JOIN
SET @@OLD_MODE= COMPAT_5_1_CHECKSUM;
SELECT @@OLD_MODE;
@@OLD_MODE
COMPAT_5_1_CHECKSUM
SET @@OLD_MODE= @save_old_mode;
#
# End of 10.9 test
#