summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRucha Deodhar <rucha.deodhar@mariadb.com>2022-01-10 20:55:19 +0530
committerRucha Deodhar <rucha.deodhar@mariadb.com>2022-02-01 12:38:07 +0530
commitdf49ed0edb5158f9cccb26d06c88a059f99bc799 (patch)
tree0413db2b4ce54ae078cd892274b872b459f8ed14
parenta1f630ccfe33a14ee3c535a78b645d384c82876d (diff)
downloadmariadb-git-bb-10.2-MDEV-27462.tar.gz
MDEV-27462 : SET STATEMENT allows variables that cannot be set per querybb-10.2-MDEV-27462
basis Analysis: Some system variables can be set per query basis because flag NO_SET_STMT is missing. Fix: Added NO_SET_STMT flag. List of disallowed variables taken from documentation: autocommit, character_set_client, character_set_connection, character_set_filesystem, collation_connection, default_master_connection, debug_sync, interactive_timeout, gtid_domain_id, last_insert_id, log_slow_filter, log_slow_rate_limit, log_slow_verbosity, long_query_time, min_examined_row_limit, profiling, profiling_history_size, query_cache_type, rand_seed1, rand_seed2, skip_replication, slow_query_log, sql_log_off, tx_isolation, wait_timeout
-rw-r--r--mysql-test/r/set_statement.result88
-rw-r--r--mysql-test/r/set_statement_notembedded_binlog.result21
-rw-r--r--mysql-test/suite/rpl/r/rpl_set_statement_default_master.result9
-rw-r--r--mysql-test/suite/rpl/t/rpl_set_statement_default_master.test12
-rw-r--r--mysql-test/t/set_statement.test88
-rw-r--r--mysql-test/t/set_statement_notembedded_binlog.test17
-rw-r--r--sql/sys_vars.cc22
7 files changed, 203 insertions, 54 deletions
diff --git a/mysql-test/r/set_statement.result b/mysql-test/r/set_statement.result
index cd4859c32e8..44595eef7f8 100644
--- a/mysql-test/r/set_statement.result
+++ b/mysql-test/r/set_statement.result
@@ -1042,13 +1042,28 @@ set global general_log=@save_general_log;
set @save_long_query_time= @@long_query_time;
set @save_slow_query_log= @@slow_query_log;
set @save_log_output= @@log_output;
-set statement long_query_time=default for select @@long_query_time;
+set @old_long_query_time= @@long_query_time;
+set @@long_query_time=default;
+select @@long_query_time;
@@long_query_time
DEFAULT
-set statement log_slow_filter=default for select @@log_slow_filter;
-set statement log_slow_verbosity=default for select @@log_slow_verbosity;
-set statement log_slow_rate_limit=default for select @@log_slow_rate_limit;
-set statement slow_query_log=default for select @@slow_query_log;
+set @@long_query_time= @old_long_query_time;
+set @old_log_slow_filter= @@log_slow_filter;
+set @@log_slow_filter=default;
+select @@log_slow_filter;
+set @@log_slow_filter= @old_log_slow_filter;
+set @old_log_slow_verbosity= @@log_slow_verbosity;
+set @@log_slow_verbosity=default;
+select @@log_slow_verbosity;
+set @@log_slow_verbosity= @old_log_slow_verbosity;
+set @old_log_slow_rate_limit= @@log_slow_rate_limit;
+set @@log_slow_rate_limit=default;
+select @@log_slow_rate_limit;
+set @@log_slow_rate_limit= @old_log_slow_rate_limit;
+set @old_slow_query_log= @@slow_query_log;
+set @@slow_query_log=default;
+select @@slow_query_log;
+set @@slow_query_log= @old_slow_query_log;
truncate table mysql.slow_log;
set slow_query_log= 1;
set global log_output='TABLE';
@@ -1065,51 +1080,66 @@ sql_text
select sleep(0.1)
#---
#should be written
-set statement long_query_time=0.01 for select sleep(0.1);
+set @old_long_query_time= @@long_query_time;
+set @@long_query_time=0.01;
+select sleep(0.1);
sleep(0.1)
0
+set @@long_query_time=@old_long_query_time;
select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
sql_text
select sleep(0.1)
-set statement long_query_time=0.01 for select sleep(0.1)
+select sleep(0.1)
#---
set @@long_query_time=0.01;
#should NOT be written
-set statement slow_query_log=0 for select sleep(0.1);
+set @old_slow_query_log= @@slow_query_log;
+set @@slow_query_log=0;
+select sleep(0.1);
sleep(0.1)
0
+set @@slow_query_log=@old_slow_query_log;
set @@long_query_time=@save_long_query_time;
select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
sql_text
select sleep(0.1)
-set statement long_query_time=0.01 for select sleep(0.1)
+select sleep(0.1)
#---
#should NOT be written
-set statement long_query_time=0.01,log_slow_filter='full_scan' for select sleep(0.1);
+set @old_long_query_time= @@long_query_time, @old_log_slow_filter=@@log_slow_filter;
+set @@long_query_time=0.01, @@log_slow_filter='full_scan';
+select sleep(0.1);
sleep(0.1)
0
+set @@long_query_time= @old_long_query_time, @@log_slow_filter=@old_log_slow_filter;
select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
sql_text
select sleep(0.1)
-set statement long_query_time=0.01 for select sleep(0.1)
+select sleep(0.1)
#---
#should NOT be written
-set statement long_query_time=0.01,log_slow_rate_limit=9999 for select sleep(0.1);
+set @old_long_query_time= @@long_query_time, @old_log_slow_filter=@@log_slow_filter;
+set @@long_query_time=0.01,@@log_slow_rate_limit=9999;
+select sleep(0.1);
sleep(0.1)
0
+set @@long_query_time= @old_long_query_time, @@log_slow_filter=@old_log_slow_filter;
select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
sql_text
select sleep(0.1)
-set statement long_query_time=0.01 for select sleep(0.1)
+select sleep(0.1)
#---
#should NOT be written
-set statement long_query_time=0.01,min_examined_row_limit=50 for select sleep(0.1);
+set @old_long_query_time= @@long_query_time, @old_min_examined_row_limit=@@min_examined_row_limit;
+set @@long_query_time=0.01, @@min_examined_row_limit=50;
+select sleep(0.1);
sleep(0.1)
0
+set @@long_query_time= @old_long_query_time, @@min_examined_row_limit=@old_min_examined_row_limit;
select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
sql_text
select sleep(0.1)
-set statement long_query_time=0.01 for select sleep(0.1)
+select sleep(0.1)
#---
set global log_output= @save_log_output;
set @@slow_query_log= @save_slow_query_log;
@@ -1137,6 +1167,34 @@ set statement wait_timeout=default for select 1;
ERROR 42000: The system variable wait_timeout cannot be set in SET STATEMENT.
set statement interactive_timeout=default for select 1;
ERROR 42000: The system variable interactive_timeout cannot be set in SET STATEMENT.
+set statement default_master_connection='' for select 1;
+ERROR 42000: The system variable default_master_connection cannot be set in SET STATEMENT.
+set statement debug_sync='RESET' for select 1;
+ERROR 42000: The system variable debug_sync cannot be set in SET STATEMENT.
+set statement gtid_domain_id=1 for select 1;
+ERROR 42000: The system variable gtid_domain_id cannot be set in SET STATEMENT.
+set statement last_insert_id=1 for select 1;
+ERROR 42000: The system variable last_insert_id cannot be set in SET STATEMENT.
+set statement log_slow_filter=2 for select 1;
+ERROR 42000: The system variable log_slow_filter cannot be set in SET STATEMENT.
+set statement log_slow_rate_limit=1.1 for select 1;
+ERROR 42000: The system variable log_slow_rate_limit cannot be set in SET STATEMENT.
+set statement log_slow_rate_limit=1.1 for select 1;
+ERROR 42000: The system variable log_slow_rate_limit cannot be set in SET STATEMENT.
+set statement log_slow_verbosity=2 for select 1;
+ERROR 42000: The system variable log_slow_verbosity cannot be set in SET STATEMENT.
+set statement long_query_time=2 for select 1;
+ERROR 42000: The system variable long_query_time cannot be set in SET STATEMENT.
+set statement min_examined_row_limit=65535 for select 1;
+ERROR 42000: The system variable min_examined_row_limit cannot be set in SET STATEMENT.
+set statement profiling=ON for select 1;
+ERROR 42000: The system variable profiling cannot be set in SET STATEMENT.
+set statement rand_seed1=1 for select 1;
+ERROR 42000: The system variable rand_seed1 cannot be set in SET STATEMENT.
+set statement rand_seed2=1 for select 1;
+ERROR 42000: The system variable rand_seed2 cannot be set in SET STATEMENT.
+set statement slow_query_log='OFF' for select 1;
+ERROR 42000: The system variable slow_query_log cannot be set in SET STATEMENT.
set @save_week_format=@@default_week_format;
set @@default_week_format=0;
SET STATEMENT default_week_format = 2 FOR SELECT WEEK('2000-01-01');
diff --git a/mysql-test/r/set_statement_notembedded_binlog.result b/mysql-test/r/set_statement_notembedded_binlog.result
index 50fcde5a1cb..aaf3a57cdfb 100644
--- a/mysql-test/r/set_statement_notembedded_binlog.result
+++ b/mysql-test/r/set_statement_notembedded_binlog.result
@@ -8,14 +8,17 @@ reset master;
create table t1 (i int);
set gtid_domain_id = 10;
insert into t1 values (1),(2);
-set statement gtid_domain_id = 20 for insert into t1 values (3),(4);
+set @old_gtid_domain_id= @@gtid_domain_id;
+set @@gtid_domain_id= 20;
+insert into t1 values (3),(4);
+set @@gtid_domain_id= @old_gtid_domain_id;
show binlog events limit 5,5;
Log_name Pos Event_type Server_id End_log_pos Info
x x x x x BEGIN GTID 10-1-1
x x x x x use `test`; insert into t1 values (1),(2)
x x x x x COMMIT
x x x x x BEGIN GTID 20-1-1
-x x x x x use `test`; set statement gtid_domain_id = 20 for insert into t1 values (3),(4)
+x x x x x use `test`; insert into t1 values (3),(4)
drop table t1;
reset master;
SET @a=11;
@@ -24,8 +27,11 @@ create table t2 (b int);
insert into t2 values (1),(2);
CREATE function f1() returns int
BEGIN
-SET STATEMENT last_insert_id=@a for insert into t1 values (NULL, @a,
-last_insert_id());
+declare old_last_insert_id int;
+set old_last_insert_id= @@last_insert_id;
+set last_insert_id= @a;
+insert into t1 values (NULL, @a, last_insert_id());
+set @@last_insert_id= old_last_insert_id;
SET @a:=@a*100+13;
return @a;
end|
@@ -44,12 +50,10 @@ Log_name Pos Event_type Server_id End_log_pos Info
x x x x x LAST_INSERT_ID=0
x x x x x INSERT_ID=1
x x x x x @`a`=11
-x x x x x @`a`=11
x x x x x use `test`; SELECT `test`.`f1`()
x x x x x LAST_INSERT_ID=0
x x x x x INSERT_ID=2
x x x x x @`a`=1113
-x x x x x @`a`=1113
x x x x x use `test`; SELECT `test`.`f1`()
x x x x x COMMIT
select * from t1;
@@ -101,7 +105,10 @@ a c d
drop function f1;
drop table t1,t2;
reset master;
-set statement last_insert_id = 112 for create table t1 as select last_insert_id();
+set @old_last_insert_id= @@last_insert_id;
+set @@last_insert_id= 112;
+create table t1 as select last_insert_id();
+set @@last_insert_id= @old_last_insert_id;
show binlog events limit 4,1;
Log_name Pos Event_type Server_id End_log_pos Info
x x x x x LAST_INSERT_ID=112
diff --git a/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result b/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result
index 828e171548d..625ab03b419 100644
--- a/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result
+++ b/mysql-test/suite/rpl/r/rpl_set_statement_default_master.result
@@ -4,15 +4,20 @@ connection slave;
include/stop_slave.inc
RESET SLAVE ALL;
# Does not work for CHANGE MASTER:
-SET STATEMENT default_master_connection = 'm1' FOR
+SET @old_default_master_connection= @@default_master_connection;
+SET default_master_connection = 'm1';
CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_USER='root';
+SET @@default_master_connection= @old_default_master_connection;
#
# The first field, Connection_name, should say 'm1'...
#
Connection_name = 'm1'
RESET SLAVE ALL;
CHANGE MASTER 'm1' TO MASTER_HOST='127.0.0.1', MASTER_PORT=MASTER_MYPORT, MASTER_USER='root';
-SET STATEMENT default_master_connection = 'm1' FOR START SLAVE;
+SET @old_default_master_connection= @@default_master_connection;
+SET default_master_connection = 'm1';
+START SLAVE;
+SET @@default_master_connection= @old_default_master_connection;
set default_master_connection = 'm1';
stop slave;
include/wait_for_slave_to_stop.inc
diff --git a/mysql-test/suite/rpl/t/rpl_set_statement_default_master.test b/mysql-test/suite/rpl/t/rpl_set_statement_default_master.test
index 106cb4547f4..f3451e34869 100644
--- a/mysql-test/suite/rpl/t/rpl_set_statement_default_master.test
+++ b/mysql-test/suite/rpl/t/rpl_set_statement_default_master.test
@@ -6,10 +6,11 @@
RESET SLAVE ALL;
--echo # Does not work for CHANGE MASTER:
+SET @old_default_master_connection= @@default_master_connection;
+SET default_master_connection = 'm1';
--replace_result $MASTER_MYPORT MASTER_MYPORT
-eval SET STATEMENT default_master_connection = 'm1' FOR
- CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root';
-
+eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root';
+SET @@default_master_connection= @old_default_master_connection;
--echo #
--echo # The first field, Connection_name, should say 'm1'...
@@ -23,7 +24,10 @@ RESET SLAVE ALL;
--replace_result $MASTER_MYPORT MASTER_MYPORT
eval CHANGE MASTER 'm1' TO MASTER_HOST='127.0.0.1', MASTER_PORT=$MASTER_MYPORT, MASTER_USER='root';
-SET STATEMENT default_master_connection = 'm1' FOR START SLAVE;
+SET @old_default_master_connection= @@default_master_connection;
+SET default_master_connection = 'm1';
+START SLAVE;
+SET @@default_master_connection= @old_default_master_connection;
set default_master_connection = 'm1';
stop slave;
diff --git a/mysql-test/t/set_statement.test b/mysql-test/t/set_statement.test
index a5f5c03098d..2edb396c167 100644
--- a/mysql-test/t/set_statement.test
+++ b/mysql-test/t/set_statement.test
@@ -992,15 +992,34 @@ set @save_slow_query_log= @@slow_query_log;
set @save_log_output= @@log_output;
let $long_query_time=`select @@long_query_time`;
+set @old_long_query_time= @@long_query_time;
+set @@long_query_time=default;
--replace_result $long_query_time DEFAULT
-set statement long_query_time=default for select @@long_query_time;
+select @@long_query_time;
+set @@long_query_time= @old_long_query_time;
# Disable result log as the results depends on the values of the variables
--disable_result_log
-set statement log_slow_filter=default for select @@log_slow_filter;
-set statement log_slow_verbosity=default for select @@log_slow_verbosity;
-set statement log_slow_rate_limit=default for select @@log_slow_rate_limit;
-set statement slow_query_log=default for select @@slow_query_log;
+set @old_log_slow_filter= @@log_slow_filter;
+set @@log_slow_filter=default;
+select @@log_slow_filter;
+set @@log_slow_filter= @old_log_slow_filter;
+
+set @old_log_slow_verbosity= @@log_slow_verbosity;
+set @@log_slow_verbosity=default;
+select @@log_slow_verbosity;
+set @@log_slow_verbosity= @old_log_slow_verbosity;
+
+set @old_log_slow_rate_limit= @@log_slow_rate_limit;
+set @@log_slow_rate_limit=default;
+select @@log_slow_rate_limit;
+set @@log_slow_rate_limit= @old_log_slow_rate_limit;
+
+set @old_slow_query_log= @@slow_query_log;
+set @@slow_query_log=default;
+select @@slow_query_log;
+set @@slow_query_log= @old_slow_query_log;
+
--enable_result_log
truncate table mysql.slow_log;
@@ -1015,25 +1034,41 @@ set @@long_query_time=@save_long_query_time;
select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
--echo #---
--echo #should be written
-set statement long_query_time=0.01 for select sleep(0.1);
+set @old_long_query_time= @@long_query_time;
+set @@long_query_time=0.01;
+select sleep(0.1);
+set @@long_query_time=@old_long_query_time;
select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
--echo #---
set @@long_query_time=0.01;
--echo #should NOT be written
-set statement slow_query_log=0 for select sleep(0.1);
+set @old_slow_query_log= @@slow_query_log;
+set @@slow_query_log=0;
+select sleep(0.1);
+set @@slow_query_log=@old_slow_query_log;
+
set @@long_query_time=@save_long_query_time;
select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
--echo #---
--echo #should NOT be written
-set statement long_query_time=0.01,log_slow_filter='full_scan' for select sleep(0.1);
+set @old_long_query_time= @@long_query_time, @old_log_slow_filter=@@log_slow_filter;
+set @@long_query_time=0.01, @@log_slow_filter='full_scan';
+select sleep(0.1);
+set @@long_query_time= @old_long_query_time, @@log_slow_filter=@old_log_slow_filter;
select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
--echo #---
--echo #should NOT be written
-set statement long_query_time=0.01,log_slow_rate_limit=9999 for select sleep(0.1);
+set @old_long_query_time= @@long_query_time, @old_log_slow_filter=@@log_slow_filter;
+set @@long_query_time=0.01,@@log_slow_rate_limit=9999;
+select sleep(0.1);
+set @@long_query_time= @old_long_query_time, @@log_slow_filter=@old_log_slow_filter;
select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
--echo #---
--echo #should NOT be written
-set statement long_query_time=0.01,min_examined_row_limit=50 for select sleep(0.1);
+set @old_long_query_time= @@long_query_time, @old_min_examined_row_limit=@@min_examined_row_limit;
+set @@long_query_time=0.01, @@min_examined_row_limit=50;
+select sleep(0.1);
+set @@long_query_time= @old_long_query_time, @@min_examined_row_limit=@old_min_examined_row_limit;
select sql_text from mysql.slow_log where sql_text not like 'set @@long_query_time%';
--echo #---
#
@@ -1072,6 +1107,34 @@ set statement query_cache_type=default for select 1;
set statement wait_timeout=default for select 1;
--error ER_SET_STATEMENT_NOT_SUPPORTED
set statement interactive_timeout=default for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement default_master_connection='' for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement debug_sync='RESET' for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement gtid_domain_id=1 for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement last_insert_id=1 for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement log_slow_filter=2 for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement log_slow_rate_limit=1.1 for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement log_slow_rate_limit=1.1 for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement log_slow_verbosity=2 for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement long_query_time=2 for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement min_examined_row_limit=65535 for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement profiling=ON for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement rand_seed1=1 for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement rand_seed2=1 for select 1;
+--error ER_SET_STATEMENT_NOT_SUPPORTED
+set statement slow_query_log='OFF' for select 1;
# MDEV-6996: SET STATEMENT default_week_format = .. has no effect
set @save_week_format=@@default_week_format;
@@ -1128,7 +1191,10 @@ let $1=10;
while ($1)
{
--disable_result_log
- set statement rand_seed1=1, rand_seed2=1 for select 1;
+ set @old_rand_seed1= @@rand_seed1, @old_rand_seed2=@@rand_seed2;
+ set @@rand_seed1=1, @@rand_seed2=1;
+ select 1;
+ set @@rand_seed1=@old_rand_seed1, @@rand_seed2=@old_rand_seed2;
--enable_result_log
set @rnd= rand()=0 and @rnd;
dec $1;
diff --git a/mysql-test/t/set_statement_notembedded_binlog.test b/mysql-test/t/set_statement_notembedded_binlog.test
index b0c00008d4f..e58da080429 100644
--- a/mysql-test/t/set_statement_notembedded_binlog.test
+++ b/mysql-test/t/set_statement_notembedded_binlog.test
@@ -15,7 +15,10 @@ reset master;
create table t1 (i int);
set gtid_domain_id = 10;
insert into t1 values (1),(2);
-set statement gtid_domain_id = 20 for insert into t1 values (3),(4);
+set @old_gtid_domain_id= @@gtid_domain_id;
+set @@gtid_domain_id= 20;
+insert into t1 values (3),(4);
+set @@gtid_domain_id= @old_gtid_domain_id;
--replace_column 1 x 2 x 3 x 4 x 5 x
show binlog events limit 5,5;
@@ -32,8 +35,11 @@ insert into t2 values (1),(2);
DELIMITER |;
CREATE function f1() returns int
BEGIN
- SET STATEMENT last_insert_id=@a for insert into t1 values (NULL, @a,
- last_insert_id());
+ declare old_last_insert_id int;
+ set old_last_insert_id= @@last_insert_id;
+ set last_insert_id= @a;
+ insert into t1 values (NULL, @a, last_insert_id());
+ set @@last_insert_id= old_last_insert_id;
SET @a:=@a*100+13;
return @a;
end|
@@ -82,7 +88,10 @@ drop function f1;
drop table t1,t2;
reset master;
-set statement last_insert_id = 112 for create table t1 as select last_insert_id();
+set @old_last_insert_id= @@last_insert_id;
+set @@last_insert_id= 112;
+create table t1 as select last_insert_id();
+set @@last_insert_id= @old_last_insert_id;
--replace_column 1 x 2 x 3 x 4 x 5 x
show binlog events limit 4,1;
drop table t1;
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc
index ee862e4936e..7a7f8179450 100644
--- a/sql/sys_vars.cc
+++ b/sql/sys_vars.cc
@@ -1109,7 +1109,7 @@ static bool check_master_connection(sys_var *self, THD *thd, set_var *var)
static Sys_var_session_lexstring Sys_default_master_connection(
"default_master_connection",
"Master connection to use for all slave variables and slave commands",
- SESSION_ONLY(default_master_connection),
+ NO_SET_STMT SESSION_ONLY(default_master_connection),
NO_CMD_LINE, IN_SYSTEM_CHARSET,
DEFAULT(""), MAX_CONNECTION_NAME, ON_CHECK(check_master_connection));
#endif
@@ -1319,7 +1319,7 @@ static Sys_var_double Sys_long_query_time(
"Log all queries that have taken more than long_query_time seconds "
"to execute to the slow query log file. The argument will be treated "
"as a decimal value with microsecond precision",
- SESSION_VAR(long_query_time_double),
+ NO_SET_STMT SESSION_VAR(long_query_time_double),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, LONG_TIMEOUT), DEFAULT(10),
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
ON_UPDATE(update_cached_long_query_time));
@@ -1578,7 +1578,7 @@ static Sys_var_uint Sys_gtid_domain_id(
"parallel paths (for example multiple masters), each independent "
"source server must use a distinct domain_id. For simple tree-shaped "
"replication topologies, it can be left at its default, 0.",
- SESSION_VAR(gtid_domain_id),
+ NO_SET_STMT SESSION_VAR(gtid_domain_id),
CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, UINT_MAX32), DEFAULT(0),
BLOCK_SIZE(1), NO_MUTEX_GUARD, NOT_IN_BINLOG,
ON_CHECK(check_gtid_domain_id));
@@ -2274,7 +2274,7 @@ static Sys_var_ulong Sys_min_examined_row_limit(
"min_examined_row_limit",
"Don't write queries to slow log that examine fewer rows "
"than that",
- SESSION_VAR(min_examined_row_limit), CMD_LINE(REQUIRED_ARG),
+ NO_SET_STMT SESSION_VAR(min_examined_row_limit), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(0, UINT_MAX), DEFAULT(0), BLOCK_SIZE(1));
#ifdef _WIN32
@@ -4030,7 +4030,7 @@ static ulonglong read_last_insert_id(THD *thd)
}
static Sys_var_session_special Sys_last_insert_id(
"last_insert_id", "The value to be returned from LAST_INSERT_ID()",
- sys_var::ONLY_SESSION, NO_CMD_LINE,
+ NO_SET_STMT sys_var::ONLY_SESSION, NO_CMD_LINE,
VALID_RANGE(0, ULONGLONG_MAX), BLOCK_SIZE(1),
NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0),
ON_UPDATE(update_last_insert_id), ON_READ(read_last_insert_id));
@@ -4108,7 +4108,7 @@ static ulonglong read_rand_seed1(THD *thd)
static Sys_var_session_special Sys_rand_seed1(
"rand_seed1", "Sets the internal state of the RAND() "
"generator for replication purposes",
- sys_var::ONLY_SESSION, NO_CMD_LINE,
+ NO_SET_STMT sys_var::ONLY_SESSION, NO_CMD_LINE,
VALID_RANGE(0, ULONG_MAX), BLOCK_SIZE(1),
NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0),
ON_UPDATE(update_rand_seed1), ON_READ(read_rand_seed1));
@@ -4130,7 +4130,7 @@ static ulonglong read_rand_seed2(THD *thd)
static Sys_var_session_special Sys_rand_seed2(
"rand_seed2", "Sets the internal state of the RAND() "
"generator for replication purposes",
- sys_var::ONLY_SESSION, NO_CMD_LINE,
+ NO_SET_STMT sys_var::ONLY_SESSION, NO_CMD_LINE,
VALID_RANGE(0, ULONG_MAX), BLOCK_SIZE(1),
NO_MUTEX_GUARD, IN_BINLOG, ON_CHECK(0),
ON_UPDATE(update_rand_seed2), ON_READ(read_rand_seed2));
@@ -4416,7 +4416,7 @@ static Sys_var_mybool Sys_slow_query_log(
"Log slow queries to a table or log file. Defaults logging to a file "
"'hostname'-slow.log or a table mysql.slow_log if --log-output=TABLE is "
"used. Must be enabled to activate other slow log options.",
- SESSION_VAR(sql_log_slow), CMD_LINE(OPT_ARG),
+ NO_SET_STMT SESSION_VAR(sql_log_slow), CMD_LINE(OPT_ARG),
DEFAULT(FALSE), NO_MUTEX_GUARD, NOT_IN_BINLOG,
ON_CHECK(0), ON_UPDATE(fix_log_state));
@@ -5423,7 +5423,7 @@ static const char *log_slow_filter_names[]=
static Sys_var_set Sys_log_slow_filter(
"log_slow_filter",
"Log only certain types of queries",
- SESSION_VAR(log_slow_filter), CMD_LINE(REQUIRED_ARG),
+ NO_SET_STMT SESSION_VAR(log_slow_filter), CMD_LINE(REQUIRED_ARG),
log_slow_filter_names,
DEFAULT(my_set_bits(array_elements(log_slow_filter_names)-1)));
@@ -5470,7 +5470,7 @@ static Sys_var_ulong Sys_log_slow_rate_limit(
"Write to slow log every #th slow query. Set to 1 to log everything. "
"Increase it to reduce the size of the slow or the performance impact "
"of slow logging",
- SESSION_VAR(log_slow_rate_limit), CMD_LINE(REQUIRED_ARG),
+ NO_SET_STMT SESSION_VAR(log_slow_rate_limit), CMD_LINE(REQUIRED_ARG),
VALID_RANGE(1, UINT_MAX), DEFAULT(1), BLOCK_SIZE(1));
static const char *log_slow_verbosity_names[]= { "innodb", "query_plan",
@@ -5478,7 +5478,7 @@ static const char *log_slow_verbosity_names[]= { "innodb", "query_plan",
static Sys_var_set Sys_log_slow_verbosity(
"log_slow_verbosity",
"Verbosity level for the slow log",
- SESSION_VAR(log_slow_verbosity), CMD_LINE(REQUIRED_ARG),
+ NO_SET_STMT SESSION_VAR(log_slow_verbosity), CMD_LINE(REQUIRED_ARG),
log_slow_verbosity_names, DEFAULT(LOG_SLOW_VERBOSITY_INIT));
static Sys_var_ulong Sys_join_cache_level(