diff options
author | Daniel Black <daniel@mariadb.org> | 2022-12-05 09:03:06 +1100 |
---|---|---|
committer | Daniel Black <daniel@mariadb.org> | 2023-01-23 08:39:41 +1100 |
commit | 26ef4875e6ba17cb1cf83e4eec5b39b6ab5f89e8 (patch) | |
tree | 12827eeae8dffb825565520b01ad331658092b6f | |
parent | 61161cdaf99f8548815a7de97a544f8d0ab76960 (diff) | |
download | mariadb-git-26ef4875e6ba17cb1cf83e4eec5b39b6ab5f89e8.tar.gz |
MDEV-6339 deprecate log_slow_admin_statements
log_slow_filter=admin as been available for a long time.
Uses can migrate from log_slow_statements_statements=OFF by removing
'admin' from the default log_slow_filter variable setting.
-rw-r--r-- | mysql-test/main/log_slow_debug.result | 16 | ||||
-rw-r--r-- | mysql-test/main/mysqld--help.result | 4 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result | 12 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/r/sysvars_server_embedded.result | 2 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result | 2 | ||||
-rw-r--r-- | sql/sys_vars.cc | 7 |
6 files changed, 37 insertions, 6 deletions
diff --git a/mysql-test/main/log_slow_debug.result b/mysql-test/main/log_slow_debug.result index 16d67d7fdc7..eaf38425f8b 100644 --- a/mysql-test/main/log_slow_debug.result +++ b/mysql-test/main/log_slow_debug.result @@ -6,6 +6,8 @@ SET @@GLOBAL.log_output='TABLE'; FLUSH SLOW LOGS; SET @@GLOBAL.slow_query_log=ON; SET @@GLOBAL.log_slow_admin_statements=ON; +Warnings: +Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead SET @saved_dbug = @@debug_dbug; SET SESSION debug_dbug="+d,simulate_slow_query"; CREATE PROCEDURE show_slow_log() @@ -19,6 +21,8 @@ $$ # Expect all admin statements in the slow log (ON,DEFAULT) # SET @@SESSION.log_slow_admin_statements=ON; +Warnings: +Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead SET log_slow_filter=DEFAULT; TRUNCATE TABLE mysql.slow_log; CREATE TABLE t1 (a INT); @@ -66,6 +70,8 @@ sql_text # Expect all admin statements in the slow log (ON,admin) # SET @@SESSION.log_slow_admin_statements=ON; +Warnings: +Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead SET log_slow_filter=admin; TRUNCATE TABLE mysql.slow_log; CREATE TABLE t1 (a INT); @@ -100,6 +106,8 @@ sql_text # Expect none of admin DDL statements in the slow log (ON,filesort) # SET @@SESSION.log_slow_admin_statements=ON; +Warnings: +Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead SET log_slow_filter=filesort; TRUNCATE TABLE mysql.slow_log; CREATE TABLE t1 (a INT); @@ -127,6 +135,8 @@ sql_text # Expect none of admin statements in the slow log (OFF,DEFAULT) # SET @@SESSION.log_slow_admin_statements=OFF; +Warnings: +Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead SET log_slow_filter=DEFAULT; TRUNCATE TABLE mysql.slow_log; CREATE TABLE t1 (a INT); @@ -171,7 +181,11 @@ sql_text # prevent enabling globally suppressed logging by setting the session variable to ON. # SET @@GLOBAL.log_slow_admin_statements=OFF; +Warnings: +Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead SET @@SESSION.log_slow_admin_statements=ON; +Warnings: +Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead SET log_slow_filter=DEFAULT; TRUNCATE TABLE mysql.slow_log; CREATE TABLE t1 (a INT); @@ -223,4 +237,6 @@ TRUNCATE mysql.slow_log; SET @@global.slow_query_log= @org_slow_query_log; SET @@global.log_output= @org_log_output; SET @@global.log_slow_admin_statements= @org_log_slow_admin_statements; +Warnings: +Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead DROP PROCEDURE show_slow_log; diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result index 5720988df2f..857e11d57ef 100644 --- a/mysql-test/main/mysqld--help.result +++ b/mysql-test/main/mysqld--help.result @@ -508,8 +508,8 @@ The following specify which files/extra groups are read (specified before remain --log-slow-admin-statements Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open. - Resets or sets the option 'admin' in - log_slow_disabled_statements + Resets or sets the option 'admin' in log_slow_filter. + Deprecated, use log_slow_filter without 'admin'. (Defaults to on; use --skip-log-slow-admin-statements to disable.) --log-slow-disabled-statements=name Don't log certain types of statements to slow log. Any diff --git a/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result b/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result index 95916d8ce15..41a15e43356 100644 --- a/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result +++ b/mysql-test/suite/sys_vars/r/log_slow_admin_statements_func.result @@ -11,6 +11,8 @@ SET GLOBAL log_output = 'file,table'; SET GLOBAL slow_query_log = on; SET SESSION long_query_time = 0; SET SESSION log_slow_admin_statements = on; +Warnings: +Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead ALTER TABLE log_slow_admin_statements ADD COLUMN k INT DEFAULT 17; CREATE PROCEDURE add_rows() BEGIN @@ -42,22 +44,32 @@ SET @@global.log_output= @old_log_output; SET @@global.slow_query_log= @old_slow_query_log; SET @@session.long_query_time= @old_long_query_time; SET @@global.log_slow_admin_statements= @old_log_slow_admin_statements; +Warnings: +Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead DROP PROCEDURE add_rows; TRUNCATE TABLE mysql.slow_log; SET @save_log_slow_disabled_statements= @@global.log_slow_disabled_statements; SET @@SESSION.log_slow_admin_statements= TRUE; +Warnings: +Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead select @@SESSION.log_slow_disabled_statements; @@SESSION.log_slow_disabled_statements sp SET @@SESSION.log_slow_admin_statements= FALSE; +Warnings: +Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead select @@SESSION.log_slow_disabled_statements; @@SESSION.log_slow_disabled_statements admin,sp SET @@GLOBAL.log_slow_admin_statements= TRUE; +Warnings: +Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead select @@GLOBAL.log_slow_disabled_statements; @@GLOBAL.log_slow_disabled_statements sp SET @@GLOBAL.log_slow_admin_statements= FALSE; +Warnings: +Warning 1287 '@@log_slow_admin_statements' is deprecated and will be removed in a future release. Please use '@@log_slow_filter' instead select @@GLOBAL.log_slow_disabled_statements; @@GLOBAL.log_slow_disabled_statements admin,sp diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result index f896421559c..aa3cc62edab 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result @@ -1665,7 +1665,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME LOG_SLOW_ADMIN_STATEMENTS VARIABLE_SCOPE SESSION VARIABLE_TYPE BOOLEAN -VARIABLE_COMMENT Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open. Resets or sets the option 'admin' in log_slow_disabled_statements +VARIABLE_COMMENT Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open. Resets or sets the option 'admin' in log_slow_filter. Deprecated, use log_slow_filter without 'admin'. NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index 23942418b07..e3328521395 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -1815,7 +1815,7 @@ COMMAND_LINE_ARGUMENT OPTIONAL VARIABLE_NAME LOG_SLOW_ADMIN_STATEMENTS VARIABLE_SCOPE SESSION VARIABLE_TYPE BOOLEAN -VARIABLE_COMMENT Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open. Resets or sets the option 'admin' in log_slow_disabled_statements +VARIABLE_COMMENT Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements to the slow log if it is open. Resets or sets the option 'admin' in log_slow_filter. Deprecated, use log_slow_filter without 'admin'. NUMERIC_MIN_VALUE NULL NUMERIC_MAX_VALUE NULL NUMERIC_BLOCK_SIZE NULL diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 338f0f23c2c..a0b43cb08c5 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -1511,9 +1511,12 @@ static Sys_var_bit Sys_log_slow_admin_statements( "log_slow_admin_statements", "Log slow OPTIMIZE, ANALYZE, ALTER and other administrative statements " "to the slow log if it is open. Resets or sets the option 'admin' in " - "log_slow_disabled_statements", + "log_slow_filter. " + "Deprecated, use log_slow_filter without 'admin'.", SESSION_VAR(log_slow_disabled_statements), - CMD_LINE(OPT_ARG), REVERSE(LOG_SLOW_DISABLE_ADMIN), DEFAULT(TRUE)); + CMD_LINE(OPT_ARG), REVERSE(LOG_SLOW_DISABLE_ADMIN), DEFAULT(TRUE), + 0, NOT_IN_BINLOG, ON_CHECK(0), ON_UPDATE(0), + DEPRECATED("'@@log_slow_filter'")); static Sys_var_bit Sys_log_slow_slave_statements( "log_slow_slave_statements", |