SET @global_start_value = @@global.old_mode; SELECT @global_start_value; @global_start_value UTF8_IS_UTF8MB3 SET @session_start_value = @@session.old_mode; SELECT @session_start_value; @session_start_value UTF8_IS_UTF8MB3 '#--------------------FN_DYNVARS_152_01------------------------#' SET @@global.old_mode = "NO_PROGRESS_INFO"; Warnings: Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release SET @@global.old_mode = DEFAULT; SELECT @@global.old_mode; @@global.old_mode UTF8_IS_UTF8MB3 SET @@session.old_mode = "NO_PROGRESS_INFO"; Warnings: Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release SET @@session.old_mode = DEFAULT; SELECT @@session.old_mode; @@session.old_mode UTF8_IS_UTF8MB3 '#---------------------FN_DYNVARS_152_02-------------------------#' SET @@global.old_mode = NULL; ERROR 42000: Variable 'old_mode' can't be set to the value of 'NULL' SET @@global.old_mode = ''; SELECT @@global.old_mode; @@global.old_mode SET @@global.old_mode = ' '; SELECT @@global.old_mode; @@global.old_mode SET @@session.old_mode = NULL; ERROR 42000: Variable 'old_mode' can't be set to the value of 'NULL' SET @@session.old_mode = ''; SELECT @@session.old_mode; @@session.old_mode SET @@session.old_mode = ' '; SELECT @@session.old_mode; @@session.old_mode '#--------------------FN_DYNVARS_152_03------------------------#' SET @@global.old_mode = NO_PROGRESS_INFO; Warnings: Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release SELECT @@global.old_mode; @@global.old_mode NO_PROGRESS_INFO SET @@global.old_mode = NO_DUP_KEY_WARNINGS_WITH_IGNORE; Warnings: Warning 1287 'NO_DUP_KEY_WARNINGS_WITH_IGNORE' is deprecated and will be removed in a future release SELECT @@global.old_mode; @@global.old_mode NO_DUP_KEY_WARNINGS_WITH_IGNORE SET @@global.old_mode = OFF; ERROR 42000: Variable 'old_mode' can't be set to the value of 'OFF' SET @@session.old_mode = NO_PROGRESS_INFO; Warnings: Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release SELECT @@session.old_mode; @@session.old_mode NO_PROGRESS_INFO SET @@session.old_mode = NO_DUP_KEY_WARNINGS_WITH_IGNORE; Warnings: Warning 1287 'NO_DUP_KEY_WARNINGS_WITH_IGNORE' is deprecated and will be removed in a future release SELECT @@session.old_mode; @@session.old_mode NO_DUP_KEY_WARNINGS_WITH_IGNORE SET @@session.old_mode = OFF; ERROR 42000: Variable 'old_mode' can't be set to the value of 'OFF' SET @@global.old_mode = '?'; ERROR 42000: Variable 'old_mode' can't be set to the value of '?' SELECT @@global.old_mode; @@global.old_mode NO_DUP_KEY_WARNINGS_WITH_IGNORE '#--------------------FN_DYNVARS_152_04-------------------------#' SET @@global.old_mode = -1; ERROR 42000: Variable 'old_mode' can't be set to the value of '-1' SET @@global.old_mode = ASCII; ERROR 42000: Variable 'old_mode' can't be set to the value of 'ASCII' SET @@global.old_mode = NON_TRADITIONAL; ERROR 42000: Variable 'old_mode' can't be set to the value of 'NON_TRADITIONAL' SET @@global.old_mode = 'OF'; ERROR 42000: Variable 'old_mode' can't be set to the value of 'OF' SET @@global.old_mode = NONE; ERROR 42000: Variable 'old_mode' can't be set to the value of 'NONE' SET @@session.old_mode = -1; ERROR 42000: Variable 'old_mode' can't be set to the value of '-1' SET @@session.old_mode = ANSI_SINGLE_QUOTES; ERROR 42000: Variable 'old_mode' can't be set to the value of 'ANSI_SINGLE_QUOTES' SET @@session.old_mode = 'ON'; ERROR 42000: Variable 'old_mode' can't be set to the value of 'ON' SET @@session.old_mode = 'OF'; ERROR 42000: Variable 'old_mode' can't be set to the value of 'OF' SET @@session.old_mode = DISABLE; ERROR 42000: Variable 'old_mode' can't be set to the value of 'DISABLE' '#-------------------FN_DYNVARS_152_05----------------------------#' SELECT @@session.old_mode = VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME='old_mode'; @@session.old_mode = VARIABLE_VALUE 1 '#----------------------FN_DYNVARS_152_06------------------------#' SELECT @@global.old_mode = VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME='old_mode'; @@global.old_mode = VARIABLE_VALUE 1 '#---------------------FN_DYNVARS_152_07-------------------------#' SET @@global.old_mode = 0; SELECT @@global.old_mode; @@global.old_mode SET @@global.old_mode = 1; Warnings: Warning 1287 'NO_DUP_KEY_WARNINGS_WITH_IGNORE' is deprecated and will be removed in a future release SELECT @@global.old_mode; @@global.old_mode NO_DUP_KEY_WARNINGS_WITH_IGNORE SET @@global.old_mode = 2; Warnings: Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release SELECT @@global.old_mode; @@global.old_mode NO_PROGRESS_INFO SET @@global.old_mode = 4; Warnings: Warning 1287 'ZERO_DATE_TIME_CAST' is deprecated and will be removed in a future release SELECT @@global.old_mode; @@global.old_mode ZERO_DATE_TIME_CAST SET @@global.old_mode = 256; ERROR 42000: Variable 'old_mode' can't be set to the value of '256' SELECT @@global.old_mode; @@global.old_mode ZERO_DATE_TIME_CAST SET @@global.old_mode = 0.4; ERROR 42000: Incorrect argument type to variable 'old_mode' '#---------------------FN_DYNVARS_152_08----------------------#' SET @@global.old_mode = TRUE; Warnings: Warning 1287 'NO_DUP_KEY_WARNINGS_WITH_IGNORE' is deprecated and will be removed in a future release SELECT @@global.old_mode; @@global.old_mode NO_DUP_KEY_WARNINGS_WITH_IGNORE SET @@global.old_mode = FALSE; SELECT @@global.old_mode; @@global.old_mode '#---------------------FN_DYNVARS_152_09----------------------#' SET old_mode = 'NO_PROGRESS_INFO'; Warnings: Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release SET session old_mode = 1; Warnings: Warning 1287 'NO_DUP_KEY_WARNINGS_WITH_IGNORE' is deprecated and will be removed in a future release SELECT @@old_mode; @@old_mode NO_DUP_KEY_WARNINGS_WITH_IGNORE SET global old_mode = 0; SELECT @@global.old_mode; @@global.old_mode '#---------------------FN_DYNVARS_152_10----------------------#' SET @@session.old_mode = 'NO_PROGRESS_INFO,NO_DUP_KEY_WARNINGS_WITH_IGNORE'; Warnings: Warning 1287 'NO_DUP_KEY_WARNINGS_WITH_IGNORE' is deprecated and will be removed in a future release Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release SELECT @@session.old_mode; @@session.old_mode NO_DUP_KEY_WARNINGS_WITH_IGNORE,NO_PROGRESS_INFO SET @@global.old_mode = 'NO_DUP_KEY_WARNINGS_WITH_IGNORE,NO_PROGRESS_INFO'; Warnings: Warning 1287 'NO_DUP_KEY_WARNINGS_WITH_IGNORE' is deprecated and will be removed in a future release Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release SELECT @@global.old_mode; @@global.old_mode NO_DUP_KEY_WARNINGS_WITH_IGNORE,NO_PROGRESS_INFO SET @@session.old_mode = 'NO_PROGRESS_INFO,NO_SUCH_MODE'; ERROR 42000: Variable 'old_mode' can't be set to the value of 'NO_SUCH_MODE' SET @@old_mode=','; SELECT @@old_mode; @@old_mode SET @@old_mode=',,,,NO_PROGRESS_INFO,,,'; Warnings: Warning 1287 'NO_PROGRESS_INFO' is deprecated and will be removed in a future release SELECT @@old_mode; @@old_mode NO_PROGRESS_INFO SET @@old_mode=',,,,FOOBAR,,,,,'; ERROR 42000: Variable 'old_mode' can't be set to the value of 'FOOBAR' SELECT @@old_mode; @@old_mode NO_PROGRESS_INFO SET @@global.old_mode = @global_start_value; SELECT @@global.old_mode; @@global.old_mode UTF8_IS_UTF8MB3 SET @@session.old_mode = @session_start_value; SELECT @@session.old_mode; @@session.old_mode UTF8_IS_UTF8MB3 # # Beginning of 10.6 test # # MDEV-8334: Rename utf8 to utf8mb3 # # Save and display old values SET @save_old_mode = @@OLD_MODE; SET @save_character_set_server = @@character_set_server; SET @save_character_set_client = @@character_set_client; SET @save_character_set_results = @@character_set_results; SET @save_character_set_connection = @@character_set_connection; SET @save_character_set_filesystem = @@character_set_filesystem; SET @save_character_set_database = @@character_set_database; SET @save_collation_connection = @@collation_connection; SET @save_collation_server = @@collation_server; SET @save_collation_database = @@collation_database; SELECT @@OLD_MODE; @@OLD_MODE UTF8_IS_UTF8MB3 SELECT @@character_set_server,@@character_set_client,@@character_set_results, @@character_set_connection, @@character_set_filesystem, @@character_set_database, @@collation_connection, @@collation_server, @@collation_database; @@character_set_server @@character_set_client @@character_set_results @@character_set_connection @@character_set_filesystem @@character_set_database @@collation_connection @@collation_server @@collation_database latin1 latin1 latin1 latin1 binary latin1 latin1_swedish_ci latin1_swedish_ci latin1_swedish_ci # # UTF8MB3 alias for UTF8 # SET @@character_set_server = utf8; SET @@character_set_client = utf8; SET @@character_set_results = utf8; SET @@character_set_connection = utf8; SET @@character_set_filesystem = utf8; SET @@character_set_database = utf8; SET @@collation_connection = utf8_general_ci; SET @@collation_server = utf8_unicode_ci; SET @@collation_database = utf8_bin; SELECT @@character_set_server, @@character_set_client, @@character_set_results, @@character_set_connection, @@character_set_filesystem, @@character_set_database, @@collation_connection, @@collation_server, @@collation_database; @@character_set_server @@character_set_client @@character_set_results @@character_set_connection @@character_set_filesystem @@character_set_database @@collation_connection @@collation_server @@collation_database utf8mb3 utf8mb3 utf8mb3 utf8mb3 utf8mb3 utf8mb3 utf8mb3_general_ci utf8mb3_unicode_ci utf8mb3_bin CREATE DATABASE db1 CHARACTER SET = 'utf8' COLLATE = 'utf8_general_ci'; ALTER DATABASE db1 CHARACTER SET = 'utf8' COLLATE = 'utf8_unicode_ci'; CREATE TABLE tb1 (id1 INT) CHARACTER SET 'utf8' COLLATE 'utf8_bin'; SHOW CREATE TABLE tb1; Table Create Table tb1 CREATE TABLE `tb1` ( `id1` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin DROP TABLE tb1; DROP DATABASE db1; # # UTF8MB4 is alias for UTF8 # SET @@OLD_MODE=0; SET @@character_set_server = utf8; SET @@character_set_client = utf8; SET @@character_set_results = utf8; SET @@character_set_connection = utf8; SET @@character_set_filesystem = utf8; SET @@character_set_database = utf8; SET @@collation_connection = utf8_general_ci; SET @@collation_server = utf8_unicode_ci; SET @@collation_database = utf8_bin; SELECT @@character_set_server, @@character_set_client, @@character_set_results, @@character_set_connection, @@character_set_filesystem, @@character_set_database, @@collation_connection, @@collation_server, @@collation_database; @@character_set_server @@character_set_client @@character_set_results @@character_set_connection @@character_set_filesystem @@character_set_database @@collation_connection @@collation_server @@collation_database utf8mb4 utf8mb4 utf8mb4 utf8mb4 utf8mb4 utf8mb4 utf8mb4_general_ci utf8mb4_unicode_ci utf8mb4_bin CREATE DATABASE db1 CHARACTER SET = 'utf8' COLLATE = 'utf8_general_ci'; ALTER DATABASE db1 CHARACTER SET = 'utf8' COLLATE = 'utf8_unicode_ci'; CREATE TABLE tb1 (id1 INT) CHARACTER SET 'utf8' COLLATE 'utf8_bin'; SHOW CREATE TABLE tb1; Table Create Table tb1 CREATE TABLE `tb1` ( `id1` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin DROP TABLE tb1; DROP DATABASE db1; SET @@OLD_MODE = @save_old_mode; SET @@character_set_server = @save_character_set_server; SET @@character_set_client = @save_character_set_client; SET @@character_set_results = @save_character_set_results; SET @@character_set_connection = @save_character_set_connection; SET @@character_set_filesystem = @save_character_set_filesystem; SET @@character_set_database = @save_character_set_database; SET @@collation_connection = @save_collation_connection; SET @@collation_server = @save_collation_server; 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; Warnings: Warning 1287 'IGNORE_INDEX_ONLY_FOR_JOIN' is deprecated and will be removed in a future release SELECT @@OLD_MODE; @@OLD_MODE IGNORE_INDEX_ONLY_FOR_JOIN SET @@OLD_MODE= COMPAT_5_1_CHECKSUM; Warnings: Warning 1287 'COMPAT_5_1_CHECKSUM' is deprecated and will be removed in a future release SELECT @@OLD_MODE; @@OLD_MODE COMPAT_5_1_CHECKSUM SET @@OLD_MODE= @save_old_mode; # # End of 10.9 test #