Commit 8707f172 authored by Sergei Petrunia's avatar Sergei Petrunia

Merge 10.1 into bb-10.1-mdev6657

parents c945233a bf30585e
......@@ -74,7 +74,7 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 index_merge i1,i2 i1,i2 4,4 NULL 17 Using sort_union(i1,i2); Using where
explain select * from t0 where key2 = 45 or key1 <=> null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 range i1,i2 i2 4 NULL 1 Using where
1 SIMPLE t0 range i1,i2 i2 4 NULL 1 Using index condition
explain select * from t0 where key2 = 45 or key1 is not null;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t0 ALL i1,i2 NULL NULL NULL 1024 Using where
......
......@@ -1002,7 +1002,7 @@ insert into t2 (b) values (null), (null), (null);
set optimizer_switch='extended_keys=on';
explain select a from t1 where b is null order by a desc limit 2;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref b b 9 const 2 Using where; Using filesort
1 SIMPLE t1 index b PRIMARY 8 NULL 3 Using where
select a from t1 where b is null order by a desc limit 2;
a
3
......
......@@ -2090,10 +2090,10 @@ SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a
WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ref PRIMARY,idx idx 4 const 2 100.00 Using where; Using filesort
1 SIMPLE t1 ref PRIMARY,idx idx 4 const 2 100.00 Using where
1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00
Warnings:
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (((`test`.`t1`.`pk` between 5 and 6) and isnull(`test`.`t1`.`b`)) or (`test`.`t1`.`b` = 5))) order by `test`.`t1`.`b`
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` = 5)) order by `test`.`t1`.`b`
SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a
WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b;
......
......@@ -2101,10 +2101,10 @@ SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a
WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t1 ref PRIMARY,idx idx 4 const 2 100.00 Using where; Using filesort
1 SIMPLE t1 ref PRIMARY,idx idx 4 const 2 100.00 Using where
1 SIMPLE t2 ref c c 5 test.t1.a 2 100.00
Warnings:
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (((`test`.`t1`.`pk` between 5 and 6) and isnull(`test`.`t1`.`b`)) or (`test`.`t1`.`b` = 5))) order by `test`.`t1`.`b`
Note 1003 select `test`.`t1`.`b` AS `b`,`test`.`t2`.`c` AS `c`,`test`.`t2`.`d` AS `d` from `test`.`t2` join `test`.`t1` where ((`test`.`t2`.`c` = `test`.`t1`.`a`) and (`test`.`t1`.`b` = 5)) order by `test`.`t1`.`b`
SELECT t1.b, t2.c, t2.d FROM t2 LEFT JOIN t1 ON t2.c = t1.a
WHERE t1.pk BETWEEN 5 AND 6 AND t1.b IS NULL OR t1.b = 5
ORDER BY t1.b;
......
......@@ -2949,3 +2949,39 @@ explain update t1 set key1=key1+1 where key1 between 10 and 110 order by key1 li
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range key1 key1 5 NULL 2 Using where; Using buffer
drop table t1,t2;
#
# MDEV-465: Optimizer : wrong index choice, leading to strong performances issues
#
CREATE TABLE t1 (
id1 int(10) unsigned NOT NULL auto_increment,
id2 tinyint(3) unsigned NOT NULL default '0',
id3 tinyint(3) unsigned NOT NULL default '0',
id4 int(10) unsigned NOT NULL default '0',
date timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (id1),
KEY id_234_date (id2,id3,id4,date),
KEY id_23_date (id2,id3,date)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
# t1 has "bad" index declaration order..
CREATE TABLE t2 (
id1 int(10) unsigned NOT NULL auto_increment,
id2 tinyint(3) unsigned NOT NULL default '0',
id3 tinyint(3) unsigned NOT NULL default '0',
id4 int(10) unsigned NOT NULL default '0',
date timestamp NOT NULL default CURRENT_TIMESTAMP,
PRIMARY KEY (id1),
KEY id_23_date (id2,id3,date),
KEY id_234_date (id2,id3,id4,date)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
# t2 has a "good" index declaration order
INSERT INTO t1 (id2,id3,id4) VALUES (1,1,1),(1,1,1),(1,1,1),(1,1,1),(1,0,1),(1,2,1),(1,3,1);
INSERT INTO t2 (id2,id3,id4) VALUES (1,1,1),(1,1,1),(1,1,1),(1,1,1),(1,0,1),(1,2,1),(1,3,1);
# The following two must both use id_23_date and no "using filesort":
EXPLAIN SELECT id1 FROM t1 WHERE id2=1 AND id3=1 ORDER BY date DESC LIMIT 0,4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range id_234_date,id_23_date id_23_date 2 NULL 3 Using where
# See above query
EXPLAIN SELECT id1 FROM t2 WHERE id2=1 AND id3=1 ORDER BY date DESC LIMIT 0,4;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ref id_23_date,id_234_date id_23_date 2 const,const 3 Using where
drop table t1,t2;
......@@ -2196,3 +2196,48 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t2 range a a 5 NULL 1 Using where; Using index
drop table t1,t2,t3;
#
# MDEV-6480: Remove conditions for which range optimizer returned SEL_ARG::IMPOSSIBLE.
#
create table t1(a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 (a int, b int, c int, key(a), key(b));
insert into t2
select
A.a + B.a* 10 + C.a * 100,
A.a + B.a* 10 + C.a * 100,
12345
from
t1 A, t1 B, t1 C;
# EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE:
explain extended select * from t2 where (b > 25 and b < 15) or a<44;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 range a,b a 5 NULL 43 100.00 Using index condition
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`a` < 44)
# EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE:
explain extended select * from t2 where a < 44 or (b > 25 and b < 15);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 range a,b a 5 NULL 43 100.00 Using index condition
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`a` < 44)
# Here, conditions b will not be removed, because "c<44" is not sargable
# and hence (b.. and .. b) part is not analyzed at all:
explain extended select * from t2 where c < 44 or (b > 25 and b < 15);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL b NULL NULL NULL 1000 100.00 Using where
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` < 44) or ((`test`.`t2`.`b` > 25) and (`test`.`t2`.`b` < 15)))
# EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE:
explain extended select * from t2 where (b > 25 and b < 15) or c < 44;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL b NULL NULL NULL 1000 100.00 Using where
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` < 44))
# Try a case where both OR parts produce SEL_ARG::IMPOSSIBLE:
explain extended select * from t2 where (b > 25 and b < 15) or (a>55 and a<44);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where 0
drop table t1,t2;
......@@ -2198,4 +2198,49 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t3 const PRIMARY PRIMARY 4 const 1
1 SIMPLE t2 range a a 5 NULL 1 Using where; Using index
drop table t1,t2,t3;
#
# MDEV-6480: Remove conditions for which range optimizer returned SEL_ARG::IMPOSSIBLE.
#
create table t1(a int);
insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t2 (a int, b int, c int, key(a), key(b));
insert into t2
select
A.a + B.a* 10 + C.a * 100,
A.a + B.a* 10 + C.a * 100,
12345
from
t1 A, t1 B, t1 C;
# EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE:
explain extended select * from t2 where (b > 25 and b < 15) or a<44;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 range a,b a 5 NULL 43 100.00 Using index condition; Rowid-ordered scan
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`a` < 44)
# EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE:
explain extended select * from t2 where a < 44 or (b > 25 and b < 15);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 range a,b a 5 NULL 43 100.00 Using index condition; Rowid-ordered scan
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where (`test`.`t2`.`a` < 44)
# Here, conditions b will not be removed, because "c<44" is not sargable
# and hence (b.. and .. b) part is not analyzed at all:
explain extended select * from t2 where c < 44 or (b > 25 and b < 15);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL b NULL NULL NULL 1000 100.00 Using where
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` < 44) or ((`test`.`t2`.`b` > 25) and (`test`.`t2`.`b` < 15)))
# EXPLAIN EXTENDED should show that 'b > 25 and b < 15' is removed from the WHERE:
explain extended select * from t2 where (b > 25 and b < 15) or c < 44;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL b NULL NULL NULL 1000 100.00 Using where
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where ((`test`.`t2`.`c` < 44))
# Try a case where both OR parts produce SEL_ARG::IMPOSSIBLE:
explain extended select * from t2 where (b > 25 and b < 15) or (a>55 and a<44);
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where 0
drop table t1,t2;
set optimizer_switch=@mrr_icp_extra_tmp;
......@@ -11,19 +11,19 @@ drop table t1;
show binlog events in 'master-bin.000001' from 313;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 313 Gtid 1 351 GTID 0-1-1
master-bin.000001 351 Query 1 465 use `test`; DROP TABLE IF EXISTS `t1`
master-bin.000001 351 Query 1 465 use `test`; DROP TABLE IF EXISTS `t1` /* generated by server */
master-bin.000001 465 Gtid 1 503 GTID 0-1-2
master-bin.000001 503 Query 1 669 use `test`; create table t1(a int not null primary key auto_increment, b varchar(256), key second(b)) engine=innodb
master-bin.000001 669 Gtid 1 707 BEGIN GTID 0-1-3
master-bin.000001 707 Table_map 1 751 table_id: 82 (test.t1)
master-bin.000001 751 Write_rows_v1 1 1043 table_id: 82 flags: STMT_END_F
master-bin.000001 1043 Xid 1 1070 COMMIT
master-bin.000001 707 Table_map 1 751 table_id: # (test.t1)
master-bin.000001 751 Write_rows_v1 1 1043 table_id: # flags: STMT_END_F
master-bin.000001 1043 Xid 1 1070 COMMIT /* XID */
master-bin.000001 1070 Gtid 1 1108 BEGIN GTID 0-1-4
master-bin.000001 1108 Table_map 1 1152 table_id: 82 (test.t1)
master-bin.000001 1152 Write_rows_v1 1 1444 table_id: 82 flags: STMT_END_F
master-bin.000001 1444 Xid 1 1471 COMMIT
master-bin.000001 1108 Table_map 1 1152 table_id: # (test.t1)
master-bin.000001 1152 Write_rows_v1 1 1444 table_id: # flags: STMT_END_F
master-bin.000001 1444 Xid 1 1471 COMMIT /* XID */
master-bin.000001 1471 Gtid 1 1509 GTID 0-1-5
master-bin.000001 1509 Query 1 1589 use `test`; optimize table t1
master-bin.000001 1589 Gtid 1 1627 GTID 0-1-6
master-bin.000001 1627 Query 1 1731 use `test`; DROP TABLE `t1`
master-bin.000001 1627 Query 1 1731 use `test`; DROP TABLE `t1` /* generated by server */
include/rpl_end.inc
......@@ -18,14 +18,26 @@ INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
# Not enough page splits to trigger persistent stats write yet.
select count(*) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split', 'n_leaf_pages_defrag');
count(*)
0
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
count(stat_value) = 0
1
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) = 0
1
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) = 0
1
INSERT INTO t1 (b) SELECT b from t1;
# Persistent stats recorded.
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split', 'n_leaf_pages_defrag');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
count(stat_value) > 0
0
1
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) = 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) > 0
1
# Delete some rows.
delete from t1 where a between 100 * 20 and 100 * 20 + 30;
delete from t1 where a between 100 * 19 and 100 * 19 + 30;
......@@ -49,46 +61,115 @@ delete from t1 where a between 100 * 2 and 100 * 2 + 30;
delete from t1 where a between 100 * 1 and 100 * 1 + 30;
# Server Restarted
# Confirm persistent stats still there after restart.
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split', 'n_leaf_pages_defrag');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
count(stat_value) > 0
0
1
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) = 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) > 0
1
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
# n_page_split should be 0 after defragmentation, n_pages_freed should be non-zero.
select stat_value = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
stat_value = 0
select sleep(2);
sleep(2)
0
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
count(stat_value) > 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) > 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed', 'n_leaf_pages_defrag');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) > 0
1
set global innodb_defragment_stats_accuracy = 40;
INSERT INTO t1 (b) SELECT b from t1;
# Not enough operation to trigger persistent stats write
select stat_value = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
stat_value = 0
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
count(stat_value) > 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) > 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) > 0
1
INSERT INTO t1 (b) SELECT b from t1;
# Persistent stats write triggered
select stat_value > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
stat_value > 0
0
0
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
count(stat_value) > 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) > 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) > 0
1
# Table rename should cause stats rename.
rename table t1 to t2;
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed', 'n_page_split', 'n_leaf_pages_defrag');
select sleep(1);
sleep(1)
0
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
count(stat_value) = 0
1
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) = 0
1
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) = 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
count(stat_value) > 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
count(stat_value) > 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) > 0
1
# Drop index should cause stats drop.
drop index SECOND on t2;
select count(*) from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND';
count(*)
4
select sleep(3);
sleep(3)
0
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_page_split');
count(stat_value) > 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_pages_freed');
count(stat_value) > 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) > 0
1
Server Restarted
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed', 'n_page_split', 'n_leaf_pages_defrag');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
count(stat_value) = 0
1
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) = 0
1
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) = 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
count(stat_value) > 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
count(stat_value) > 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) > 0
1
# Clean up
DROP TABLE t2;
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
count(stat_value) = 0
1
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
count(stat_value) = 0
1
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) = 0
1
......@@ -17,65 +17,109 @@ set @i = 0;
repeat
set @i = @i + 1;
optimize table t1;
select sleep(5);
until @i = 3 end repeat;
end //
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) = 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
count(stat_value) > 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) > 0
1
select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value)
0
select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
count(stat_value)
2
select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value)
2
select count(*) from t1;
count(*)
10004
select count(*) from t1 force index (second);
count(*)
10004
call defragment();
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
select sleep(5);
sleep(5)
0
select count(*) from t1;
count(*)
7904
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed', 'n_page_split', 'n_leaf_pages_defrag');
count(stat_value) > 0
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) = 0
0
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
count(stat_value) > 0
1
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) > 0
1
select count(*) from t1 force index (second);
count(*)
7904
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
count(stat_value) = 0
1
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
count(stat_value) = 0
1
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) = 0
1
SET @@global.innodb_defragment_n_pages = 3;
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed', 'n_page_split', 'n_leaf_pages_defrag');
count(stat_value) > 0
0
select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) < 3
1
select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
count(stat_value) < 3
1
select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) < 3
1
select count(*) from t1;
count(*)
6904
select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) < 3
1
select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
count(stat_value) < 3
1
select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) < 3
1
select count(*) from t1 force index (second);
count(*)
6904
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
count(stat_value) = 0
1
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
count(stat_value) = 0
1
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) = 0
1
SET @@global.innodb_defragment_n_pages = 10;
optimize table t1;
Table Op Msg_type Msg_text
test.t1 optimize status OK
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed', 'n_page_split', 'n_leaf_pages_defrag');
count(stat_value) > 0
0
select count(*) from t1;
count(*)
6904
select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
count(stat_value) > 1
1
select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
count(stat_value) > 1
1
select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) > 1
1
select count(*) from t1 force index (second);
count(*)
6904
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
count(stat_value) = 0
1
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
count(stat_value) = 0
1
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
count(stat_value) = 0
1
DROP PROCEDURE defragment;
DROP TABLE t1;
......@@ -14,13 +14,14 @@ count(*)
# A few more insertions on the page should not cause a page split.
insert into t1 values (81, REPEAT('A', 256));
insert into t1 values (83, REPEAT('A', 256));
# More insertions will cause page splits
insert into t1 values (88, REPEAT('A', 50));
insert into t1 values (85, REPEAT('A', 256));
insert into t1 values (84, REPEAT('A', 256));
insert into t1 values (87, REPEAT('A', 256));
insert into t1 values (89, REPEAT('A', 256));
insert into t1 values (82, REPEAT('A', 256));
insert into t1 values (86, REPEAT('A', 256));
# More insertions will cause page splits
insert into t1 values (88, REPEAT('A', 50));
Too much space are reserved on primary index.
Too much space are reserved on second index.
DROP TABLE t1;
Testing table with small records
CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARchar(16), KEY SECOND(a,b)) ENGINE=INNODB;
......@@ -48,12 +49,16 @@ insert into t2 values(1197, REPEAT('A', 16));
insert into t2 values(1188, REPEAT('A', 16));
insert into t2 values(1198, REPEAT('A', 16));
insert into t2 values(1189, REPEAT('A', 16));
insert into t2 values(1199, REPEAT('A', 16));
insert into t2 values(1190, REPEAT('A', 16));
insert into t2 values(1180, REPEAT('A', 16));
More insertions will cause page split.
insert into t2 values(1280, REPEAT('A', 16));
insert into t2 values(1290, REPEAT('A', 16));
insert into t2 values(1281, REPEAT('A', 16));
insert into t2 values(1291, REPEAT('A', 16));
insert into t2 values(1199, REPEAT('A', 16));
insert into t2 values(1190, REPEAT('A', 16));
insert into t2 values(1180, REPEAT('A', 16));
insert into t2 values(1295, REPEAT('A', 16));
insert into t2 values(1294, REPEAT('A', 16));
insert into t2 values(1292, REPEAT('A', 16));
insert into t2 values(1293, REPEAT('A', 16));
DROP TABLE t2;
--source include/have_innodb.inc
--source include/master-slave.inc
--source include/big_test.inc
--source include/not_valgrind.inc
--source include/not_embedded.inc
--disable_warnings
drop table if exists t1;
......@@ -13,7 +16,7 @@ optimize table t1;
drop table t1;
--replace_regex /\/\*.*//
--replace_regex /\/\* xid=.* \*\//\/* XID *\// /Server ver: .*, Binlog ver: .*/Server ver: #, Binlog ver: #/ /table_id: [0-9]+/table_id: #/
show binlog events in 'master-bin.000001' from 313;
--source include/rpl_end.inc
--source include/have_innodb.inc
--source include/big_test.inc
--source include/not_valgrind.inc
--source include/not_embedded.inc
--disable_warnings
DROP TABLE if exists t1;
......
--source include/have_innodb.inc
--source include/big_test.inc
--source include/not_valgrind.inc
--source include/not_embedded.inc
--disable_warnings
DROP TABLE if exists t1;
......@@ -29,12 +31,16 @@ INSERT INTO t1 (b) SELECT b from t1;
INSERT INTO t1 (b) SELECT b from t1;
--echo # Not enough page splits to trigger persistent stats write yet.
select count(*) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split', 'n_leaf_pages_defrag');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
INSERT INTO t1 (b) SELECT b from t1;
--echo # Persistent stats recorded.
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split', 'n_leaf_pages_defrag');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
--echo # Delete some rows.
let $num_delete = 20;
......@@ -49,39 +55,71 @@ while ($num_delete)
--echo # Server Restarted
--echo # Confirm persistent stats still there after restart.
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split', 'n_leaf_pages_defrag');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
optimize table t1;
--echo # n_page_split should be 0 after defragmentation, n_pages_freed should be non-zero.
select stat_value = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed', 'n_leaf_pages_defrag');
select sleep(2);
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
set global innodb_defragment_stats_accuracy = 40;
INSERT INTO t1 (b) SELECT b from t1;
--echo # Not enough operation to trigger persistent stats write
select stat_value = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
INSERT INTO t1 (b) SELECT b from t1;
--echo # Persistent stats write triggered
select stat_value > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name = 'n_page_split';
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
--echo # Table rename should cause stats rename.
rename table t1 to t2;
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed', 'n_page_split', 'n_leaf_pages_defrag');
select sleep(1);
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
--echo # Drop index should cause stats drop.
drop index SECOND on t2;
select count(*) from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND';
select sleep(3);
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_page_split');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_pages_freed');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and index_name = 'SECOND' and stat_name in ('n_leaf_pages_defrag');
--source include/restart_mysqld.inc
--echo Server Restarted
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed', 'n_page_split', 'n_leaf_pages_defrag');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
--echo # Clean up
DROP TABLE t2;
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_page_split');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_leaf_pages_defrag');
--disable_query_log
EVAL SET GLOBAL innodb_defragment_stats_accuracy = $innodb_defragment_stats_accuracy_orig;
--enable_query_log
--source include/have_innodb.inc
--source include/big_test.inc
--source include/not_valgrind.inc
--source include/not_embedded.inc
--disable_warnings
DROP TABLE if exists t1;
......
--source include/have_innodb.inc
--source include/big_test.inc
--source include/not_valgrind.inc
--source include/not_embedded.inc
--disable_warnings
DROP TABLE if exists t1;
......@@ -36,7 +39,6 @@ begin
repeat
set @i = @i + 1;
optimize table t1;
select sleep(5);
until @i = 3 end repeat;
end //
delimiter ;//
......@@ -53,25 +55,12 @@ while ($i)
}
--enable_query_log
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
select count(stat_value) from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
select count(*) from t1;
if (!`select count(*) > 180 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY' order by page_number;`)
{
select count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY' order by page_number;
}
select count(*) from t1 force index (second);
if (!`select count(*) > 170 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second' order by page_number;`)
{
select count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second' order by page_number;
}
connect (con1,localhost,root,,test,$MASTER_MYPORT,$MASTER_MYSOCK);
connection con1;
......@@ -98,26 +87,19 @@ connection default;
disconnect con1;
optimize table t1;
select sleep(5);
--source include/restart_mysqld.inc
select count(*) from t1;
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed', 'n_page_split', 'n_leaf_pages_defrag');
# After deletion & defragmentation, there are 8000 records left
if (!`select count(*) < 180 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY' order by page_number;`)
{
select count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY' order by page_number;
}
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
select count(*) from t1 force index (second);
# secondary index is pretty much the same size as primary index so the number of pages should be similar.
if (!`select count(*) < 180 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second' order by page_number;`)
{
select count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second' order by page_number;
}
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
## Test-4 defragment with larger n_pages
......@@ -139,23 +121,25 @@ optimize table t1;
--source include/restart_mysqld.inc
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed', 'n_page_split', 'n_leaf_pages_defrag');
select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
select count(*) from t1;
# We didn't create large wholes with the previous deletion, so if innodb_defragment_n_pages = 3, we won't be able to free up many pages.
if (!`select count(*) > 130 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY' order by page_number;`)
{
select count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY' order by page_number;
}
select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
select count(stat_value) < 3 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
select count(*) from t1 force index (second);
# Same holds for secondary index, not many pages are released.
if (!`select count(*) > 100 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second' order by page_number;`)
{
select count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second' order by page_number;
}
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
SET @@global.innodb_defragment_n_pages = 10;
......@@ -163,25 +147,21 @@ optimize table t1;
--source include/restart_mysqld.inc
select count(stat_value) > 0 from mysql.innodb_index_stats where table_name like '%t2%' and stat_name in ('n_pages_freed', 'n_page_split', 'n_leaf_pages_defrag');
select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_pages_freed');
select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_page_split');
select count(stat_value) > 1 from mysql.innodb_index_stats where table_name like '%t1%' and stat_name in ('n_leaf_pages_defrag');
select count(*) from t1;
# This time we used innodb_defragment_n_pages = 10, so we should be able to free up some pages.
if (!`select count(*) < 165 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY' order by page_number;`)
{
select count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY' order by page_number;
}
select count(*) from t1 force index (second);
if (!`select count(*) < 165 from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second' order by page_number;`)
{
select count(*) from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second' order by page_number;
}
# Same holds for secondary index, not many pages are released.
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_pages_freed');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_page_split');
select count(stat_value) = 0 from mysql.innodb_index_stats where table_name like '%t1%' and index_name = 'second' and stat_name in ('n_leaf_pages_defrag');
DROP PROCEDURE defragment;
DROP TABLE t1;
# reset system
--disable_query_log
EVAL SET GLOBAL innodb_defragment_n_pages = $innodb_defragment_n_pages_orig;
......
--source include/have_innodb.inc
--source include/big_test.inc
--source include/not_valgrind.inc
--source include/not_embedded.inc
--disable_warnings
DROP TABLE if exists t1;
DROP TABLE if exists t2;
......@@ -34,34 +38,44 @@ select count(*) from t1;
select count(*) from t1 force index (second);
# secondary index is slightly bigger than primary index so the number of pages should be similar.
--let $second_before = query_get_value(select count(*) as Value from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second', Value, 1)
--echo # A few more insertions on the page should not cause a page split.
insert into t1 values (81, REPEAT('A', 256));
insert into t1 values (83, REPEAT('A', 256));
insert into t1 values (87, REPEAT('A', 256));
insert into t1 values (82, REPEAT('A', 256));
insert into t1 values (86, REPEAT('A', 256));
--let $primary_after = query_get_value(select count(*) as Value from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY', Value, 1)
--let $second_after = query_get_value(select count(*) as Value from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second', Value, 1)
if ($primary_before != $primary_after) {
--echo Insertion caused page split on primary, which should be avoided by innodb_defragment_fill_factor.
}
if ($second_before != $second_after) {
--echo Insertion caused page split on second, which should be avoided by innodb_defragment_fill_factor.
}
--echo # More insertions will cause page splits
insert into t1 values (88, REPEAT('A', 50));
#insert into t1 values (85, REPEAT('A', 256));
#insert into t1 values (84, REPEAT('A', 256));
#insert into t1 values (89, REPEAT('A', 256));
insert into t1 values (85, REPEAT('A', 256));
insert into t1 values (84, REPEAT('A', 256));
insert into t1 values (87, REPEAT('A', 256));
insert into t1 values (89, REPEAT('A', 256));
insert into t1 values (82, REPEAT('A', 256));
insert into t1 values (86, REPEAT('A', 256));
--let $primary_after = query_get_value(select count(*) as Value from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'PRIMARY', Value, 1)
--let $second_after = query_get_value(select count(*) as Value from information_schema.innodb_buffer_page where table_name like '%t1%' and index_name = 'second', Value, 1)
if ($primary_before == $primary_after) {
--echo Too much space are reserved on primary index.
}
if ($second_before == $second_after) {
--echo Too much space are reserved on second index.
}
DROP TABLE t1;
--echo Testing table with small records
CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARchar(16), KEY SECOND(a,b)) ENGINE=INNODB;
# Populate table.
......@@ -111,20 +125,30 @@ insert into t2 values(1197, REPEAT('A', 16));
insert into t2 values(1188, REPEAT('A', 16));
insert into t2 values(1198, REPEAT('A', 16));
insert into t2 values(1189, REPEAT('A', 16));
insert into t2 values(1199, REPEAT('A', 16));
insert into t2 values(1190, REPEAT('A', 16));
insert into t2 values(1180, REPEAT('A', 16));
--let $second_after = query_get_value(select count(*) as Value from information_schema.innodb_buffer_page where table_name like '%t2%' and index_name = 'second', Value, 1)
if ($second_before != $second_after) {
--echo Insertion caused page split on second, which should be avoided by innodb_defragment_fill_factor.
}
--echo More insertions will cause page split.
insert into t2 values(1280, REPEAT('A', 16));
insert into t2 values(1290, REPEAT('A', 16));
insert into t2 values(1281, REPEAT('A', 16));
insert into t2 values(1291, REPEAT('A', 16));
insert into t2 values(1199, REPEAT('A', 16));
insert into t2 values(1190, REPEAT('A', 16));
insert into t2 values(1180, REPEAT('A', 16));
insert into t2 values(1295, REPEAT('A', 16));
insert into t2 values(1294, REPEAT('A', 16));
insert into t2 values(1292, REPEAT('A', 16));
insert into t2 values(1293, REPEAT('A', 16));
--let $second_after = query_get_value(select count(*) as Value from information_schema.innodb_buffer_page where table_name like '%t2%' and index_name = 'second', Value, 1)
if ($second_before == $second_after) {
--echo Too much space are reserved on second index.
}
DROP TABLE t2;
......@@ -11,7 +11,6 @@ username event_name sql_text
user1 statement/sql/select select test.f1()
username event_name nesting_event_type
username event_name nesting_event_type
user1 stage/sql/optimizing STATEMENT
user1 stage/sql/executing STATEMENT
user1 stage/sql/Opening tables STATEMENT
user1 stage/sql/After opening tables STATEMENT
......@@ -19,6 +18,7 @@ user1 stage/sql/closing tables STATEMENT
user1 stage/sql/end STATEMENT
user1 stage/sql/query end STATEMENT
user1 stage/sql/closing tables STATEMENT
user1 stage/sql/Unlocking tables STATEMENT
user1 stage/sql/freeing items STATEMENT
user1 stage/sql/cleaning up STATEMENT
call dump_one_thread('user2');
......
......@@ -18,7 +18,6 @@ username event_name sql_text
user1 statement/sql/select select test.f1()
username event_name nesting_event_type
username event_name nesting_event_type
user1 stage/sql/query end STATEMENT
user1 stage/sql/closing tables STATEMENT
user1 stage/sql/Opening tables STATEMENT
user1 stage/sql/After opening tables STATEMENT
......@@ -26,6 +25,7 @@ user1 stage/sql/closing tables STATEMENT
user1 stage/sql/end STATEMENT
user1 stage/sql/query end STATEMENT
user1 stage/sql/closing tables STATEMENT
user1 stage/sql/Unlocking tables STATEMENT
user1 stage/sql/freeing items STATEMENT
user1 stage/sql/cleaning up STATEMENT
call dump_one_thread('user2');
......
......@@ -13,7 +13,6 @@ username event_name sql_text
user1 statement/sql/select select * from test.t1 for update
username event_name nesting_event_type
username event_name nesting_event_type
user1 stage/sql/optimizing STATEMENT
user1 stage/sql/statistics STATEMENT
user1 stage/sql/preparing STATEMENT
user1 stage/sql/executing STATEMENT
......@@ -21,6 +20,7 @@ user1 stage/sql/Sending data STATEMENT
user1 stage/sql/end STATEMENT
user1 stage/sql/query end STATEMENT
user1 stage/sql/closing tables STATEMENT
user1 stage/sql/Unlocking tables STATEMENT
user1 stage/sql/freeing items STATEMENT
user1 stage/sql/cleaning up STATEMENT
call dump_one_thread('user2');
......
......@@ -21,17 +21,17 @@ Grants for user_a@localhost
GRANT role_a TO 'user_a'@'localhost'
GRANT USAGE ON *.* TO 'user_a'@'localhost'
GRANT SELECT ON *.* TO 'role_a'
select user, host, default_role from mysql.user where user like 'user_%';
select user, host, default_role from mysql.user where user like 'user_%' order by user;
user host default_role
user_a localhost role_a
user_b localhost role_b
set default role NONE for current_user;
select user, host, default_role from mysql.user where user like 'user_%';
select user, host, default_role from mysql.user where user like 'user_%' order by user;
user host default_role
user_a localhost
user_b localhost role_b
set default role current_role for current_user;
select user, host, default_role from mysql.user where user like 'user_%';
select user, host, default_role from mysql.user where user like 'user_%' order by user;
user host default_role
user_a localhost role_a
user_b localhost role_b
......@@ -42,7 +42,7 @@ Grants for user_b@localhost
GRANT role_b TO 'user_b'@'localhost'
GRANT USAGE ON *.* TO 'user_b'@'localhost'
GRANT INSERT, UPDATE ON *.* TO 'role_b'
select user, host, default_role from mysql.user where user like 'user_%';
select user, host, default_role from mysql.user where user like 'user_%' order by user;
ERROR 42000: SELECT command denied to user 'user_b'@'localhost' for table 'user'
insert into mysql.user (user, host) values ('someuser', 'somehost');
Warnings:
......@@ -56,10 +56,10 @@ Grants for user_a@localhost
GRANT role_a TO 'user_a'@'localhost'
GRANT USAGE ON *.* TO 'user_a'@'localhost'
GRANT INSERT, UPDATE ON *.* TO 'role_b'
select user, host, default_role from mysql.user where user like 'user_%';
select user, host, default_role from mysql.user where user like 'user_%' order by user;
ERROR 42000: SELECT command denied to user 'user_a'@'localhost' for table 'user'
drop role role_a;
drop role role_b;
delete from mysql.user where user = 'someuser' && host = 'somehost';
delete from mysql.user where user = 'someuser' && host = 'somehost' order by user;
drop user user_a@localhost;
drop user user_b@localhost;
......@@ -44,13 +44,13 @@ set default role role_b for user_b@localhost;
change_user 'user_a';
show grants;
select user, host, default_role from mysql.user where user like 'user_%';
select user, host, default_role from mysql.user where user like 'user_%' order by user;
set default role NONE for current_user;
select user, host, default_role from mysql.user where user like 'user_%';
select user, host, default_role from mysql.user where user like 'user_%' order by user;
set default role current_role for current_user;
select user, host, default_role from mysql.user where user like 'user_%';
select user, host, default_role from mysql.user where user like 'user_%' order by user;
# Make sure we can't set a default role not granted to us, using current_user
--error ER_INVALID_ROLE
......@@ -60,7 +60,7 @@ change_user 'user_b';
show grants;
--error ER_TABLEACCESS_DENIED_ERROR
select user, host, default_role from mysql.user where user like 'user_%';
select user, host, default_role from mysql.user where user like 'user_%' order by user;
# Make sure the default role setting worked from root.
insert into mysql.user (user, host) values ('someuser', 'somehost');
......@@ -73,12 +73,12 @@ change_user 'user_a';
# There is no default role set any more.
show grants;
--error ER_TABLEACCESS_DENIED_ERROR
select user, host, default_role from mysql.user where user like 'user_%';
select user, host, default_role from mysql.user where user like 'user_%' order by user;
change_user 'root';
drop role role_a;
drop role role_b;
delete from mysql.user where user = 'someuser' && host = 'somehost';
delete from mysql.user where user = 'someuser' && host = 'somehost' order by user;
drop user user_a@localhost;
drop user user_b@localhost;
set @start_value = @@wsrep_auto_increment_control;
set @@global.wsrep_auto_increment_control=ON;
set @@global.wsrep_auto_increment_control=OFF;
set @@global.wsrep_auto_increment_control=1;
set @@global.wsrep_auto_increment_control=0;
SET @@global.wsrep_auto_increment_control = -1;
ERROR 42000: Variable 'wsrep_auto_increment_control' can't be set to the value of '-1'
set @@global.wsrep_auto_increment_control = @start_value;
#
# wsrep_auto_increment_control
#
# save the initial value
SET @wsrep_auto_increment_control_global_saved = @@global.wsrep_auto_increment_control;
# default
SELECT @@global.wsrep_auto_increment_control;
@@global.wsrep_auto_increment_control
1
# scope
SELECT @@session.wsrep_auto_increment_control;
ERROR HY000: Variable 'wsrep_auto_increment_control' is a GLOBAL variable
SET @@global.wsrep_auto_increment_control=OFF;
SELECT @@global.wsrep_auto_increment_control;
@@global.wsrep_auto_increment_control
0
SET @@global.wsrep_auto_increment_control=ON;
SELECT @@global.wsrep_auto_increment_control;
@@global.wsrep_auto_increment_control
1
# valid values
SET @@global.wsrep_auto_increment_control='OFF';
SELECT @@global.wsrep_auto_increment_control;
@@global.wsrep_auto_increment_control
0
SET @@global.wsrep_auto_increment_control=ON;
SELECT @@global.wsrep_auto_increment_control;
@@global.wsrep_auto_increment_control
1
SET @@global.wsrep_auto_increment_control=default;
SELECT @@global.wsrep_auto_increment_control;
@@global.wsrep_auto_increment_control
1
# invalid values
SET @@global.wsrep_auto_increment_control=NULL;
ERROR 42000: Variable 'wsrep_auto_increment_control' can't be set to the value of 'NULL'
SET @@global.wsrep_auto_increment_control='junk';
ERROR 42000: Variable 'wsrep_auto_increment_control' can't be set to the value of 'junk'
# restore the initial value
SET @@global.wsrep_auto_increment_control = @wsrep_auto_increment_control_global_saved;
# End of test
set @start_value = @@wsrep_causal_reads;
set @@global.wsrep_causal_reads=ON;
set @@global.wsrep_causal_reads=OFF;
set @@global.wsrep_causal_reads=1;
set @@global.wsrep_causal_reads=0;
SET @@global.wsrep_causal_reads = -1;
ERROR 42000: Variable 'wsrep_causal_reads' can't be set to the value of '-1'
set @@global.wsrep_causal_reads = @start_value;
#
# wsrep_causal_reads
#
# save the initial values
SET @wsrep_causal_reads_global_saved = @@global.wsrep_causal_reads;
SET @wsrep_causal_reads_session_saved = @@session.wsrep_causal_reads;
# default
SELECT @@global.wsrep_causal_reads;
@@global.wsrep_causal_reads
0
SELECT @@session.wsrep_causal_reads;
@@session.wsrep_causal_reads
0
# scope and valid values
SET @@global.wsrep_causal_reads=OFF;
SELECT @@global.wsrep_causal_reads;
@@global.wsrep_causal_reads
0
SET @@global.wsrep_causal_reads=ON;
SELECT @@global.wsrep_causal_reads;
@@global.wsrep_causal_reads
1
SET @@session.wsrep_causal_reads=OFF;
SELECT @@session.wsrep_causal_reads;
@@session.wsrep_causal_reads
0
SET @@session.wsrep_causal_reads=ON;
SELECT @@session.wsrep_causal_reads;
@@session.wsrep_causal_reads
1
SET @@session.wsrep_causal_reads=default;
SELECT @@session.wsrep_causal_reads;
@@session.wsrep_causal_reads
1
# invalid values
SET @@global.wsrep_causal_reads=NULL;
ERROR 42000: Variable 'wsrep_causal_reads' can't be set to the value of 'NULL'
SET @@global.wsrep_causal_reads='junk';
ERROR 42000: Variable 'wsrep_causal_reads' can't be set to the value of 'junk'
SET @@session.wsrep_causal_reads=NULL;
ERROR 42000: Variable 'wsrep_causal_reads' can't be set to the value of 'NULL'
SET @@session.wsrep_causal_reads='junk';
ERROR 42000: Variable 'wsrep_causal_reads' can't be set to the value of 'junk'
# restore the initial values
SET @@global.wsrep_causal_reads = @wsrep_causal_reads_global_saved;
SET @@session.wsrep_causal_reads = @wsrep_causal_reads_session_saved;
# End of test
set @start_value = @@wsrep_certify_nonpk;
set @@global.wsrep_certify_nonpk=ON;
set @@global.wsrep_certify_nonpk=OFF;
set @@global.wsrep_certify_nonpk=1;
set @@global.wsrep_certify_nonpk=0;
SET @@global.wsrep_certify_nonpk = -1;
ERROR 42000: Variable 'wsrep_certify_nonPK' can't be set to the value of '-1'
set @@global.wsrep_certify_nonpk = @start_value;
#
# wsrep_certify_nonpk
#
# save the initial value
SET @wsrep_certify_nonpk_global_saved = @@global.wsrep_certify_nonpk;
# default
SELECT @@global.wsrep_certify_nonpk;
@@global.wsrep_certify_nonpk
1
# scope
SELECT @@session.wsrep_certify_nonpk;
ERROR HY000: Variable 'wsrep_certify_nonPK' is a GLOBAL variable
SET @@global.wsrep_certify_nonpk=OFF;
SELECT @@global.wsrep_certify_nonpk;
@@global.wsrep_certify_nonpk
0
SET @@global.wsrep_certify_nonpk=ON;
SELECT @@global.wsrep_certify_nonpk;
@@global.wsrep_certify_nonpk
1
# valid values
SET @@global.wsrep_certify_nonpk='OFF';
SELECT @@global.wsrep_certify_nonpk;
@@global.wsrep_certify_nonpk
0
SET @@global.wsrep_certify_nonpk=ON;
SELECT @@global.wsrep_certify_nonpk;
@@global.wsrep_certify_nonpk
1
SET @@global.wsrep_certify_nonpk=default;
SELECT @@global.wsrep_certify_nonpk;
@@global.wsrep_certify_nonpk
1
# invalid values
SET @@global.wsrep_certify_nonpk=NULL;
ERROR 42000: Variable 'wsrep_certify_nonPK' can't be set to the value of 'NULL'
SET @@global.wsrep_certify_nonpk='junk';
ERROR 42000: Variable 'wsrep_certify_nonPK' can't be set to the value of 'junk'
# restore the initial value
SET @@global.wsrep_certify_nonpk = @wsrep_certify_nonpk_global_saved;
# End of test
SELECT COUNT(@@GLOBAL.wsrep_cluster_address);
COUNT(@@GLOBAL.wsrep_cluster_address)
1
1 Expected
SELECT COUNT(@@GLOBAL.wsrep_cluster_address);
COUNT(@@GLOBAL.wsrep_cluster_address)
1
1 Expected
SELECT @@GLOBAL.wsrep_cluster_address = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_cluster_address';
@@GLOBAL.wsrep_cluster_address = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.wsrep_cluster_address);
COUNT(@@GLOBAL.wsrep_cluster_address)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_cluster_address';
COUNT(VARIABLE_VALUE)
1
1 Expected
SELECT @@wsrep_cluster_address = @@GLOBAL.wsrep_cluster_address;
@@wsrep_cluster_address = @@GLOBAL.wsrep_cluster_address
1
1 Expected
SELECT COUNT(@@wsrep_cluster_address);
COUNT(@@wsrep_cluster_address)
1
1 Expected
SELECT COUNT(@@local.wsrep_cluster_address);
#
# wsrep_cluster_address
#
call mtr.add_suppression("safe_mutex: Found wrong usage of mutex.*");
# save the initial value
SET @wsrep_cluster_address_global_saved = @@global.wsrep_cluster_address;
# default
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address
# scope
SELECT @@session.wsrep_cluster_address;
ERROR HY000: Variable 'wsrep_cluster_address' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.wsrep_cluster_address);
ERROR HY000: Variable 'wsrep_cluster_address' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.wsrep_cluster_address);
COUNT(@@GLOBAL.wsrep_cluster_address)
1
1 Expected
SELECT wsrep_cluster_address = @@SESSION.wsrep_cluster_address;
ERROR 42S22: Unknown column 'wsrep_cluster_address' in 'field list'
Expected error 'Readonly variable'
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address
# valid values
SET @@global.wsrep_cluster_address='127.0.0.1';
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address
127.0.0.1
SET @@global.wsrep_cluster_address=AUTO;
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address
AUTO
SET @@global.wsrep_cluster_address=default;
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address
# invalid values
SET @@global.wsrep_node_address=NULL;
ERROR 42000: Variable 'wsrep_node_address' can't be set to the value of 'NULL'
SELECT @@global.wsrep_node_address;
@@global.wsrep_node_address
SET @@global.wsrep_cluster_address=ON;
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address
ON
SET @@global.wsrep_cluster_address='OFF';
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address
OFF
SET @@global.wsrep_cluster_address='junk';
SELECT @@global.wsrep_cluster_address;
@@global.wsrep_cluster_address
junk
# restore the initial value
SET @@global.wsrep_cluster_address = @wsrep_cluster_address_global_saved;
# End of test
set @start_value = @@wsrep_cluster_name;
set @@global.wsrep_cluster_name='test';
set @@global.wsrep_cluster_name=NULL;
#
# wsrep_cluster_name
#
# save the initial value
SET @wsrep_cluster_name_global_saved = @@global.wsrep_cluster_name;
# default
SELECT @@global.wsrep_cluster_name;
@@global.wsrep_cluster_name
my_wsrep_cluster
# scope
SELECT @@session.wsrep_cluster_name;
ERROR HY000: Variable 'wsrep_cluster_name' is a GLOBAL variable
SET @@global.wsrep_cluster_name='my_galera_cluster';
SELECT @@global.wsrep_cluster_name;
@@global.wsrep_cluster_name
my_galera_cluster
# valid values
SET @@global.wsrep_cluster_name='my_quoted_galera_cluster';
SELECT @@global.wsrep_cluster_name;
@@global.wsrep_cluster_name
my_quoted_galera_cluster
SET @@global.wsrep_cluster_name=my_unquoted_cluster;
SELECT @@global.wsrep_cluster_name;
@@global.wsrep_cluster_name
my_unquoted_cluster
SET @@global.wsrep_cluster_name=OFF;
SELECT @@global.wsrep_cluster_name;
@@global.wsrep_cluster_name
OFF
SET @@global.wsrep_cluster_name=default;
SELECT @@global.wsrep_cluster_name;
@@global.wsrep_cluster_name
my_wsrep_cluster
# invalid values
SET @@global.wsrep_cluster_name=NULL;
ERROR 42000: Variable 'wsrep_cluster_name' can't be set to the value of 'NULL'
SET @@global.wsrep_cluster_name = 1;
ERROR 42000: Incorrect argument type to variable 'wsrep_cluster_name'
set @@global.wsrep_cluster_name = @start_value;
# restore the initial value
SET @@global.wsrep_cluster_name = @wsrep_cluster_name_global_saved;
# End of test
set @start_value = @@wsrep_convert_lock_to_trx;
set @@global.wsrep_convert_lock_to_trx=ON;
set @@global.wsrep_convert_lock_to_trx=OFF;
set @@global.wsrep_convert_lock_to_trx=1;
set @@global.wsrep_convert_lock_to_trx=0;
SET @@global.wsrep_convert_lock_to_trx = -1;
ERROR 42000: Variable 'wsrep_convert_LOCK_to_trx' can't be set to the value of '-1'
set @@global.wsrep_convert_lock_to_trx = @start_value;
#
# wsrep_convert_lock_to_trx
#
# save the initial value
SET @wsrep_convert_lock_to_trx_global_saved = @@global.wsrep_convert_lock_to_trx;
# default
SELECT @@global.wsrep_convert_lock_to_trx;
@@global.wsrep_convert_lock_to_trx
0
# scope
SELECT @@session.wsrep_convert_lock_to_trx;
ERROR HY000: Variable 'wsrep_convert_LOCK_to_trx' is a GLOBAL variable
SET @@global.wsrep_convert_lock_to_trx=OFF;
SELECT @@global.wsrep_convert_lock_to_trx;
@@global.wsrep_convert_lock_to_trx
0
SET @@global.wsrep_convert_lock_to_trx=ON;
SELECT @@global.wsrep_convert_lock_to_trx;
@@global.wsrep_convert_lock_to_trx
1
# valid values
SET @@global.wsrep_convert_lock_to_trx='OFF';
SELECT @@global.wsrep_convert_lock_to_trx;
@@global.wsrep_convert_lock_to_trx
0
SET @@global.wsrep_convert_lock_to_trx=ON;
SELECT @@global.wsrep_convert_lock_to_trx;
@@global.wsrep_convert_lock_to_trx
1
SET @@global.wsrep_convert_lock_to_trx=default;
SELECT @@global.wsrep_convert_lock_to_trx;
@@global.wsrep_convert_lock_to_trx
0
# invalid values
SET @@global.wsrep_convert_lock_to_trx=NULL;
ERROR 42000: Variable 'wsrep_convert_LOCK_to_trx' can't be set to the value of 'NULL'
SET @@global.wsrep_convert_lock_to_trx='junk';
ERROR 42000: Variable 'wsrep_convert_LOCK_to_trx' can't be set to the value of 'junk'
# restore the initial value
SET @@global.wsrep_convert_lock_to_trx = @wsrep_convert_lock_to_trx_global_saved;
# End of test
SELECT COUNT(@@GLOBAL.wsrep_data_home_dir);
COUNT(@@GLOBAL.wsrep_data_home_dir)
1
1 Expected
SET @@GLOBAL.wsrep_data_home_dir=1;
ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.wsrep_data_home_dir);
COUNT(@@GLOBAL.wsrep_data_home_dir)
1
1 Expected
SELECT @@GLOBAL.wsrep_data_home_dir = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_data_home_dir';
@@GLOBAL.wsrep_data_home_dir = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.wsrep_data_home_dir);
COUNT(@@GLOBAL.wsrep_data_home_dir)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_data_home_dir';
COUNT(VARIABLE_VALUE)
1
1 Expected
SELECT @@wsrep_data_home_dir = @@GLOBAL.wsrep_data_home_dir;
@@wsrep_data_home_dir = @@GLOBAL.wsrep_data_home_dir
1
1 Expected
SELECT COUNT(@@wsrep_data_home_dir);
COUNT(@@wsrep_data_home_dir)
1
1 Expected
SELECT COUNT(@@local.wsrep_data_home_dir);
ERROR HY000: Variable 'wsrep_data_home_dir' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.wsrep_data_home_dir);
#
# wsrep_data_home_dir (readonly)
#
# default
SELECT @@global.wsrep_data_home_dir;
@@global.wsrep_data_home_dir
# scope
SELECT @@session.wsrep_data_home_dir;
ERROR HY000: Variable 'wsrep_data_home_dir' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.wsrep_data_home_dir);
COUNT(@@GLOBAL.wsrep_data_home_dir)
1
1 Expected
SELECT wsrep_data_home_dir = @@SESSION.wsrep_data_home_dir;
ERROR 42S22: Unknown column 'wsrep_data_home_dir' in 'field list'
Expected error 'Readonly variable'
SET @@global.wsrep_data_home_dir='/tmp/data';
ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
SELECT @@global.wsrep_data_home_dir;
@@global.wsrep_data_home_dir
# valid values
SET @@global.wsrep_data_home_dir='/tmp/data';
ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
SELECT @@global.wsrep_data_home_dir;
@@global.wsrep_data_home_dir
SET @@global.wsrep_data_home_dir=junk-dir;
ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
SELECT @@global.wsrep_data_home_dir;
@@global.wsrep_data_home_dir
SET @@global.wsrep_data_home_dir=junk/dir;
ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
SELECT @@global.wsrep_data_home_dir;
@@global.wsrep_data_home_dir
SET @@global.wsrep_data_home_dir=OFF;
ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
SELECT @@global.wsrep_data_home_dir;
@@global.wsrep_data_home_dir
SET @@global.wsrep_data_home_dir=default;
ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
SELECT @@global.wsrep_data_home_dir;
@@global.wsrep_data_home_dir
# invalid values
SET @@global.wsrep_data_home_dir=NULL;
ERROR HY000: Variable 'wsrep_data_home_dir' is a read only variable
# End of test
set @start_value = @@wsrep_dbug_option;
set @@global.wsrep_dbug_option='foo:bar';
set @@global.wsrep_dbug_option=NULL;
SET @@global.wsrep_dbug_option = -1;
#
# wsrep_dbug_option
#
# save the initial value
SET @wsrep_dbug_option_global_saved = @@global.wsrep_dbug_option;
# default
SELECT @@global.wsrep_dbug_option;
@@global.wsrep_dbug_option
# scope
SELECT @@session.wsrep_dbug_option;
ERROR HY000: Variable 'wsrep_dbug_option' is a GLOBAL variable
SET @@global.wsrep_dbug_option='test-dbug-string';
SELECT @@global.wsrep_dbug_option;
@@global.wsrep_dbug_option
test-dbug-string
# valid values
SET @@global.wsrep_dbug_option='quoted-dbug-string';
SELECT @@global.wsrep_dbug_option;
@@global.wsrep_dbug_option
quoted-dbug-string
SET @@global.wsrep_dbug_option=unquoted_dbug_string;
SELECT @@global.wsrep_dbug_option;
@@global.wsrep_dbug_option
unquoted_dbug_string
SET @@global.wsrep_dbug_option=OFF;
SELECT @@global.wsrep_dbug_option;
@@global.wsrep_dbug_option
OFF
SET @@global.wsrep_dbug_option=NULL;
SELECT @@global.wsrep_dbug_option;
@@global.wsrep_dbug_option
NULL
SET @@global.wsrep_dbug_option=default;
SELECT @@global.wsrep_dbug_option;
@@global.wsrep_dbug_option
# invalid values
SET @@global.wsrep_dbug_option=1;
ERROR 42000: Incorrect argument type to variable 'wsrep_dbug_option'
set @@global.wsrep_dbug_option = @start_value;
# restore the initial value
SET @@global.wsrep_dbug_option = @wsrep_dbug_option_global_saved;
# End of test
set @start_value = @@wsrep_debug;
set @@global.wsrep_debug=ON;
set @@global.wsrep_debug=OFF;
set @@global.wsrep_debug=1;
set @@global.wsrep_debug=0;
SET @@global.wsrep_debug = -1;
ERROR 42000: Variable 'wsrep_debug' can't be set to the value of '-1'
set @@global.wsrep_debug = @start_value;
#
# wsrep_debug
#
# save the initial value
SET @wsrep_debug_global_saved = @@global.wsrep_debug;
# default
SELECT @@global.wsrep_debug;
@@global.wsrep_debug
0
# scope
SELECT @@session.wsrep_debug;
ERROR HY000: Variable 'wsrep_debug' is a GLOBAL variable
SET @@global.wsrep_debug=OFF;
SELECT @@global.wsrep_debug;
@@global.wsrep_debug
0
SET @@global.wsrep_debug=ON;
SELECT @@global.wsrep_debug;
@@global.wsrep_debug
1
# valid values
SET @@global.wsrep_debug='OFF';
SELECT @@global.wsrep_debug;
@@global.wsrep_debug
0
SET @@global.wsrep_debug=ON;
SELECT @@global.wsrep_debug;
@@global.wsrep_debug
1
SET @@global.wsrep_debug=default;
SELECT @@global.wsrep_debug;
@@global.wsrep_debug
0
# invalid values
SET @@global.wsrep_debug=NULL;
ERROR 42000: Variable 'wsrep_debug' can't be set to the value of 'NULL'
SET @@global.wsrep_debug='junk';
ERROR 42000: Variable 'wsrep_debug' can't be set to the value of 'junk'
# restore the initial value
SET @@global.wsrep_debug = @wsrep_debug_global_saved;
# End of test
select @@global.wsrep_desync;
#
# wsrep_desync
#
call mtr.add_suppression("WSREP: SET desync failed 9 for SET @@global.wsrep_desync=ON");
# save the initial value
SET @wsrep_desync_global_saved = @@global.wsrep_desync;
# default
SELECT @@global.wsrep_desync;
@@global.wsrep_desync
0
# scope
SELECT @@session.wsrep_desync;
ERROR HY000: Variable 'wsrep_desync' is a GLOBAL variable
SET @@global.wsrep_desync=OFF;
Warnings:
Warning 1231 'wsrep_desync' is already OFF.
SELECT @@global.wsrep_desync;
@@global.wsrep_desync
0
SET @@global.wsrep_desync=ON;
ERROR HY000: Operation 'desync' failed for SET @@global.wsrep_desync=ON
SELECT @@global.wsrep_desync;
@@global.wsrep_desync
1
# valid values
SET @@global.wsrep_desync='OFF';
SELECT @@global.wsrep_desync;
@@global.wsrep_desync
0
SET @@global.wsrep_desync=ON;
ERROR HY000: Operation 'desync' failed for SET @@global.wsrep_desync=ON
SELECT @@global.wsrep_desync;
@@global.wsrep_desync
1
SET @@global.wsrep_desync=default;
SELECT @@global.wsrep_desync;
@@global.wsrep_desync
0
# invalid values
SET @@global.wsrep_desync=NULL;
ERROR 42000: Variable 'wsrep_desync' can't be set to the value of 'NULL'
SET @@global.wsrep_desync='junk';
ERROR 42000: Variable 'wsrep_desync' can't be set to the value of 'junk'
# restore the initial value
SET @@global.wsrep_desync = @wsrep_desync_global_saved;
Warnings:
Warning 1231 'wsrep_desync' is already OFF.
# End of test
set @start_value = @@wsrep_drupal_282555_workaround;
set @@global.wsrep_drupal_282555_workaround=ON;
set @@global.wsrep_drupal_282555_workaround=OFF;
set @@global.wsrep_drupal_282555_workaround=1;
set @@global.wsrep_drupal_282555_workaround=0;
SET @@global.wsrep_drupal_282555_workaround = -1;
ERROR 42000: Variable 'wsrep_drupal_282555_workaround' can't be set to the value of '-1'
set @@global.wsrep_drupal_282555_workaround = @start_value;
#
# wsrep_drupal_282555_workaround
#
# save the initial value
SET @wsrep_drupal_282555_workaround_global_saved = @@global.wsrep_drupal_282555_workaround;
# default
SELECT @@global.wsrep_drupal_282555_workaround;
@@global.wsrep_drupal_282555_workaround
0
# scope
SELECT @@session.wsrep_drupal_282555_workaround;
ERROR HY000: Variable 'wsrep_drupal_282555_workaround' is a GLOBAL variable
SET @@global.wsrep_drupal_282555_workaround=OFF;
SELECT @@global.wsrep_drupal_282555_workaround;
@@global.wsrep_drupal_282555_workaround
0
SET @@global.wsrep_drupal_282555_workaround=ON;
SELECT @@global.wsrep_drupal_282555_workaround;
@@global.wsrep_drupal_282555_workaround
1
# valid values
SET @@global.wsrep_drupal_282555_workaround='OFF';
SELECT @@global.wsrep_drupal_282555_workaround;
@@global.wsrep_drupal_282555_workaround
0
SET @@global.wsrep_drupal_282555_workaround=ON;
SELECT @@global.wsrep_drupal_282555_workaround;
@@global.wsrep_drupal_282555_workaround
1
SET @@global.wsrep_drupal_282555_workaround=default;
SELECT @@global.wsrep_drupal_282555_workaround;
@@global.wsrep_drupal_282555_workaround
0
# invalid values
SET @@global.wsrep_drupal_282555_workaround=NULL;
ERROR 42000: Variable 'wsrep_drupal_282555_workaround' can't be set to the value of 'NULL'
SET @@global.wsrep_drupal_282555_workaround='junk';
ERROR 42000: Variable 'wsrep_drupal_282555_workaround' can't be set to the value of 'junk'
# restore the initial value
SET @@global.wsrep_drupal_282555_workaround = @wsrep_drupal_282555_workaround_global_saved;
# End of test
set @start_value = @@wsrep_forced_binlog_format;
set @@global.wsrep_forced_binlog_format = ROW;
set @@global.wsrep_forced_binlog_format = MIXED;
set @@global.wsrep_forced_binlog_format = STATEMENT;
set @@global.wsrep_forced_binlog_format = NONE;
set @@global.wsrep_forced_binlog_format = FOO;
ERROR 42000: Variable 'wsrep_forced_binlog_format' can't be set to the value of 'FOO'
set @@global.wsrep_forced_binlog_format = @start_value;
#
# wsrep_forced_binlog_format
#
# save the initial value
SET @wsrep_forced_binlog_format_global_saved = @@global.wsrep_forced_binlog_format;
# default
SELECT @@global.wsrep_forced_binlog_format;
@@global.wsrep_forced_binlog_format
NONE
# scope
SELECT @@session.wsrep_forced_binlog_format;
ERROR HY000: Variable 'wsrep_forced_binlog_format' is a GLOBAL variable
SET @@global.wsrep_forced_binlog_format=STATEMENT;
SELECT @@global.wsrep_forced_binlog_format;
@@global.wsrep_forced_binlog_format
STATEMENT
# valid values
SET @@global.wsrep_forced_binlog_format=STATEMENT;
SELECT @@global.wsrep_forced_binlog_format;
@@global.wsrep_forced_binlog_format
STATEMENT
SET @@global.wsrep_forced_binlog_format=ROW;
SELECT @@global.wsrep_forced_binlog_format;
@@global.wsrep_forced_binlog_format
ROW
SET @@global.wsrep_forced_binlog_format=MIXED;
SELECT @@global.wsrep_forced_binlog_format;
@@global.wsrep_forced_binlog_format
MIXED
SET @@global.wsrep_forced_binlog_format=NONE;
SELECT @@global.wsrep_forced_binlog_format;
@@global.wsrep_forced_binlog_format
NONE
SET @@global.wsrep_forced_binlog_format=default;
SELECT @@global.wsrep_forced_binlog_format;
@@global.wsrep_forced_binlog_format
NONE
# invalid values
SET @@global.wsrep_forced_binlog_format=NULL;
ERROR 42000: Variable 'wsrep_forced_binlog_format' can't be set to the value of 'NULL'
SET @@global.wsrep_forced_binlog_format='junk';
ERROR 42000: Variable 'wsrep_forced_binlog_format' can't be set to the value of 'junk'
SET @@global.wsrep_forced_binlog_format=ON;
ERROR 42000: Variable 'wsrep_forced_binlog_format' can't be set to the value of 'ON'
# restore the initial value
SET @@global.wsrep_forced_binlog_format = @wsrep_forced_binlog_format_global_saved;
# End of test
set @start_value = @@wsrep_load_data_splitting;
set @@global.wsrep_load_data_splitting=ON;
set @@global.wsrep_load_data_splitting=OFF;
set @@global.wsrep_load_data_splitting=1;
set @@global.wsrep_load_data_splitting=0;
SET @@global.wsrep_load_data_splitting = -1;
ERROR 42000: Variable 'wsrep_load_data_splitting' can't be set to the value of '-1'
set @@global.wsrep_load_data_splitting = @start_value;
#
# wsrep_load_data_splitting
#
# save the initial value
SET @wsrep_load_data_splitting_global_saved = @@global.wsrep_load_data_splitting;
# default
SELECT @@global.wsrep_load_data_splitting;
@@global.wsrep_load_data_splitting
1
# scope
SELECT @@session.wsrep_load_data_splitting;
ERROR HY000: Variable 'wsrep_load_data_splitting' is a GLOBAL variable
SET @@global.wsrep_load_data_splitting=OFF;
SELECT @@global.wsrep_load_data_splitting;
@@global.wsrep_load_data_splitting
0
SET @@global.wsrep_load_data_splitting=ON;
SELECT @@global.wsrep_load_data_splitting;
@@global.wsrep_load_data_splitting
1
# valid values
SET @@global.wsrep_load_data_splitting='OFF';
SELECT @@global.wsrep_load_data_splitting;
@@global.wsrep_load_data_splitting
0
SET @@global.wsrep_load_data_splitting=ON;
SELECT @@global.wsrep_load_data_splitting;
@@global.wsrep_load_data_splitting
1
SET @@global.wsrep_load_data_splitting=default;
SELECT @@global.wsrep_load_data_splitting;
@@global.wsrep_load_data_splitting
1
# invalid values
SET @@global.wsrep_load_data_splitting=NULL;
ERROR 42000: Variable 'wsrep_load_data_splitting' can't be set to the value of 'NULL'
SET @@global.wsrep_load_data_splitting='junk';
ERROR 42000: Variable 'wsrep_load_data_splitting' can't be set to the value of 'junk'
# restore the initial value
SET @@global.wsrep_load_data_splitting = @wsrep_load_data_splitting_global_saved;
# End of test
set @start_value = @@wsrep_log_conflicts;
set @@global.wsrep_log_conflicts=ON;
set @@global.wsrep_log_conflicts=OFF;
set @@global.wsrep_log_conflicts=1;
set @@global.wsrep_log_conflicts=0;
SET @@global.wsrep_log_conflicts = -1;
ERROR 42000: Variable 'wsrep_log_conflicts' can't be set to the value of '-1'
set @@global.wsrep_log_conflicts = @start_value;
#
# wsrep_log_conflicts
#
# save the initial value
SET @wsrep_log_conflicts_global_saved = @@global.wsrep_log_conflicts;
# default
SELECT @@global.wsrep_log_conflicts;
@@global.wsrep_log_conflicts
0
# scope
SELECT @@session.wsrep_log_conflicts;
ERROR HY000: Variable 'wsrep_log_conflicts' is a GLOBAL variable
SET @@global.wsrep_log_conflicts=OFF;
SELECT @@global.wsrep_log_conflicts;
@@global.wsrep_log_conflicts
0
SET @@global.wsrep_log_conflicts=ON;
SELECT @@global.wsrep_log_conflicts;
@@global.wsrep_log_conflicts
1
# valid values
SET @@global.wsrep_log_conflicts='OFF';
SELECT @@global.wsrep_log_conflicts;
@@global.wsrep_log_conflicts
0
SET @@global.wsrep_log_conflicts=ON;
SELECT @@global.wsrep_log_conflicts;
@@global.wsrep_log_conflicts
1
SET @@global.wsrep_log_conflicts=default;
SELECT @@global.wsrep_log_conflicts;
@@global.wsrep_log_conflicts
0
# invalid values
SET @@global.wsrep_log_conflicts=NULL;
ERROR 42000: Variable 'wsrep_log_conflicts' can't be set to the value of 'NULL'
SET @@global.wsrep_log_conflicts='junk';
ERROR 42000: Variable 'wsrep_log_conflicts' can't be set to the value of 'junk'
# restore the initial value
SET @@global.wsrep_log_conflicts = @wsrep_log_conflicts_global_saved;
# End of test
set @start_value = @@wsrep_max_ws_rows;
set @@global.wsrep_max_ws_rows=256000;
set @@global.wsrep_max_ws_rows=0;
#
# wsrep_max_ws_rows
#
# save the initial value
SET @wsrep_max_ws_rows_global_saved = @@global.wsrep_max_ws_rows;
# default
SELECT @@global.wsrep_max_ws_rows;
@@global.wsrep_max_ws_rows
131072
# scope
SELECT @@session.wsrep_max_ws_rows;
ERROR HY000: Variable 'wsrep_max_ws_rows' is a GLOBAL variable
SET @@global.wsrep_max_ws_rows=1;
SELECT @@global.wsrep_max_ws_rows;
@@global.wsrep_max_ws_rows
1
# valid values
SET @@global.wsrep_max_ws_rows=131072;
SELECT @@global.wsrep_max_ws_rows;
@@global.wsrep_max_ws_rows
131072
SET @@global.wsrep_max_ws_rows=131073;
SELECT @@global.wsrep_max_ws_rows;
@@global.wsrep_max_ws_rows
131073
SET @@global.wsrep_max_ws_rows=0;
Warnings:
Warning 1292 Truncated incorrect wsrep_max_ws_rows value: '0'
show warnings;
Level Code Message
Warning 1292 Truncated incorrect wsrep_max_ws_rows value: '0'
set @@global.wsrep_max_ws_rows=-1;
SELECT @@global.wsrep_max_ws_rows;
@@global.wsrep_max_ws_rows
1
SET @@global.wsrep_max_ws_rows=default;
SELECT @global.wsrep_max_ws_rows;
@global.wsrep_max_ws_rows
NULL
# invalid values
SET @@global.wsrep_max_ws_rows=NULL;
ERROR 42000: Incorrect argument type to variable 'wsrep_max_ws_rows'
SET @@global.wsrep_max_ws_rows='junk';
ERROR 42000: Incorrect argument type to variable 'wsrep_max_ws_rows'
SET @@global.wsrep_max_ws_rows=-1;
Warnings:
Warning 1292 Truncated incorrect wsrep_max_ws_rows value: '-1'
show warnings;
Level Code Message
Warning 1292 Truncated incorrect wsrep_max_ws_rows value: '-1'
SET @@global.wsrep_max_ws_rows = r;
ERROR 42000: Incorrect argument type to variable 'wsrep_max_ws_rows'
set @@global.wsrep_max_ws_rows = @start_value;
SELECT @global.wsrep_max_ws_rows;
@global.wsrep_max_ws_rows
NULL
# restore the initial value
SET @@global.wsrep_max_ws_rows = @wsrep_max_ws_rows_global_saved;
# End of test
set @start_value = @@wsrep_max_ws_size;
set @@global.wsrep_max_ws_size=256000;
set @@global.wsrep_max_ws_size=0;
#
# wsrep_max_ws_size
#
# save the initial value
SET @wsrep_max_ws_size_global_saved = @@global.wsrep_max_ws_size;
# default
SELECT @@global.wsrep_max_ws_size;
@@global.wsrep_max_ws_size
1073741824
# scope
SELECT @@session.wsrep_max_ws_size;
ERROR HY000: Variable 'wsrep_max_ws_size' is a GLOBAL variable
SET @@global.wsrep_max_ws_size=1;
Warnings:
Warning 1292 Truncated incorrect wsrep_max_ws_size value: '1'
SELECT @@global.wsrep_max_ws_size;
@@global.wsrep_max_ws_size
1024
# valid values
SET @@global.wsrep_max_ws_size=1073741824;
SELECT @@global.wsrep_max_ws_size;
@@global.wsrep_max_ws_size
1073741824
SET @@global.wsrep_max_ws_size=1073741825;
SELECT @@global.wsrep_max_ws_size;
@@global.wsrep_max_ws_size
1073741825
SET @@global.wsrep_max_ws_size=0;
Warnings:
Warning 1292 Truncated incorrect wsrep_max_ws_size value: '0'
show warnings;
Level Code Message
Warning 1292 Truncated incorrect wsrep_max_ws_size value: '0'
set @@global.wsrep_max_ws_size=-1;
SELECT @@global.wsrep_max_ws_size;
@@global.wsrep_max_ws_size
1024
SET @@global.wsrep_max_ws_size=default;
SELECT @global.wsrep_max_ws_size;
@global.wsrep_max_ws_size
NULL
# invalid values
SET @@global.wsrep_max_ws_size=NULL;
ERROR 42000: Incorrect argument type to variable 'wsrep_max_ws_size'
SET @@global.wsrep_max_ws_size='junk';
ERROR 42000: Incorrect argument type to variable 'wsrep_max_ws_size'
SELECT @global.wsrep_max_ws_size;
@global.wsrep_max_ws_size
NULL
SET @@global.wsrep_max_ws_size=-1;
Warnings:
Warning 1292 Truncated incorrect wsrep_max_ws_size value: '-1'
show warnings;
Level Code Message
Warning 1292 Truncated incorrect wsrep_max_ws_size value: '-1'
SET @@global.wsrep_max_ws_size = r;
ERROR 42000: Incorrect argument type to variable 'wsrep_max_ws_size'
set @@global.wsrep_max_ws_size = @start_value;
SELECT @global.wsrep_max_ws_size;
@global.wsrep_max_ws_size
NULL
# restore the initial value
SET @@global.wsrep_max_ws_size = @wsrep_max_ws_size_global_saved;
# End of test
set @start_value = @@wsrep_mysql_replication_bundle;
set @@global.wsrep_mysql_replication_bundle=0;
set @@global.wsrep_mysql_replication_bundle=1000;
set @@global.wsrep_mysql_replication_bundle=-1;
#
# wsrep_mysql_replication_bundle
#
# save the initial value
SET @wsrep_mysql_replication_bundle_global_saved = @@global.wsrep_mysql_replication_bundle;
# default
SELECT @@global.wsrep_mysql_replication_bundle;
@@global.wsrep_mysql_replication_bundle
0
# scope
SELECT @@session.wsrep_mysql_replication_bundle;
ERROR HY000: Variable 'wsrep_mysql_replication_bundle' is a GLOBAL variable
SELECT @@global.wsrep_mysql_replication_bundle;
@@global.wsrep_mysql_replication_bundle
0
# valid values
SET @@global.wsrep_mysql_replication_bundle=0;
SELECT @@global.wsrep_mysql_replication_bundle;
@@global.wsrep_mysql_replication_bundle
0
SET @@global.wsrep_mysql_replication_bundle=1000;
SELECT @@global.wsrep_mysql_replication_bundle;
@@global.wsrep_mysql_replication_bundle
1000
SET @@global.wsrep_mysql_replication_bundle=default;
SELECT @@global.wsrep_mysql_replication_bundle;
@@global.wsrep_mysql_replication_bundle
0
# invalid values
SET @@global.wsrep_mysql_replication_bundle=NULL;
ERROR 42000: Incorrect argument type to variable 'wsrep_mysql_replication_bundle'
SET @@global.wsrep_mysql_replication_bundle='junk';
ERROR 42000: Incorrect argument type to variable 'wsrep_mysql_replication_bundle'
SET @@global.wsrep_mysql_replication_bundle=-1;
Warnings:
Warning 1292 Truncated incorrect wsrep_mysql_replication_bundle value: '-1'
show warnings;
Level Code Message
Warning 1292 Truncated incorrect wsrep_mysql_replication_bundle value: '-1'
set @@global.wsrep_mysql_replication_bundle=1001;
SELECT @@global.wsrep_mysql_replication_bundle;
@@global.wsrep_mysql_replication_bundle
0
SET @@global.wsrep_mysql_replication_bundle=1001;
Warnings:
Warning 1292 Truncated incorrect wsrep_mysql_replication_bundle value: '1001'
show warnings;
Level Code Message
Warning 1292 Truncated incorrect wsrep_mysql_replication_bundle value: '1001'
SET @@global.wsrep_mysql_replication_bundle = r;
ERROR 42000: Incorrect argument type to variable 'wsrep_mysql_replication_bundle'
set @@global.wsrep_mysql_replication_bundle = @start_value;
SELECT @@global.wsrep_mysql_replication_bundle;
@@global.wsrep_mysql_replication_bundle
1000
# restore the initial value
SET @@global.wsrep_mysql_replication_bundle = @wsrep_mysql_replication_bundle_global_saved;
# End of test
SELECT COUNT(@@GLOBAL.wsrep_node_address);
COUNT(@@GLOBAL.wsrep_node_address)
1
1 Expected
SET @@GLOBAL.wsrep_node_address=1;
ERROR 42000: Incorrect argument type to variable 'wsrep_node_address'
Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.wsrep_node_address);
COUNT(@@GLOBAL.wsrep_node_address)
1
1 Expected
SELECT @@GLOBAL.wsrep_node_address = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_node_address';
@@GLOBAL.wsrep_node_address = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.wsrep_node_address);
COUNT(@@GLOBAL.wsrep_node_address)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_node_address';
COUNT(VARIABLE_VALUE)
1
1 Expected
SELECT @@wsrep_node_address = @@GLOBAL.wsrep_node_address;
@@wsrep_node_address = @@GLOBAL.wsrep_node_address
1
1 Expected
SELECT COUNT(@@wsrep_node_address);
COUNT(@@wsrep_node_address)
1
1 Expected
SELECT COUNT(@@local.wsrep_node_address);
#
# wsrep_node_address
#
# save the initial value
SET @wsrep_node_address_global_saved = @@global.wsrep_node_address;
# default
SELECT @@global.wsrep_node_address;
@@global.wsrep_node_address
# scope
SELECT @@session.wsrep_node_address;
ERROR HY000: Variable 'wsrep_node_address' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.wsrep_node_address);
ERROR HY000: Variable 'wsrep_node_address' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.wsrep_node_address);
COUNT(@@GLOBAL.wsrep_node_address)
1
1 Expected
SELECT @@global.wsrep_node_address;
@@global.wsrep_node_address
# valid values
SET @@global.wsrep_node_address='127.0.0.1';
SELECT @@global.wsrep_node_address;
@@global.wsrep_node_address
127.0.0.1
SET @@global.wsrep_node_address=default;
SELECT @@global.wsrep_node_address;
@@global.wsrep_node_address
# invalid values
SET @@global.wsrep_node_address=NULL;
ERROR 42000: Variable 'wsrep_node_address' can't be set to the value of 'NULL'
SELECT @@global.wsrep_node_address;
@@global.wsrep_node_address
SET @@global.wsrep_node_address=ON;
SELECT @@global.wsrep_node_address;
@@global.wsrep_node_address
ON
SET @@global.wsrep_node_address='OFF';
SELECT @@global.wsrep_node_address;
@@global.wsrep_node_address
OFF
SET @@global.wsrep_node_address='junk';
SELECT @@global.wsrep_node_address;
@@global.wsrep_node_address
junk
# restore the initial value
SET @@global.wsrep_node_address = @wsrep_node_address_global_saved;
# End of test
SELECT COUNT(@@GLOBAL.wsrep_node_incoming_address);
COUNT(@@GLOBAL.wsrep_node_incoming_address)
1
1 Expected
SET @@GLOBAL.wsrep_node_incoming_address=1;
ERROR 42000: Incorrect argument type to variable 'wsrep_node_incoming_address'
Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.wsrep_node_incoming_address);
COUNT(@@GLOBAL.wsrep_node_incoming_address)
1
1 Expected
SELECT @@GLOBAL.wsrep_node_incoming_address = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_node_incoming_address';
@@GLOBAL.wsrep_node_incoming_address = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.wsrep_node_incoming_address);
COUNT(@@GLOBAL.wsrep_node_incoming_address)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_node_incoming_address';
COUNT(VARIABLE_VALUE)
1
1 Expected
SELECT @@wsrep_node_incoming_address = @@GLOBAL.wsrep_node_incoming_address;
@@wsrep_node_incoming_address = @@GLOBAL.wsrep_node_incoming_address
1
1 Expected
SELECT COUNT(@@wsrep_node_incoming_address);
COUNT(@@wsrep_node_incoming_address)
1
1 Expected
SELECT COUNT(@@local.wsrep_node_incoming_address);
#
# wsrep_node_incoming_address
#
# save the initial value
SET @wsrep_node_incoming_address_global_saved = @@global.wsrep_node_incoming_address;
# default
SELECT @@global.wsrep_node_incoming_address;
@@global.wsrep_node_incoming_address
AUTO
# scope
SELECT @@session.wsrep_node_incoming_address;
ERROR HY000: Variable 'wsrep_node_incoming_address' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.wsrep_node_incoming_address);
ERROR HY000: Variable 'wsrep_node_incoming_address' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.wsrep_node_incoming_address);
COUNT(@@GLOBAL.wsrep_node_incoming_address)
1
1 Expected
SELECT @@global.wsrep_node_incoming_address;
@@global.wsrep_node_incoming_address
AUTO
# valid values
SET @@global.wsrep_node_incoming_address='127.0.0.1:4444';
SELECT @@global.wsrep_node_incoming_address;
@@global.wsrep_node_incoming_address
127.0.0.1:4444
SET @@global.wsrep_node_incoming_address='127.0.0.1';
SELECT @@global.wsrep_node_incoming_address;
@@global.wsrep_node_incoming_address
127.0.0.1
SET @@global.wsrep_node_incoming_address=AUTO;
SELECT @@global.wsrep_node_incoming_address;
@@global.wsrep_node_incoming_address
AUTO
SET @@global.wsrep_node_incoming_address=default;
SELECT @@global.wsrep_node_incoming_address;
@@global.wsrep_node_incoming_address
AUTO
# invalid values
SET @@global.wsrep_node_incoming_address=ON;
SELECT @@global.wsrep_node_incoming_address;
@@global.wsrep_node_incoming_address
ON
SET @@global.wsrep_node_incoming_address='OFF';
SELECT @@global.wsrep_node_incoming_address;
@@global.wsrep_node_incoming_address
OFF
SET @@global.wsrep_node_incoming_address=NULL;
SELECT @@global.wsrep_node_incoming_address;
@@global.wsrep_node_incoming_address
NULL
SET @@global.wsrep_node_incoming_address='junk';
SELECT @@global.wsrep_node_incoming_address;
@@global.wsrep_node_incoming_address
junk
# restore the initial value
SET @@global.wsrep_node_incoming_address = @wsrep_node_incoming_address_global_saved;
# End of test
set @start_value = @@wsrep_node_name;
set @@global.wsrep_node_name='test';
set @@global.wsrep_node_name=NULL;
SET @@global.wsrep_node_name = 1;
#
# wsrep_node_name
#
call mtr.add_suppression("WSREP: Failed to get provider options");
# save the initial value
SET @wsrep_node_name_global_saved = @@global.wsrep_node_name;
# default
SELECT @@global.wsrep_node_name;
@@global.wsrep_node_name
# scope
SELECT @@session.wsrep_node_name;
ERROR HY000: Variable 'wsrep_node_name' is a GLOBAL variable
SET @@global.wsrep_node_name='node_name';
SELECT @@global.wsrep_node_name;
@@global.wsrep_node_name
node_name
# valid values
SET @@global.wsrep_node_name='my_node';
SELECT @@global.wsrep_node_name;
@@global.wsrep_node_name
my_node
SET @@global.wsrep_node_name='hyphenated-node-name';
SELECT @@global.wsrep_node_name;
@@global.wsrep_node_name
hyphenated-node-name
SET @@global.wsrep_node_name=default;
SELECT @@global.wsrep_node_name;
@@global.wsrep_node_name
# invalid values
SET @@global.wsrep_node_name=NULL;
ERROR 42000: Variable 'wsrep_node_name' can't be set to the value of 'NULL'
SELECT @@global.wsrep_node_name;
@@global.wsrep_node_name
SET @@global.wsrep_node_name=1;
ERROR 42000: Incorrect argument type to variable 'wsrep_node_name'
set @@global.wsrep_node_name = @start_value;
SELECT @@global.wsrep_node_name;
@@global.wsrep_node_name
# restore the initial value
SET @@global.wsrep_node_name = @wsrep_node_name_global_saved;
# End of test
set @start_value = @@wsrep_notify_cmd;
set @@global.wsrep_notify_cmd='test';
set @@global.wsrep_notify_cmd=NULL;
SET @@global.wsrep_notify_cmd = 1;
#
# wsrep_notify_cmd
#
call mtr.add_suppression("WSREP: Failed to get provider options");
# save the initial value
SET @wsrep_notify_cmd_global_saved = @@global.wsrep_notify_cmd;
# default
SELECT @@global.wsrep_notify_cmd;
@@global.wsrep_notify_cmd
# scope
SELECT @@session.wsrep_notify_cmd;
ERROR HY000: Variable 'wsrep_notify_cmd' is a GLOBAL variable
SET @@global.wsrep_notify_cmd='notify_cmd';
SELECT @@global.wsrep_notify_cmd;
@@global.wsrep_notify_cmd
notify_cmd
# valid values
SET @@global.wsrep_notify_cmd='command';
SELECT @@global.wsrep_notify_cmd;
@@global.wsrep_notify_cmd
command
SET @@global.wsrep_notify_cmd='hyphenated-command';
SELECT @@global.wsrep_notify_cmd;
@@global.wsrep_notify_cmd
hyphenated-command
SET @@global.wsrep_notify_cmd=default;
SELECT @@global.wsrep_notify_cmd;
@@global.wsrep_notify_cmd
SET @@global.wsrep_notify_cmd=NULL;
SELECT @@global.wsrep_notify_cmd;
@@global.wsrep_notify_cmd
NULL
# invalid values
SET @@global.wsrep_notify_cmd=1;
ERROR 42000: Incorrect argument type to variable 'wsrep_notify_cmd'
set @@global.wsrep_notify_cmd = @start_value;
SELECT @@global.wsrep_notify_cmd;
@@global.wsrep_notify_cmd
NULL
# restore the initial value
SET @@global.wsrep_notify_cmd = @wsrep_notify_cmd_global_saved;
# End of test
set @start_value = @@wsrep_on;
set @@global.wsrep_on=ON;
set @@global.wsrep_on=OFF;
set @@global.wsrep_on=1;
set @@global.wsrep_on=0;
SET @@global.wsrep_on = -1;
ERROR 42000: Variable 'wsrep_on' can't be set to the value of '-1'
set @@global.wsrep_on = @start_value;
#
# wsrep_on
#
# save the initial values
SET @wsrep_on_global_saved = @@global.wsrep_on;
SET @wsrep_on_session_saved = @@session.wsrep_on;
# default
SELECT @@global.wsrep_on;
@@global.wsrep_on
0
SELECT @@session.wsrep_on;
@@session.wsrep_on
0
# scope and valid values
SET @@global.wsrep_on=OFF;
SELECT @@global.wsrep_on;
@@global.wsrep_on
0
SET @@global.wsrep_on=ON;
SELECT @@global.wsrep_on;
@@global.wsrep_on
1
SET @@session.wsrep_on=OFF;
SELECT @@session.wsrep_on;
@@session.wsrep_on
0
SET @@session.wsrep_on=ON;
SELECT @@session.wsrep_on;
@@session.wsrep_on
1
SET @@session.wsrep_on=default;
SELECT @@session.wsrep_on;
@@session.wsrep_on
1
# invalid values
SET @@global.wsrep_on=NULL;
ERROR 42000: Variable 'wsrep_on' can't be set to the value of 'NULL'
SET @@global.wsrep_on='junk';
ERROR 42000: Variable 'wsrep_on' can't be set to the value of 'junk'
SET @@session.wsrep_on=NULL;
ERROR 42000: Variable 'wsrep_on' can't be set to the value of 'NULL'
SET @@session.wsrep_on='junk';
ERROR 42000: Variable 'wsrep_on' can't be set to the value of 'junk'
# restore the initial values
SET @@global.wsrep_on = @wsrep_on_global_saved;
SET @@session.wsrep_on = @wsrep_on_session_saved;
# End of test
set @start_value = @@wsrep_osu_method;
set @@global.wsrep_osu_method='TOI';
set @@global.wsrep_osu_method='RSU';
set @@global.wsrep_osu_method=TOI;
set @@global.wsrep_osu_method=RSU;
set @@global.wsrep_osu_method=TSU;
ERROR 42000: Variable 'wsrep_OSU_method' can't be set to the value of 'TSU'
set @@global.wsrep_osu_method='TSU';
ERROR 42000: Variable 'wsrep_OSU_method' can't be set to the value of 'TSU'
SET @@global.wsrep_on = -1;
ERROR 42000: Variable 'wsrep_on' can't be set to the value of '-1'
set @@global.wsrep_osu_method = @start_value;
#
# wsrep_osu_method
#
# save the initial value
SET @wsrep_osu_method_global_saved = @@global.wsrep_osu_method;
# default
SELECT @@global.wsrep_osu_method;
@@global.wsrep_osu_method
TOI
# scope
SELECT @@session.wsrep_osu_method;
ERROR HY000: Variable 'wsrep_OSU_method' is a GLOBAL variable
SET @@global.wsrep_osu_method=TOI;
SELECT @@global.wsrep_osu_method;
@@global.wsrep_osu_method
TOI
# valid values
SET @@global.wsrep_osu_method=TOI;
SELECT @@global.wsrep_osu_method;
@@global.wsrep_osu_method
TOI
SET @@global.wsrep_osu_method=RSU;
SELECT @@global.wsrep_osu_method;
@@global.wsrep_osu_method
RSU
SET @@global.wsrep_osu_method="RSU";
SELECT @@global.wsrep_osu_method;
@@global.wsrep_osu_method
RSU
SET @@global.wsrep_osu_method=default;
SELECT @@global.wsrep_osu_method;
@@global.wsrep_osu_method
TOI
SET @@global.wsrep_osu_method=1;
SELECT @@global.wsrep_osu_method;
@@global.wsrep_osu_method
RSU
# invalid values
SET @@global.wsrep_osu_method=4;
ERROR 42000: Variable 'wsrep_OSU_method' can't be set to the value of '4'
SELECT @@global.wsrep_osu_method;
@@global.wsrep_osu_method
RSU
SET @@global.wsrep_osu_method=NULL;
ERROR 42000: Variable 'wsrep_OSU_method' can't be set to the value of 'NULL'
SELECT @@global.wsrep_osu_method;
@@global.wsrep_osu_method
RSU
SET @@global.wsrep_osu_method='junk';
ERROR 42000: Variable 'wsrep_OSU_method' can't be set to the value of 'junk'
SELECT @@global.wsrep_osu_method;
@@global.wsrep_osu_method
RSU
# restore the initial value
SET @@global.wsrep_osu_method = @wsrep_osu_method_global_saved;
# End of test
SELECT COUNT(@@GLOBAL.wsrep_provider);
COUNT(@@GLOBAL.wsrep_provider)
1
1 Expected
#
# wsrep_provider
#
# save the initial value
SET @wsrep_provider_global_saved = @@global.wsrep_provider;
# default
SELECT @@global.wsrep_provider;
@@global.wsrep_provider
none
# scope
SELECT @@session.wsrep_provider;
ERROR HY000: Variable 'wsrep_provider' is a GLOBAL variable
SELECT @@global.wsrep_provider;
@@global.wsrep_provider
none
# valid values
SET @@global.wsrep_provider=default;
SELECT @@global.wsrep_provider;
@@global.wsrep_provider
none
# invalid values
SET @@global.wsrep_provider='/invalid/libgalera_smm.so';
ERROR 42000: Variable 'wsrep_provider' can't be set to the value of '/invalid/libgalera_smm.so'
SET @@global.wsrep_provider=NULL;
ERROR 42000: Variable 'wsrep_provider' can't be set to the value of 'NULL'
SELECT @@global.wsrep_provider;
@@global.wsrep_provider
none
SET @@global.wsrep_provider=1;
ERROR 42000: Incorrect argument type to variable 'wsrep_provider'
SELECT @@global.wsrep_provider;
@@global.wsrep_provider
none
# restore the initial value
SET @@global.wsrep_provider = @wsrep_provider_global_saved;
# End of test
SELECT COUNT(@@GLOBAL.wsrep_provider_options);
COUNT(@@GLOBAL.wsrep_provider_options)
1
1 Expected
#
# wsrep_provider_options
#
call mtr.add_suppression("WSREP: Failed to get provider options");
# save the initial value
SET @wsrep_provider_options_global_saved = @@global.wsrep_provider_options;
# default
SELECT @@global.wsrep_provider_options;
@@global.wsrep_provider_options
# scope
SELECT @@session.wsrep_provider_options;
ERROR HY000: Variable 'wsrep_provider_options' is a GLOBAL variable
SET @@global.wsrep_provider_options='option1';
SELECT @@global.wsrep_provider_options;
@@global.wsrep_provider_options
option1
# valid values
SET @@global.wsrep_provider_options='name1=value1;name2=value2';
SELECT @@global.wsrep_provider_options;
@@global.wsrep_provider_options
name1=value1;name2=value2
SET @@global.wsrep_provider_options='hyphenated-name:value';
SELECT @@global.wsrep_provider_options;
@@global.wsrep_provider_options
hyphenated-name:value
SET @@global.wsrep_provider_options=default;
SELECT @@global.wsrep_provider_options;
@@global.wsrep_provider_options
# invalid values
SET @@global.wsrep_provider_options=1;
ERROR 42000: Incorrect argument type to variable 'wsrep_provider_options'
SELECT @@global.wsrep_provider_options;
@@global.wsrep_provider_options
SET @@global.wsrep_provider_options=NULL;
ERROR HY000: Incorrect arguments to SET
SELECT @@global.wsrep_provider_options;
@@global.wsrep_provider_options
NULL
# restore the initial value
SET @@global.wsrep_provider_options = @wsrep_provider_options_global_saved;
# End of test
SELECT COUNT(@@GLOBAL.wsrep_recover);
COUNT(@@GLOBAL.wsrep_recover)
1
1 Expected
set @@global.wsrep_recover=ON;
#
# wsrep_recover
#
# default
SELECT @@global.wsrep_recover;
@@global.wsrep_recover
0
SELECT @@session.wsrep_recover;
ERROR HY000: Variable 'wsrep_recover' is a GLOBAL variable
# scope and valid values
SET @@global.wsrep_recover=OFF;
ERROR HY000: Variable 'wsrep_recover' is a read only variable
Expected error 'Readonly variable'
set @@global.wsrep_recover=OFF;
SET @@global.wsrep_recover=ON;
ERROR HY000: Variable 'wsrep_recover' is a read only variable
Expected error 'Readonly variable'
SELECT @@GLOBAL.wsrep_recover = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_recover';
@@GLOBAL.wsrep_recover = VARIABLE_VALUE
1
Warnings:
Warning 1292 Truncated incorrect DOUBLE value: 'OFF'
1 Expected
SELECT COUNT(@@GLOBAL.wsrep_recover);
COUNT(@@GLOBAL.wsrep_recover)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_recover';
COUNT(VARIABLE_VALUE)
1
1 Expected
SELECT @@wsrep_recover = @@GLOBAL.wsrep_recover;
@@wsrep_recover = @@GLOBAL.wsrep_recover
1
1 Expected
SELECT COUNT(@@wsrep_recover);
COUNT(@@wsrep_recover)
1
1 Expected
SELECT COUNT(@@local.wsrep_recover);
ERROR HY000: Variable 'wsrep_recover' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@SESSION.wsrep_recover);
ERROR HY000: Variable 'wsrep_recover' is a GLOBAL variable
Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.wsrep_recover);
COUNT(@@GLOBAL.wsrep_recover)
1
1 Expected
SELECT wsrep_recover = @@SESSION.wsrep_recover;
ERROR 42S22: Unknown column 'wsrep_recover' in 'field list'
Expected error 'Readonly variable'
# invalid values
SET @@global.wsrep_recover=NULL;
ERROR HY000: Variable 'wsrep_recover' is a read only variable
SET @@global.wsrep_recover='junk';
ERROR HY000: Variable 'wsrep_recover' is a read only variable
# End of test
set @start_value = @@wsrep_replicate_myisam;
set @@global.wsrep_replicate_myisam=ON;
set @@global.wsrep_replicate_myisam=OFF;
set @@global.wsrep_replicate_myisam=1;
set @@global.wsrep_replicate_myisam=0;
SET @@global.wsrep_replicate_myisam = -1;
ERROR 42000: Variable 'wsrep_replicate_myisam' can't be set to the value of '-1'
set @@global.wsrep_replicate_myisam = @start_value;
#
# wsrep_replicate_myisam
#
# save the initial value
SET @wsrep_replicate_myisam_global_saved = @@global.wsrep_replicate_myisam;
# default
SELECT @@global.wsrep_replicate_myisam;
@@global.wsrep_replicate_myisam
0
SELECT @@session.wsrep_replicate_myisam;
ERROR HY000: Variable 'wsrep_replicate_myisam' is a GLOBAL variable
# scope and valid values
SET @@global.wsrep_replicate_myisam=OFF;
SELECT @@global.wsrep_replicate_myisam;
@@global.wsrep_replicate_myisam
0
SET @@global.wsrep_replicate_myisam=ON;
SELECT @@global.wsrep_replicate_myisam;
@@global.wsrep_replicate_myisam
1
# invalid values
SET @@global.wsrep_replicate_myisam=NULL;
ERROR 42000: Variable 'wsrep_replicate_myisam' can't be set to the value of 'NULL'
SET @@global.wsrep_replicate_myisam='junk';
ERROR 42000: Variable 'wsrep_replicate_myisam' can't be set to the value of 'junk'
# restore the initial value
SET @@global.wsrep_replicate_myisam = @wsrep_replicate_myisam_global_saved;
# End of test
set @start_value = @@wsrep_restart_slave;
set @@global.wsrep_restart_slave=ON;
set @@global.wsrep_restart_slave=OFF;
set @@global.wsrep_restart_slave=1;
set @@global.wsrep_restart_slave=0;
SET @@global.wsrep_restart_slave = -1;
ERROR 42000: Variable 'wsrep_restart_slave' can't be set to the value of '-1'
set @@global.wsrep_restart_slave = @start_value;
#
# wsrep_restart_slave
#
# save the initial value
SET @wsrep_restart_slave_global_saved = @@global.wsrep_restart_slave;
# default
SELECT @@global.wsrep_restart_slave;
@@global.wsrep_restart_slave
0
SELECT @@session.wsrep_restart_slave;
ERROR HY000: Variable 'wsrep_restart_slave' is a GLOBAL variable
# scope and valid values
SET @@global.wsrep_restart_slave=OFF;
SELECT @@global.wsrep_restart_slave;
@@global.wsrep_restart_slave
0
SET @@global.wsrep_restart_slave=ON;
SELECT @@global.wsrep_restart_slave;
@@global.wsrep_restart_slave
1
# invalid values
SET @@global.wsrep_restart_slave=NULL;
ERROR 42000: Variable 'wsrep_restart_slave' can't be set to the value of 'NULL'
SET @@global.wsrep_restart_slave='junk';
ERROR 42000: Variable 'wsrep_restart_slave' can't be set to the value of 'junk'
# restore the initial value
SET @@global.wsrep_restart_slave = @wsrep_restart_slave_global_saved;
# End of test
set @start_value = @@wsrep_restart_slave;
set @@global.wsrep_restart_slave=ON;
set @@global.wsrep_restart_slave=OFF;
set @@global.wsrep_restart_slave=1;
set @@global.wsrep_restart_slave=0;
SET @@global.wsrep_restart_slave = -1;
ERROR 42000: Variable 'wsrep_restart_slave' can't be set to the value of '-1'
set @@global.wsrep_restart_slave = @start_value;
#
# wsrep_retry_autocommit
#
# save the initial values
SET @wsrep_retry_autocommit_global_saved = @@global.wsrep_retry_autocommit;
SET @wsrep_retry_autocommit_session_saved = @@session.wsrep_retry_autocommit;
# default
SELECT @@global.wsrep_retry_autocommit;
@@global.wsrep_retry_autocommit
1
# scope
SET @@session.wsrep_retry_autocommit=1;
SELECT @@session.wsrep_retry_autocommit;
@@session.wsrep_retry_autocommit
1
SET @@global.wsrep_retry_autocommit=1;
SELECT @@global.wsrep_retry_autocommit;
@@global.wsrep_retry_autocommit
1
# valid values
SET @@global.wsrep_retry_autocommit=10;
SELECT @@global.wsrep_retry_autocommit;
@@global.wsrep_retry_autocommit
10
SET @@global.wsrep_retry_autocommit=0;
SELECT @@global.wsrep_retry_autocommit;
@@global.wsrep_retry_autocommit
0
SET @@global.wsrep_retry_autocommit=default;
SELECT @global.wsrep_retry_autocommit;
@global.wsrep_retry_autocommit
NULL
SET @@session.wsrep_retry_autocommit=10;
SELECT @@session.wsrep_retry_autocommit;
@@session.wsrep_retry_autocommit
10
SET @@session.wsrep_retry_autocommit=0;
SELECT @@session.wsrep_retry_autocommit;
@@session.wsrep_retry_autocommit
0
SET @@session.wsrep_retry_autocommit=default;
SELECT @session.wsrep_retry_autocommit;
@session.wsrep_retry_autocommit
NULL
# invalid values
SET @@global.wsrep_retry_autocommit=NULL;
ERROR 42000: Incorrect argument type to variable 'wsrep_retry_autocommit'
SET @@global.wsrep_retry_autocommit='junk';
ERROR 42000: Incorrect argument type to variable 'wsrep_retry_autocommit'
SET @@global.wsrep_retry_autocommit=-1;
Warnings:
Warning 1292 Truncated incorrect wsrep_retry_autocommit value: '-1'
SELECT @global.wsrep_retry_autocommit;
@global.wsrep_retry_autocommit
NULL
# restore the initial value
SET @@global.wsrep_retry_autocommit = @wsrep_retry_autocommit_global_saved;
SET @@session.wsrep_retry_autocommit = @wsrep_retry_autocommit_session_saved;
# End of test
set @start_value = @@wsrep_slave_threads;
set @@global.wsrep_slave_threads=1;
set @@global.wsrep_slave_threads=4;
show warnings;
Level Code Message
set @@global.wsrep_slave_threads=0;
#
# wsrep_slave_threads
#
# save the initial value
SET @wsrep_slave_threads_global_saved = @@global.wsrep_slave_threads;
# default
SELECT @@global.wsrep_slave_threads;
@@global.wsrep_slave_threads
1
# scope
SELECT @@session.wsrep_slave_threads;
ERROR HY000: Variable 'wsrep_slave_threads' is a GLOBAL variable
SET @@global.wsrep_slave_threads=1;
SELECT @@global.wsrep_slave_threads;
@@global.wsrep_slave_threads
1
# valid values
SET @@global.wsrep_slave_threads=10;
SELECT @@global.wsrep_slave_threads;
@@global.wsrep_slave_threads
10
SET @@global.wsrep_slave_threads=0;
Warnings:
Warning 1292 Truncated incorrect wsrep_slave_threads value: '0'
show warnings;
Level Code Message
Warning 1292 Truncated incorrect wsrep_slave_threads value: '0'
set @@global.wsrep_slave_threads=-1;
SELECT @@global.wsrep_slave_threads;
@@global.wsrep_slave_threads
1
SET @@global.wsrep_slave_threads=default;
SELECT @global.wsrep_slave_threads;
@global.wsrep_slave_threads
NULL
# invalid values
SET @@global.wsrep_slave_threads=NULL;
ERROR 42000: Incorrect argument type to variable 'wsrep_slave_threads'
SET @@global.wsrep_slave_threads='junk';
ERROR 42000: Incorrect argument type to variable 'wsrep_slave_threads'
SET @@global.wsrep_slave_threads=-1;
Warnings:
Warning 1292 Truncated incorrect wsrep_slave_threads value: '-1'
show warnings;
Level Code Message
Warning 1292 Truncated incorrect wsrep_slave_threads value: '-1'
SET @@global.wsrep_slave_threads = r;
ERROR 42000: Incorrect argument type to variable 'wsrep_slave_threads'
set @@global.wsrep_slave_threads = @start_value;
SELECT @global.wsrep_slave_threads;
@global.wsrep_slave_threads
NULL
# restore the initial value
SET @@global.wsrep_slave_threads = @wsrep_slave_threads_global_saved;
# End of test
SELECT COUNT(@@wsrep_sst_auth);
COUNT(@@wsrep_sst_auth)
0
#
# wsrep_sst_auth
#
# save the initial value
SET @wsrep_sst_auth_global_saved = @@global.wsrep_sst_auth;
# default
SELECT @@global.wsrep_sst_auth;
@@global.wsrep_sst_auth
NULL
# scope
SELECT @@session.wsrep_sst_auth;
ERROR HY000: Variable 'wsrep_sst_auth' is a GLOBAL variable
SET @@global.wsrep_sst_auth='user:pass';
SELECT @@global.wsrep_sst_auth;
@@global.wsrep_sst_auth
********
# valid values
SET @@global.wsrep_sst_auth=user;
SELECT @@global.wsrep_sst_auth;
@@global.wsrep_sst_auth
********
SET @@global.wsrep_sst_auth='user:1234';
SELECT @@global.wsrep_sst_auth;
@@global.wsrep_sst_auth
********
SET @@global.wsrep_sst_auth='hyphenated-user-name:';
SELECT @@global.wsrep_sst_auth;
@@global.wsrep_sst_auth
********
SET @@global.wsrep_sst_auth=default;
SELECT @@global.wsrep_sst_auth;
@@global.wsrep_sst_auth
NULL
SET @@global.wsrep_sst_auth=NULL;
SELECT @@global.wsrep_sst_auth;
@@global.wsrep_sst_auth
NULL
# invalid values
SET @@global.wsrep_sst_auth=1;
ERROR 42000: Incorrect argument type to variable 'wsrep_sst_auth'
SELECT @@global.wsrep_sst_auth;
@@global.wsrep_sst_auth
NULL
SET @@global.wsrep_sst_auth=user:pass;
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':pass' at line 1
# restore the initial value
SET @@global.wsrep_sst_auth = @wsrep_sst_auth_global_saved;
# End of test
SELECT COUNT(@@wsrep_sst_donor);
COUNT(@@wsrep_sst_donor)
1
set @start_value = @@wsrep_sst_donor;
set @@global.wsrep_sst_donor='foo';
set @@global.wsrep_sst_donor=NULL;
set @@global.wsrep_sst_donor=r;
set @@global.wsrep_sst_donor=1;
#
# wsrep_sst_donor
#
# save the initial value
SET @wsrep_sst_donor_global_saved = @@global.wsrep_sst_donor;
# default
SELECT @@global.wsrep_sst_donor;
@@global.wsrep_sst_donor
# scope
SELECT @@session.wsrep_sst_donor;
ERROR HY000: Variable 'wsrep_sst_donor' is a GLOBAL variable
SET @@global.wsrep_sst_donor=rsync;
SELECT @@global.wsrep_sst_donor;
@@global.wsrep_sst_donor
rsync
# valid values
SET @@global.wsrep_sst_donor=node1;
SELECT @@global.wsrep_sst_donor;
@@global.wsrep_sst_donor
node1
SET @@global.wsrep_sst_donor='node1,node2';
SELECT @@global.wsrep_sst_donor;
@@global.wsrep_sst_donor
node1,node2
SET @@global.wsrep_sst_donor='hyphenated-donor-name';
SELECT @@global.wsrep_sst_donor;
@@global.wsrep_sst_donor
hyphenated-donor-name
SET @@global.wsrep_sst_donor=default;
SELECT @@global.wsrep_sst_donor;
@@global.wsrep_sst_donor
SET @@global.wsrep_sst_donor=NULL;
SELECT @@global.wsrep_sst_donor;
@@global.wsrep_sst_donor
NULL
# invalid values
SET @@global.wsrep_sst_donor=1;
ERROR 42000: Incorrect argument type to variable 'wsrep_sst_donor'
set @@global.wsrep_sst_donor = @start_value;
SELECT @@global.wsrep_sst_donor;
@@global.wsrep_sst_donor
NULL
# restore the initial value
SET @@global.wsrep_sst_donor = @wsrep_sst_donor_global_saved;
# End of test
set @start_value = @@wsrep_sst_donor_rejects_queries;
set @@global.wsrep_sst_donor_rejects_queries=ON;
set @@global.wsrep_sst_donor_rejects_queries=OFF;
set @@global.wsrep_sst_donor_rejects_queries=1;
set @@global.wsrep_sst_donor_rejects_queries=0;
SET @@global.wsrep_sst_donor_rejects_queries = -1;
ERROR 42000: Variable 'wsrep_sst_donor_rejects_queries' can't be set to the value of '-1'
set @@global.wsrep_sst_donor_rejects_queries = @start_value;
#
# wsrep_sst_donor_rejects_queries
#
# save the initial value
SET @wsrep_sst_donor_rejects_queries_global_saved = @@global.wsrep_sst_donor_rejects_queries;
# default
SELECT @@global.wsrep_sst_donor_rejects_queries;
@@global.wsrep_sst_donor_rejects_queries
0
# scope
SELECT @@session.wsrep_sst_donor_rejects_queries;
ERROR HY000: Variable 'wsrep_sst_donor_rejects_queries' is a GLOBAL variable
SET @@global.wsrep_sst_donor_rejects_queries=OFF;
SELECT @@global.wsrep_sst_donor_rejects_queries;
@@global.wsrep_sst_donor_rejects_queries
0
SET @@global.wsrep_sst_donor_rejects_queries=ON;
SELECT @@global.wsrep_sst_donor_rejects_queries;
@@global.wsrep_sst_donor_rejects_queries
1
# valid values
SET @@global.wsrep_sst_donor_rejects_queries='OFF';
SELECT @@global.wsrep_sst_donor_rejects_queries;
@@global.wsrep_sst_donor_rejects_queries
0
SET @@global.wsrep_sst_donor_rejects_queries=ON;
SELECT @@global.wsrep_sst_donor_rejects_queries;
@@global.wsrep_sst_donor_rejects_queries
1
SET @@global.wsrep_sst_donor_rejects_queries=default;
SELECT @@global.wsrep_sst_donor_rejects_queries;
@@global.wsrep_sst_donor_rejects_queries
0
# invalid values
SET @@global.wsrep_sst_donor_rejects_queries=NULL;
ERROR 42000: Variable 'wsrep_sst_donor_rejects_queries' can't be set to the value of 'NULL'
SET @@global.wsrep_sst_donor_rejects_queries='junk';
ERROR 42000: Variable 'wsrep_sst_donor_rejects_queries' can't be set to the value of 'junk'
# restore the initial value
SET @@global.wsrep_sst_donor_rejects_queries = @wsrep_sst_donor_rejects_queries_global_saved;
# End of test
set @start_value = @@wsrep_sst_method;
set @@global.wsrep_sst_method='xtrabackup';
set @@global.wsrep_sst_method='xtrabackup-v2';
set @@global.wsrep_sst_method='rsync';
set @@global.wsrep_sst_method='mysqldump';
set @@global.wsrep_sst_method='myscript';
set @@global.wsrep_sst_method='skip';
set @@global.wsrep_sst_method=NULL;
#
# wsrep_sst_method
#
# save the initial value
SET @wsrep_sst_method_global_saved = @@global.wsrep_sst_method;
# default
SELECT @@global.wsrep_sst_method;
@@global.wsrep_sst_method
rsync
# scope
SELECT @@session.wsrep_sst_method;
ERROR HY000: Variable 'wsrep_sst_method' is a GLOBAL variable
SET @@global.wsrep_sst_method=rsync;
SELECT @@global.wsrep_sst_method;
@@global.wsrep_sst_method
rsync
# valid values
SET @@global.wsrep_sst_method=rsync;
SELECT @@global.wsrep_sst_method;
@@global.wsrep_sst_method
rsync
SET @@global.wsrep_sst_method=mysqldump;
SELECT @@global.wsrep_sst_method;
@@global.wsrep_sst_method
mysqldump
SET @@global.wsrep_sst_method=xtrabackup;
SELECT @@global.wsrep_sst_method;
@@global.wsrep_sst_method
xtrabackup
SET @@global.wsrep_sst_method="xtrabackup-v2";
SELECT @@global.wsrep_sst_method;
@@global.wsrep_sst_method
xtrabackup-v2
SET @@global.wsrep_sst_method=default;
SELECT @@global.wsrep_sst_method;
@@global.wsrep_sst_method
rsync
SET @@global.wsrep_sst_method='junk';
SELECT @@global.wsrep_sst_method;
@@global.wsrep_sst_method
junk
# invalid values
SET @@global.wsrep_sst_method=NULL;
ERROR 42000: Variable 'wsrep_sst_method' can't be set to the value of 'NULL'
SET @@global.wsrep_sst_method = -1;
ERROR 42000: Incorrect argument type to variable 'wsrep_sst_method'
set @@global.wsrep_sst_method = @start_value;
SELECT @@global.wsrep_sst_method;
@@global.wsrep_sst_method
junk
# restore the initial value
SET @@global.wsrep_sst_method = @wsrep_sst_method_global_saved;
# End of test
set @start_value = @@wsrep_sst_receive_address;
set @@global.wsrep_sst_receive_address='128.0.2.1';
set @@global.wsrep_sst_receive_address=AUTO;
set @@global.wsrep_sst_receive_address='AUTO';
set @@global.wsrep_sst_receive_address=NULL;
SET @@global.wsrep_sst_receive_address = -1;
ERROR 42000: Incorrect argument type to variable 'wsrep_sst_receive_address'
set @@global.wsrep_sst_receive_address = @start_value;
#
# wsrep_sst_receive_address
#
# save the initial value
SET @wsrep_sst_receive_address_global_saved = @@global.wsrep_sst_receive_address;
# default
SELECT @@global.wsrep_sst_receive_address;
@@global.wsrep_sst_receive_address
AUTO
# scope
SELECT @@session.wsrep_sst_receive_address;
ERROR HY000: Variable 'wsrep_sst_receive_address' is a GLOBAL variable
SELECT @@global.wsrep_sst_receive_address;
@@global.wsrep_sst_receive_address
AUTO
# valid values
SET @@global.wsrep_sst_receive_address=AUTO;
SELECT @@global.wsrep_sst_receive_address;
@@global.wsrep_sst_receive_address
AUTO
SET @@global.wsrep_sst_receive_address=default;
SELECT @@global.wsrep_sst_receive_address;
@@global.wsrep_sst_receive_address
AUTO
SET @@global.wsrep_sst_receive_address='192.168.2.254';
SELECT @@global.wsrep_sst_receive_address;
@@global.wsrep_sst_receive_address
192.168.2.254
# invalid values
SET @@global.wsrep_sst_receive_address='127.0.0.1:4444';
ERROR 42000: Variable 'wsrep_sst_receive_address' can't be set to the value of '127.0.0.1:4444'
SET @@global.wsrep_sst_receive_address='127.0.0.1';
ERROR 42000: Variable 'wsrep_sst_receive_address' can't be set to the value of '127.0.0.1'
SELECT @@global.wsrep_sst_receive_address;
@@global.wsrep_sst_receive_address
192.168.2.254
SET @@global.wsrep_sst_receive_address=NULL;
ERROR 42000: Variable 'wsrep_sst_receive_address' can't be set to the value of 'NULL'
SELECT @@global.wsrep_sst_receive_address;
@@global.wsrep_sst_receive_address
192.168.2.254
SET @@global.wsrep_sst_receive_address='OFF';
SELECT @@global.wsrep_sst_receive_address;
@@global.wsrep_sst_receive_address
OFF
SET @@global.wsrep_sst_receive_address=ON;
SELECT @@global.wsrep_sst_receive_address;
@@global.wsrep_sst_receive_address
ON
SET @@global.wsrep_sst_receive_address='';
SELECT @@global.wsrep_sst_receive_address;
@@global.wsrep_sst_receive_address
SET @@global.wsrep_sst_receive_address='junk';
SELECT @@global.wsrep_sst_receive_address;
@@global.wsrep_sst_receive_address
junk
# restore the initial value
SET @@global.wsrep_sst_receive_address = @wsrep_sst_receive_address_global_saved;
# End of test
set @start_value = @@wsrep_start_position;
set @@global.wsrep_start_position='foo:bar';
ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of 'foo:bar'
set @@global.wsrep_start_position=NULL;
#
# wsrep_start_position
#
# save the initial value
SET @wsrep_start_position_global_saved = @@global.wsrep_start_position;
# default
SELECT @@global.wsrep_start_position;
@@global.wsrep_start_position
00000000-0000-0000-0000-000000000000:-1
# scope
SELECT @@session.wsrep_start_position;
ERROR HY000: Variable 'wsrep_start_position' is a GLOBAL variable
SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-1';
SELECT @@global.wsrep_start_position;
@@global.wsrep_start_position
00000000-0000-0000-0000-000000000000:-1
# valid values
SET @@global.wsrep_start_position='00000000-0000-0000-0000-000000000000:-2';
SELECT @@global.wsrep_start_position;
@@global.wsrep_start_position
00000000-0000-0000-0000-000000000000:-2
SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:100';
SELECT @@global.wsrep_start_position;
@@global.wsrep_start_position
12345678-1234-1234-1234-123456789012:100
SET @@global.wsrep_start_position=default;
SELECT @@global.wsrep_start_position;
@@global.wsrep_start_position
00000000-0000-0000-0000-000000000000:-1
# invalid values
SET @@global.wsrep_start_position='000000000000000-0000-0000-0000-000000000000:-1';
ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '000000000000000-0000-0000-0000-000000000000:-1'
SET @@global.wsrep_start_position='12345678-1234-1234-12345-123456789012:100';
ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-12345-123456789012:100'
SET @@global.wsrep_start_position='12345678-1234-123-12345-123456789012:0';
ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-123-12345-123456789012:0'
SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:_99999';
ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-1234-123456789012:_99999'
SET @@global.wsrep_start_position='12345678-1234-1234-1234-123456789012:a';
ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of '12345678-1234-1234-1234-123456789012:a'
SET @@global.wsrep_start_position='OFF';
ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of 'OFF'
SET @@global.wsrep_start_position=ON;
ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of 'ON'
SET @@global.wsrep_start_position='';
ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of ''
SET @@global.wsrep_start_position=NULL;
ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of 'NULL'
SET @@global.wsrep_start_position = -1;
ERROR 42000: Incorrect argument type to variable 'wsrep_start_position'
set @@global.wsrep_start_position = @start_value;
SET @@global.wsrep_start_position='junk';
ERROR 42000: Variable 'wsrep_start_position' can't be set to the value of 'junk'
# restore the initial value
SET @@global.wsrep_start_position = @wsrep_start_position_global_saved;
# End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_auto_increment_control;
--echo #
--echo # wsrep_auto_increment_control
--echo #
set @@global.wsrep_auto_increment_control=ON;
set @@global.wsrep_auto_increment_control=OFF;
set @@global.wsrep_auto_increment_control=1;
set @@global.wsrep_auto_increment_control=0;
--Error 1231
SET @@global.wsrep_auto_increment_control = -1;
--echo # save the initial value
SET @wsrep_auto_increment_control_global_saved = @@global.wsrep_auto_increment_control;
set @@global.wsrep_auto_increment_control = @start_value;
--echo # default
SELECT @@global.wsrep_auto_increment_control;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_auto_increment_control;
SET @@global.wsrep_auto_increment_control=OFF;
SELECT @@global.wsrep_auto_increment_control;
SET @@global.wsrep_auto_increment_control=ON;
SELECT @@global.wsrep_auto_increment_control;
--echo
--echo # valid values
SET @@global.wsrep_auto_increment_control='OFF';
SELECT @@global.wsrep_auto_increment_control;
SET @@global.wsrep_auto_increment_control=ON;
SELECT @@global.wsrep_auto_increment_control;
SET @@global.wsrep_auto_increment_control=default;
SELECT @@global.wsrep_auto_increment_control;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_auto_increment_control=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_auto_increment_control='junk';
--echo
--echo # restore the initial value
SET @@global.wsrep_auto_increment_control = @wsrep_auto_increment_control_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_causal_reads;
--echo #
--echo # wsrep_causal_reads
--echo #
set @@global.wsrep_causal_reads=ON;
set @@global.wsrep_causal_reads=OFF;
set @@global.wsrep_causal_reads=1;
set @@global.wsrep_causal_reads=0;
--Error 1231
SET @@global.wsrep_causal_reads = -1;
--echo # save the initial values
SET @wsrep_causal_reads_global_saved = @@global.wsrep_causal_reads;
SET @wsrep_causal_reads_session_saved = @@session.wsrep_causal_reads;
set @@global.wsrep_causal_reads = @start_value;
--echo # default
SELECT @@global.wsrep_causal_reads;
SELECT @@session.wsrep_causal_reads;
--echo
--echo # scope and valid values
SET @@global.wsrep_causal_reads=OFF;
SELECT @@global.wsrep_causal_reads;
SET @@global.wsrep_causal_reads=ON;
SELECT @@global.wsrep_causal_reads;
SET @@session.wsrep_causal_reads=OFF;
SELECT @@session.wsrep_causal_reads;
SET @@session.wsrep_causal_reads=ON;
SELECT @@session.wsrep_causal_reads;
SET @@session.wsrep_causal_reads=default;
SELECT @@session.wsrep_causal_reads;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_causal_reads=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_causal_reads='junk';
--error ER_WRONG_VALUE_FOR_VAR
SET @@session.wsrep_causal_reads=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@session.wsrep_causal_reads='junk';
--echo
--echo # restore the initial values
SET @@global.wsrep_causal_reads = @wsrep_causal_reads_global_saved;
SET @@session.wsrep_causal_reads = @wsrep_causal_reads_session_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
set @start_value = @@wsrep_certify_nonpk;
set @@global.wsrep_certify_nonpk=ON;
set @@global.wsrep_certify_nonpk=OFF;
set @@global.wsrep_certify_nonpk=1;
set @@global.wsrep_certify_nonpk=0;
--Error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_certify_nonpk = -1;
set @@global.wsrep_certify_nonpk = @start_value;
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_certify_nonpk;
--echo #
--echo # wsrep_certify_nonpk
--echo #
set @@global.wsrep_certify_nonpk=ON;
set @@global.wsrep_certify_nonpk=OFF;
set @@global.wsrep_certify_nonpk=1;
set @@global.wsrep_certify_nonpk=0;
--Error 1231
SET @@global.wsrep_certify_nonpk = -1;
--echo # save the initial value
SET @wsrep_certify_nonpk_global_saved = @@global.wsrep_certify_nonpk;
set @@global.wsrep_certify_nonpk = @start_value;
--echo # default
SELECT @@global.wsrep_certify_nonpk;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_certify_nonpk;
SET @@global.wsrep_certify_nonpk=OFF;
SELECT @@global.wsrep_certify_nonpk;
SET @@global.wsrep_certify_nonpk=ON;
SELECT @@global.wsrep_certify_nonpk;
--echo
--echo # valid values
SET @@global.wsrep_certify_nonpk='OFF';
SELECT @@global.wsrep_certify_nonpk;
SET @@global.wsrep_certify_nonpk=ON;
SELECT @@global.wsrep_certify_nonpk;
SET @@global.wsrep_certify_nonpk=default;
SELECT @@global.wsrep_certify_nonpk;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_certify_nonpk=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_certify_nonpk='junk';
--echo
--echo # restore the initial value
SET @@global.wsrep_certify_nonpk = @wsrep_certify_nonpk_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
SELECT COUNT(@@GLOBAL.wsrep_cluster_address);
--echo 1 Expected
SELECT COUNT(@@GLOBAL.wsrep_cluster_address);
--echo 1 Expected
SELECT @@GLOBAL.wsrep_cluster_address = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_cluster_address';
--echo 1 Expected
SELECT COUNT(@@GLOBAL.wsrep_cluster_address);
--echo 1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_cluster_address';
--echo 1 Expected
SELECT @@wsrep_cluster_address = @@GLOBAL.wsrep_cluster_address;
--echo 1 Expected
SELECT COUNT(@@wsrep_cluster_address);
--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.wsrep_cluster_address);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.wsrep_cluster_address);
--echo Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.wsrep_cluster_address);
--echo 1 Expected
--Error ER_BAD_FIELD_ERROR
SELECT wsrep_cluster_address = @@SESSION.wsrep_cluster_address;
--echo Expected error 'Readonly variable'
--source include/have_wsrep.inc
--echo #
--echo # wsrep_cluster_address
--echo #
call mtr.add_suppression("safe_mutex: Found wrong usage of mutex.*");
--echo # save the initial value
SET @wsrep_cluster_address_global_saved = @@global.wsrep_cluster_address;
--echo # default
SELECT @@global.wsrep_cluster_address;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_cluster_address;
SELECT @@global.wsrep_cluster_address;
--echo
--echo # valid values
SET @@global.wsrep_cluster_address='127.0.0.1';
SELECT @@global.wsrep_cluster_address;
SET @@global.wsrep_cluster_address=AUTO;
SELECT @@global.wsrep_cluster_address;
SET @@global.wsrep_cluster_address=default;
SELECT @@global.wsrep_cluster_address;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_node_address=NULL;
SELECT @@global.wsrep_node_address;
# The values being assigned to wsrep_node_address are not verified so the
# following alues are currently valid too.
SET @@global.wsrep_cluster_address=ON;
SELECT @@global.wsrep_cluster_address;
SET @@global.wsrep_cluster_address='OFF';
SELECT @@global.wsrep_cluster_address;
SET @@global.wsrep_cluster_address='junk';
SELECT @@global.wsrep_cluster_address;
--echo
--echo # restore the initial value
SET @@global.wsrep_cluster_address = @wsrep_cluster_address_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_cluster_name;
--echo #
--echo # wsrep_cluster_name
--echo #
set @@global.wsrep_cluster_name='test';
--Error 1231
set @@global.wsrep_cluster_name=NULL;
--Error 1232
SET @@global.wsrep_cluster_name = 1;
--echo # save the initial value
SET @wsrep_cluster_name_global_saved = @@global.wsrep_cluster_name;
set @@global.wsrep_cluster_name = @start_value;
\ No newline at end of file
--echo # default
SELECT @@global.wsrep_cluster_name;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_cluster_name;
SET @@global.wsrep_cluster_name='my_galera_cluster';
SELECT @@global.wsrep_cluster_name;
--echo
--echo # valid values
SET @@global.wsrep_cluster_name='my_quoted_galera_cluster';
SELECT @@global.wsrep_cluster_name;
SET @@global.wsrep_cluster_name=my_unquoted_cluster;
SELECT @@global.wsrep_cluster_name;
SET @@global.wsrep_cluster_name=OFF;
SELECT @@global.wsrep_cluster_name;
SET @@global.wsrep_cluster_name=default;
SELECT @@global.wsrep_cluster_name;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_cluster_name=NULL;
--echo
--echo # restore the initial value
SET @@global.wsrep_cluster_name = @wsrep_cluster_name_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_convert_lock_to_trx;
--echo #
--echo # wsrep_convert_lock_to_trx
--echo #
set @@global.wsrep_convert_lock_to_trx=ON;
set @@global.wsrep_convert_lock_to_trx=OFF;
set @@global.wsrep_convert_lock_to_trx=1;
set @@global.wsrep_convert_lock_to_trx=0;
--Error 1231
SET @@global.wsrep_convert_lock_to_trx = -1;
--echo # save the initial value
SET @wsrep_convert_lock_to_trx_global_saved = @@global.wsrep_convert_lock_to_trx;
set @@global.wsrep_convert_lock_to_trx = @start_value;
\ No newline at end of file
--echo # default
SELECT @@global.wsrep_convert_lock_to_trx;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_convert_lock_to_trx;
SET @@global.wsrep_convert_lock_to_trx=OFF;
SELECT @@global.wsrep_convert_lock_to_trx;
SET @@global.wsrep_convert_lock_to_trx=ON;
SELECT @@global.wsrep_convert_lock_to_trx;
--echo
--echo # valid values
SET @@global.wsrep_convert_lock_to_trx='OFF';
SELECT @@global.wsrep_convert_lock_to_trx;
SET @@global.wsrep_convert_lock_to_trx=ON;
SELECT @@global.wsrep_convert_lock_to_trx;
SET @@global.wsrep_convert_lock_to_trx=default;
SELECT @@global.wsrep_convert_lock_to_trx;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_convert_lock_to_trx=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_convert_lock_to_trx='junk';
--echo
--echo # restore the initial value
SET @@global.wsrep_convert_lock_to_trx = @wsrep_convert_lock_to_trx_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
SELECT COUNT(@@GLOBAL.wsrep_data_home_dir);
--echo 1 Expected
--echo #
--echo # wsrep_data_home_dir (readonly)
--echo #
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@GLOBAL.wsrep_data_home_dir=1;
--echo Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.wsrep_data_home_dir);
--echo 1 Expected
SELECT @@GLOBAL.wsrep_data_home_dir = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_data_home_dir';
--echo 1 Expected
SELECT COUNT(@@GLOBAL.wsrep_data_home_dir);
--echo 1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_data_home_dir';
--echo 1 Expected
SELECT @@wsrep_data_home_dir = @@GLOBAL.wsrep_data_home_dir;
--echo 1 Expected
SELECT COUNT(@@wsrep_data_home_dir);
--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.wsrep_data_home_dir);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.wsrep_data_home_dir);
--echo Expected error 'Variable is a GLOBAL variable'
--echo # default
SELECT @@global.wsrep_data_home_dir;
SELECT COUNT(@@GLOBAL.wsrep_data_home_dir);
--echo 1 Expected
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_data_home_dir;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_data_home_dir='/tmp/data';
SELECT @@global.wsrep_data_home_dir;
--Error ER_BAD_FIELD_ERROR
SELECT wsrep_data_home_dir = @@SESSION.wsrep_data_home_dir;
--echo Expected error 'Readonly variable'
--echo
--echo # valid values
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_data_home_dir='/tmp/data';
SELECT @@global.wsrep_data_home_dir;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_data_home_dir=junk-dir;
SELECT @@global.wsrep_data_home_dir;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_data_home_dir=junk/dir;
SELECT @@global.wsrep_data_home_dir;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_data_home_dir=OFF;
SELECT @@global.wsrep_data_home_dir;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_data_home_dir=default;
SELECT @@global.wsrep_data_home_dir;
--echo
--echo # invalid values
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_data_home_dir=NULL;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_dbug_option;
--echo #
--echo # wsrep_dbug_option
--echo #
set @@global.wsrep_dbug_option='foo:bar';
set @@global.wsrep_dbug_option=NULL;
--Error 1232
SET @@global.wsrep_dbug_option = -1;
--echo # save the initial value
SET @wsrep_dbug_option_global_saved = @@global.wsrep_dbug_option;
set @@global.wsrep_dbug_option = @start_value;
--echo # default
SELECT @@global.wsrep_dbug_option;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_dbug_option;
SET @@global.wsrep_dbug_option='test-dbug-string';
SELECT @@global.wsrep_dbug_option;
--echo
--echo # valid values
SET @@global.wsrep_dbug_option='quoted-dbug-string';
SELECT @@global.wsrep_dbug_option;
SET @@global.wsrep_dbug_option=unquoted_dbug_string;
SELECT @@global.wsrep_dbug_option;
SET @@global.wsrep_dbug_option=OFF;
SELECT @@global.wsrep_dbug_option;
SET @@global.wsrep_dbug_option=NULL;
SELECT @@global.wsrep_dbug_option;
SET @@global.wsrep_dbug_option=default;
SELECT @@global.wsrep_dbug_option;
--echo
--echo # invalid values
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_dbug_option=1;
--echo
--echo # restore the initial value
SET @@global.wsrep_dbug_option = @wsrep_dbug_option_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_debug;
--echo #
--echo # wsrep_debug
--echo #
set @@global.wsrep_debug=ON;
set @@global.wsrep_debug=OFF;
set @@global.wsrep_debug=1;
set @@global.wsrep_debug=0;
--Error 1231
SET @@global.wsrep_debug = -1;
--echo # save the initial value
SET @wsrep_debug_global_saved = @@global.wsrep_debug;
set @@global.wsrep_debug = @start_value;
\ No newline at end of file
--echo # default
SELECT @@global.wsrep_debug;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_debug;
SET @@global.wsrep_debug=OFF;
SELECT @@global.wsrep_debug;
SET @@global.wsrep_debug=ON;
SELECT @@global.wsrep_debug;
--echo
--echo # valid values
SET @@global.wsrep_debug='OFF';
SELECT @@global.wsrep_debug;
SET @@global.wsrep_debug=ON;
SELECT @@global.wsrep_debug;
SET @@global.wsrep_debug=default;
SELECT @@global.wsrep_debug;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_debug=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_debug='junk';
--echo
--echo # restore the initial value
SET @@global.wsrep_debug = @wsrep_debug_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
set @start_value = @@wsrep_debug_option;
--error 1231
set @@global.wsrep_debug_option='foo:bar';
--error 1231
set @@global.wsrep_debug_option=NULL;
--Error 1232
SET @@global.wsrep_debug_option = -1;
set @@global.wsrep_debug_option = @start_value;
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
select @@global.wsrep_desync;
--echo #
--echo # wsrep_desync
--echo #
# expected as no wsrep provider is currently loaded
call mtr.add_suppression("WSREP: SET desync failed 9 for SET @@global.wsrep_desync=ON");
--echo # save the initial value
SET @wsrep_desync_global_saved = @@global.wsrep_desync;
--echo # default
SELECT @@global.wsrep_desync;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_desync;
SET @@global.wsrep_desync=OFF;
SELECT @@global.wsrep_desync;
# expected as no wsrep provider is currently loaded
--error ER_CANNOT_USER
SET @@global.wsrep_desync=ON;
SELECT @@global.wsrep_desync;
--echo
--echo # valid values
SET @@global.wsrep_desync='OFF';
SELECT @@global.wsrep_desync;
# expected as no wsrep provider is currently loaded
--error ER_CANNOT_USER
SET @@global.wsrep_desync=ON;
SELECT @@global.wsrep_desync;
SET @@global.wsrep_desync=default;
SELECT @@global.wsrep_desync;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_desync=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_desync='junk';
--echo
--echo # restore the initial value
SET @@global.wsrep_desync = @wsrep_desync_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_drupal_282555_workaround;
--echo #
--echo # wsrep_drupal_282555_workaround
--echo #
set @@global.wsrep_drupal_282555_workaround=ON;
set @@global.wsrep_drupal_282555_workaround=OFF;
set @@global.wsrep_drupal_282555_workaround=1;
set @@global.wsrep_drupal_282555_workaround=0;
--Error 1231
SET @@global.wsrep_drupal_282555_workaround = -1;
--echo # save the initial value
SET @wsrep_drupal_282555_workaround_global_saved = @@global.wsrep_drupal_282555_workaround;
set @@global.wsrep_drupal_282555_workaround = @start_value;
\ No newline at end of file
--echo # default
SELECT @@global.wsrep_drupal_282555_workaround;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_drupal_282555_workaround;
SET @@global.wsrep_drupal_282555_workaround=OFF;
SELECT @@global.wsrep_drupal_282555_workaround;
SET @@global.wsrep_drupal_282555_workaround=ON;
SELECT @@global.wsrep_drupal_282555_workaround;
--echo
--echo # valid values
SET @@global.wsrep_drupal_282555_workaround='OFF';
SELECT @@global.wsrep_drupal_282555_workaround;
SET @@global.wsrep_drupal_282555_workaround=ON;
SELECT @@global.wsrep_drupal_282555_workaround;
SET @@global.wsrep_drupal_282555_workaround=default;
SELECT @@global.wsrep_drupal_282555_workaround;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_drupal_282555_workaround=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_drupal_282555_workaround='junk';
--echo
--echo # restore the initial value
SET @@global.wsrep_drupal_282555_workaround = @wsrep_drupal_282555_workaround_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_forced_binlog_format;
--echo #
--echo # wsrep_forced_binlog_format
--echo #
set @@global.wsrep_forced_binlog_format = ROW;
set @@global.wsrep_forced_binlog_format = MIXED;
set @@global.wsrep_forced_binlog_format = STATEMENT;
set @@global.wsrep_forced_binlog_format = NONE;
--echo # save the initial value
SET @wsrep_forced_binlog_format_global_saved = @@global.wsrep_forced_binlog_format;
--error 1231
set @@global.wsrep_forced_binlog_format = FOO;
--echo # default
SELECT @@global.wsrep_forced_binlog_format;
set @@global.wsrep_forced_binlog_format = @start_value;
\ No newline at end of file
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_forced_binlog_format;
SET @@global.wsrep_forced_binlog_format=STATEMENT;
SELECT @@global.wsrep_forced_binlog_format;
--echo
--echo # valid values
SET @@global.wsrep_forced_binlog_format=STATEMENT;
SELECT @@global.wsrep_forced_binlog_format;
SET @@global.wsrep_forced_binlog_format=ROW;
SELECT @@global.wsrep_forced_binlog_format;
SET @@global.wsrep_forced_binlog_format=MIXED;
SELECT @@global.wsrep_forced_binlog_format;
SET @@global.wsrep_forced_binlog_format=NONE;
SELECT @@global.wsrep_forced_binlog_format;
SET @@global.wsrep_forced_binlog_format=default;
SELECT @@global.wsrep_forced_binlog_format;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_forced_binlog_format=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_forced_binlog_format='junk';
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_forced_binlog_format=ON;
--echo
--echo # restore the initial value
SET @@global.wsrep_forced_binlog_format = @wsrep_forced_binlog_format_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_load_data_splitting;
--echo #
--echo # wsrep_load_data_splitting
--echo #
set @@global.wsrep_load_data_splitting=ON;
set @@global.wsrep_load_data_splitting=OFF;
set @@global.wsrep_load_data_splitting=1;
set @@global.wsrep_load_data_splitting=0;
--Error 1231
SET @@global.wsrep_load_data_splitting = -1;
--echo # save the initial value
SET @wsrep_load_data_splitting_global_saved = @@global.wsrep_load_data_splitting;
set @@global.wsrep_load_data_splitting = @start_value;
\ No newline at end of file
--echo # default
SELECT @@global.wsrep_load_data_splitting;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_load_data_splitting;
SET @@global.wsrep_load_data_splitting=OFF;
SELECT @@global.wsrep_load_data_splitting;
SET @@global.wsrep_load_data_splitting=ON;
SELECT @@global.wsrep_load_data_splitting;
--echo
--echo # valid values
SET @@global.wsrep_load_data_splitting='OFF';
SELECT @@global.wsrep_load_data_splitting;
SET @@global.wsrep_load_data_splitting=ON;
SELECT @@global.wsrep_load_data_splitting;
SET @@global.wsrep_load_data_splitting=default;
SELECT @@global.wsrep_load_data_splitting;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_load_data_splitting=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_load_data_splitting='junk';
--echo
--echo # restore the initial value
SET @@global.wsrep_load_data_splitting = @wsrep_load_data_splitting_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_log_conflicts;
--echo #
--echo # wsrep_log_conflicts
--echo #
set @@global.wsrep_log_conflicts=ON;
set @@global.wsrep_log_conflicts=OFF;
set @@global.wsrep_log_conflicts=1;
set @@global.wsrep_log_conflicts=0;
--Error 1231
SET @@global.wsrep_log_conflicts = -1;
--echo # save the initial value
SET @wsrep_log_conflicts_global_saved = @@global.wsrep_log_conflicts;
set @@global.wsrep_log_conflicts = @start_value;
\ No newline at end of file
--echo # default
SELECT @@global.wsrep_log_conflicts;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_log_conflicts;
SET @@global.wsrep_log_conflicts=OFF;
SELECT @@global.wsrep_log_conflicts;
SET @@global.wsrep_log_conflicts=ON;
SELECT @@global.wsrep_log_conflicts;
--echo
--echo # valid values
SET @@global.wsrep_log_conflicts='OFF';
SELECT @@global.wsrep_log_conflicts;
SET @@global.wsrep_log_conflicts=ON;
SELECT @@global.wsrep_log_conflicts;
SET @@global.wsrep_log_conflicts=default;
SELECT @@global.wsrep_log_conflicts;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_log_conflicts=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_log_conflicts='junk';
--echo
--echo # restore the initial value
SET @@global.wsrep_log_conflicts = @wsrep_log_conflicts_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_max_ws_rows;
--echo #
--echo # wsrep_max_ws_rows
--echo #
set @@global.wsrep_max_ws_rows=256000;
set @@global.wsrep_max_ws_rows=0;
show warnings;
set @@global.wsrep_max_ws_rows=-1;
show warnings;
--Error 1232
SET @@global.wsrep_max_ws_rows = r;
--echo # save the initial value
SET @wsrep_max_ws_rows_global_saved = @@global.wsrep_max_ws_rows;
set @@global.wsrep_max_ws_rows = @start_value;
\ No newline at end of file
--echo # default
SELECT @@global.wsrep_max_ws_rows;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_max_ws_rows;
SET @@global.wsrep_max_ws_rows=1;
SELECT @@global.wsrep_max_ws_rows;
--echo
--echo # valid values
SET @@global.wsrep_max_ws_rows=131072;
SELECT @@global.wsrep_max_ws_rows;
SET @@global.wsrep_max_ws_rows=131073;
SELECT @@global.wsrep_max_ws_rows;
SET @@global.wsrep_max_ws_rows=0;
SELECT @@global.wsrep_max_ws_rows;
SET @@global.wsrep_max_ws_rows=default;
SELECT @global.wsrep_max_ws_rows;
--echo
--echo # invalid values
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_max_ws_rows=NULL;
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_max_ws_rows='junk';
# expect warnings (Truncated incorrect wsrep_max_ws_rows value: '-1')
SET @@global.wsrep_max_ws_rows=-1;
SELECT @global.wsrep_max_ws_rows;
--echo
--echo # restore the initial value
SET @@global.wsrep_max_ws_rows = @wsrep_max_ws_rows_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_max_ws_size;
--echo #
--echo # wsrep_max_ws_size
--echo #
set @@global.wsrep_max_ws_size=256000;
set @@global.wsrep_max_ws_size=0;
show warnings;
set @@global.wsrep_max_ws_size=-1;
show warnings;
--Error 1232
SET @@global.wsrep_max_ws_size = r;
--echo # save the initial value
SET @wsrep_max_ws_size_global_saved = @@global.wsrep_max_ws_size;
set @@global.wsrep_max_ws_size = @start_value;
\ No newline at end of file
--echo # default
SELECT @@global.wsrep_max_ws_size;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_max_ws_size;
SET @@global.wsrep_max_ws_size=1;
SELECT @@global.wsrep_max_ws_size;
--echo
--echo # valid values
SET @@global.wsrep_max_ws_size=1073741824;
SELECT @@global.wsrep_max_ws_size;
SET @@global.wsrep_max_ws_size=1073741825;
SELECT @@global.wsrep_max_ws_size;
SET @@global.wsrep_max_ws_size=0;
SELECT @@global.wsrep_max_ws_size;
SET @@global.wsrep_max_ws_size=default;
SELECT @global.wsrep_max_ws_size;
--echo
--echo # invalid values
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_max_ws_size=NULL;
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_max_ws_size='junk';
SELECT @global.wsrep_max_ws_size;
SET @@global.wsrep_max_ws_size=-1;
SELECT @global.wsrep_max_ws_size;
--echo
--echo # restore the initial value
SET @@global.wsrep_max_ws_size = @wsrep_max_ws_size_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_mysql_replication_bundle;
--echo #
--echo # wsrep_mysql_replication_bundle
--echo #
set @@global.wsrep_mysql_replication_bundle=0;
set @@global.wsrep_mysql_replication_bundle=1000;
--echo # save the initial value
SET @wsrep_mysql_replication_bundle_global_saved = @@global.wsrep_mysql_replication_bundle;
set @@global.wsrep_mysql_replication_bundle=-1;
show warnings;
set @@global.wsrep_mysql_replication_bundle=1001;
show warnings;
--Error 1232
SET @@global.wsrep_mysql_replication_bundle = r;
--echo # default
SELECT @@global.wsrep_mysql_replication_bundle;
set @@global.wsrep_mysql_replication_bundle = @start_value;
\ No newline at end of file
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_mysql_replication_bundle;
SELECT @@global.wsrep_mysql_replication_bundle;
--echo
--echo # valid values
SET @@global.wsrep_mysql_replication_bundle=0;
SELECT @@global.wsrep_mysql_replication_bundle;
SET @@global.wsrep_mysql_replication_bundle=1000;
SELECT @@global.wsrep_mysql_replication_bundle;
SET @@global.wsrep_mysql_replication_bundle=default;
SELECT @@global.wsrep_mysql_replication_bundle;
--echo
--echo # invalid values
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_mysql_replication_bundle=NULL;
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_mysql_replication_bundle='junk';
# expect warning (truncated incorrect value)
SET @@global.wsrep_mysql_replication_bundle=-1;
SELECT @@global.wsrep_mysql_replication_bundle;
# expect warning (truncated incorrect value)
SET @@global.wsrep_mysql_replication_bundle=1001;
SELECT @@global.wsrep_mysql_replication_bundle;
--echo
--echo # restore the initial value
SET @@global.wsrep_mysql_replication_bundle = @wsrep_mysql_replication_bundle_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
SELECT COUNT(@@GLOBAL.wsrep_node_address);
--echo 1 Expected
--error 1232
SET @@GLOBAL.wsrep_node_address=1;
--echo Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.wsrep_node_address);
--echo 1 Expected
SELECT @@GLOBAL.wsrep_node_address = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_node_address';
--echo 1 Expected
SELECT COUNT(@@GLOBAL.wsrep_node_address);
--echo 1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_node_address';
--echo 1 Expected
SELECT @@wsrep_node_address = @@GLOBAL.wsrep_node_address;
--echo 1 Expected
SELECT COUNT(@@wsrep_node_address);
--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.wsrep_node_address);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.wsrep_node_address);
--echo Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.wsrep_node_address);
--echo 1 Expected
--source include/have_wsrep.inc
--echo #
--echo # wsrep_node_address
--echo #
--echo # save the initial value
SET @wsrep_node_address_global_saved = @@global.wsrep_node_address;
--echo # default
SELECT @@global.wsrep_node_address;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_node_address;
SELECT @@global.wsrep_node_address;
--echo
--echo # valid values
SET @@global.wsrep_node_address='127.0.0.1';
SELECT @@global.wsrep_node_address;
# default == ''
SET @@global.wsrep_node_address=default;
SELECT @@global.wsrep_node_address;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_node_address=NULL;
SELECT @@global.wsrep_node_address;
# The values being assigned to wsrep_node_address are not verified so the
# following alues are currently valid too.
SET @@global.wsrep_node_address=ON;
SELECT @@global.wsrep_node_address;
SET @@global.wsrep_node_address='OFF';
SELECT @@global.wsrep_node_address;
SET @@global.wsrep_node_address='junk';
SELECT @@global.wsrep_node_address;
--echo
--echo # restore the initial value
SET @@global.wsrep_node_address = @wsrep_node_address_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
SELECT COUNT(@@GLOBAL.wsrep_node_incoming_address);
--echo 1 Expected
--error 1232
SET @@GLOBAL.wsrep_node_incoming_address=1;
--echo Expected error 'Read only variable'
SELECT COUNT(@@GLOBAL.wsrep_node_incoming_address);
--echo 1 Expected
SELECT @@GLOBAL.wsrep_node_incoming_address = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_node_incoming_address';
--echo 1 Expected
SELECT COUNT(@@GLOBAL.wsrep_node_incoming_address);
--echo 1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_node_incoming_address';
--echo 1 Expected
SELECT @@wsrep_node_incoming_address = @@GLOBAL.wsrep_node_incoming_address;
--echo 1 Expected
SELECT COUNT(@@wsrep_node_incoming_address);
--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.wsrep_node_incoming_address);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.wsrep_node_incoming_address);
--echo Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.wsrep_node_incoming_address);
--echo 1 Expected
--source include/have_wsrep.inc
--echo #
--echo # wsrep_node_incoming_address
--echo #
--echo # save the initial value
SET @wsrep_node_incoming_address_global_saved = @@global.wsrep_node_incoming_address;
--echo # default
SELECT @@global.wsrep_node_incoming_address;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_node_incoming_address;
SELECT @@global.wsrep_node_incoming_address;
--echo
--echo # valid values
SET @@global.wsrep_node_incoming_address='127.0.0.1:4444';
SELECT @@global.wsrep_node_incoming_address;
SET @@global.wsrep_node_incoming_address='127.0.0.1';
SELECT @@global.wsrep_node_incoming_address;
SET @@global.wsrep_node_incoming_address=AUTO;
SELECT @@global.wsrep_node_incoming_address;
SET @@global.wsrep_node_incoming_address=default;
SELECT @@global.wsrep_node_incoming_address;
--echo
--echo # invalid values
# The values being assigned to wsrep_node_incoming_address are not verified so
# the following values are currently valid too.
SET @@global.wsrep_node_incoming_address=ON;
SELECT @@global.wsrep_node_incoming_address;
SET @@global.wsrep_node_incoming_address='OFF';
SELECT @@global.wsrep_node_incoming_address;
SET @@global.wsrep_node_incoming_address=NULL;
SELECT @@global.wsrep_node_incoming_address;
SET @@global.wsrep_node_incoming_address='junk';
SELECT @@global.wsrep_node_incoming_address;
--echo
--echo # restore the initial value
SET @@global.wsrep_node_incoming_address = @wsrep_node_incoming_address_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_node_name;
--echo #
--echo # wsrep_node_name
--echo #
set @@global.wsrep_node_name='test';
set @@global.wsrep_node_name=NULL;
--Error 1232
SET @@global.wsrep_node_name = 1;
call mtr.add_suppression("WSREP: Failed to get provider options");
set @@global.wsrep_node_name = @start_value;
\ No newline at end of file
--echo # save the initial value
SET @wsrep_node_name_global_saved = @@global.wsrep_node_name;
--echo # default
SELECT @@global.wsrep_node_name;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_node_name;
SET @@global.wsrep_node_name='node_name';
SELECT @@global.wsrep_node_name;
--echo
--echo # valid values
SET @@global.wsrep_node_name='my_node';
SELECT @@global.wsrep_node_name;
SET @@global.wsrep_node_name='hyphenated-node-name';
SELECT @@global.wsrep_node_name;
SET @@global.wsrep_node_name=default;
SELECT @@global.wsrep_node_name;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_node_name=NULL;
SELECT @@global.wsrep_node_name;
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_node_name=1;
SELECT @@global.wsrep_node_name;
--echo
--echo # restore the initial value
SET @@global.wsrep_node_name = @wsrep_node_name_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_notify_cmd;
--echo #
--echo # wsrep_notify_cmd
--echo #
set @@global.wsrep_notify_cmd='test';
set @@global.wsrep_notify_cmd=NULL;
--Error 1232
SET @@global.wsrep_notify_cmd = 1;
call mtr.add_suppression("WSREP: Failed to get provider options");
set @@global.wsrep_notify_cmd = @start_value;
\ No newline at end of file
--echo # save the initial value
SET @wsrep_notify_cmd_global_saved = @@global.wsrep_notify_cmd;
--echo # default
SELECT @@global.wsrep_notify_cmd;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_notify_cmd;
SET @@global.wsrep_notify_cmd='notify_cmd';
SELECT @@global.wsrep_notify_cmd;
--echo
--echo # valid values
SET @@global.wsrep_notify_cmd='command';
SELECT @@global.wsrep_notify_cmd;
SET @@global.wsrep_notify_cmd='hyphenated-command';
SELECT @@global.wsrep_notify_cmd;
SET @@global.wsrep_notify_cmd=default;
SELECT @@global.wsrep_notify_cmd;
SET @@global.wsrep_notify_cmd=NULL;
SELECT @@global.wsrep_notify_cmd;
--echo
--echo # invalid values
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_notify_cmd=1;
SELECT @@global.wsrep_notify_cmd;
--echo
--echo # restore the initial value
SET @@global.wsrep_notify_cmd = @wsrep_notify_cmd_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_on;
--echo #
--echo # wsrep_on
--echo #
set @@global.wsrep_on=ON;
set @@global.wsrep_on=OFF;
set @@global.wsrep_on=1;
set @@global.wsrep_on=0;
--Error 1231
SET @@global.wsrep_on = -1;
--echo # save the initial values
SET @wsrep_on_global_saved = @@global.wsrep_on;
SET @wsrep_on_session_saved = @@session.wsrep_on;
set @@global.wsrep_on = @start_value;
--echo # default
SELECT @@global.wsrep_on;
SELECT @@session.wsrep_on;
--echo
--echo # scope and valid values
SET @@global.wsrep_on=OFF;
SELECT @@global.wsrep_on;
SET @@global.wsrep_on=ON;
SELECT @@global.wsrep_on;
SET @@session.wsrep_on=OFF;
SELECT @@session.wsrep_on;
SET @@session.wsrep_on=ON;
SELECT @@session.wsrep_on;
SET @@session.wsrep_on=default;
SELECT @@session.wsrep_on;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_on=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_on='junk';
--error ER_WRONG_VALUE_FOR_VAR
SET @@session.wsrep_on=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@session.wsrep_on='junk';
--echo
--echo # restore the initial values
SET @@global.wsrep_on = @wsrep_on_global_saved;
SET @@session.wsrep_on = @wsrep_on_session_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_osu_method;
--echo #
--echo # wsrep_osu_method
--echo #
set @@global.wsrep_osu_method='TOI';
set @@global.wsrep_osu_method='RSU';
set @@global.wsrep_osu_method=TOI;
set @@global.wsrep_osu_method=RSU;
--echo # save the initial value
SET @wsrep_osu_method_global_saved = @@global.wsrep_osu_method;
--Error 1231
set @@global.wsrep_osu_method=TSU;
--Error 1231
set @@global.wsrep_osu_method='TSU';
--Error 1231
SET @@global.wsrep_on = -1;
--echo # default
SELECT @@global.wsrep_osu_method;
set @@global.wsrep_osu_method = @start_value;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_osu_method;
SET @@global.wsrep_osu_method=TOI;
SELECT @@global.wsrep_osu_method;
--echo
--echo # valid values
SET @@global.wsrep_osu_method=TOI;
SELECT @@global.wsrep_osu_method;
SET @@global.wsrep_osu_method=RSU;
SELECT @@global.wsrep_osu_method;
SET @@global.wsrep_osu_method="RSU";
SELECT @@global.wsrep_osu_method;
SET @@global.wsrep_osu_method=default;
SELECT @@global.wsrep_osu_method;
# numeric value
SET @@global.wsrep_osu_method=1;
SELECT @@global.wsrep_osu_method;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_osu_method=4;
SELECT @@global.wsrep_osu_method;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_osu_method=NULL;
SELECT @@global.wsrep_osu_method;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_osu_method='junk';
SELECT @@global.wsrep_osu_method;
--echo
--echo # restore the initial value
SET @@global.wsrep_osu_method = @wsrep_osu_method_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
SELECT COUNT(@@GLOBAL.wsrep_provider);
--echo 1 Expected
--echo #
--echo # wsrep_provider
--echo #
--echo # save the initial value
SET @wsrep_provider_global_saved = @@global.wsrep_provider;
--echo # default
SELECT @@global.wsrep_provider;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_provider;
SELECT @@global.wsrep_provider;
--echo
--echo # valid values
SET @@global.wsrep_provider=default;
SELECT @@global.wsrep_provider;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_provider='/invalid/libgalera_smm.so';
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_provider=NULL;
SELECT @@global.wsrep_provider;
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_provider=1;
SELECT @@global.wsrep_provider;
--echo
--echo # restore the initial value
SET @@global.wsrep_provider = @wsrep_provider_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
SELECT COUNT(@@GLOBAL.wsrep_provider_options);
--echo 1 Expected
--echo #
--echo # wsrep_provider_options
--echo #
call mtr.add_suppression("WSREP: Failed to get provider options");
--echo # save the initial value
SET @wsrep_provider_options_global_saved = @@global.wsrep_provider_options;
--echo # default
SELECT @@global.wsrep_provider_options;
--echo
--echo # scope
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_provider_options;
SET @@global.wsrep_provider_options='option1';
SELECT @@global.wsrep_provider_options;
--echo
--echo # valid values
SET @@global.wsrep_provider_options='name1=value1;name2=value2';
SELECT @@global.wsrep_provider_options;
SET @@global.wsrep_provider_options='hyphenated-name:value';
SELECT @@global.wsrep_provider_options;
SET @@global.wsrep_provider_options=default;
SELECT @@global.wsrep_provider_options;
--echo
--echo # invalid values
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_provider_options=1;
SELECT @@global.wsrep_provider_options;
--error ER_WRONG_ARGUMENTS
SET @@global.wsrep_provider_options=NULL;
SELECT @@global.wsrep_provider_options;
--echo
--echo # restore the initial value
SET @@global.wsrep_provider_options = @wsrep_provider_options_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
SELECT COUNT(@@GLOBAL.wsrep_recover);
--echo 1 Expected
--Error 1238
set @@global.wsrep_recover=ON;
--echo Expected error 'Readonly variable'
--Error 1238
set @@global.wsrep_recover=OFF;
--echo Expected error 'Readonly variable'
SELECT @@GLOBAL.wsrep_recover = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_recover';
--echo 1 Expected
SELECT COUNT(@@GLOBAL.wsrep_recover);
--echo 1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='wsrep_recover';
--echo 1 Expected
SELECT @@wsrep_recover = @@GLOBAL.wsrep_recover;
--echo 1 Expected
SELECT COUNT(@@wsrep_recover);
--echo 1 Expected
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.wsrep_recover);
--echo Expected error 'Variable is a GLOBAL variable'
--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.wsrep_recover);
--echo Expected error 'Variable is a GLOBAL variable'
SELECT COUNT(@@GLOBAL.wsrep_recover);
--echo 1 Expected
--Error ER_BAD_FIELD_ERROR
SELECT wsrep_recover = @@SESSION.wsrep_recover;
--echo Expected error 'Readonly variable'
--source include/have_wsrep.inc
--echo #
--echo # wsrep_recover
--echo #
--echo # default
SELECT @@global.wsrep_recover;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_recover;
--echo
--echo # scope and valid values
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_recover=OFF;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_recover=ON;
--echo
--echo # invalid values
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_recover=NULL;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_recover='junk';
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_replicate_myisam;
--echo #
--echo # wsrep_replicate_myisam
--echo #
set @@global.wsrep_replicate_myisam=ON;
set @@global.wsrep_replicate_myisam=OFF;
set @@global.wsrep_replicate_myisam=1;
set @@global.wsrep_replicate_myisam=0;
--Error 1231
SET @@global.wsrep_replicate_myisam = -1;
--echo # save the initial value
SET @wsrep_replicate_myisam_global_saved = @@global.wsrep_replicate_myisam;
set @@global.wsrep_replicate_myisam = @start_value;
\ No newline at end of file
--echo # default
SELECT @@global.wsrep_replicate_myisam;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_replicate_myisam;
--echo
--echo # scope and valid values
#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
#TODO: check if it is expected for variable to be dynamic?
SET @@global.wsrep_replicate_myisam=OFF;
SELECT @@global.wsrep_replicate_myisam;
#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_replicate_myisam=ON;
SELECT @@global.wsrep_replicate_myisam;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_replicate_myisam=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_replicate_myisam='junk';
--echo
--echo # restore the initial value
SET @@global.wsrep_replicate_myisam = @wsrep_replicate_myisam_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_restart_slave;
--echo #
--echo # wsrep_restart_slave
--echo #
set @@global.wsrep_restart_slave=ON;
set @@global.wsrep_restart_slave=OFF;
set @@global.wsrep_restart_slave=1;
set @@global.wsrep_restart_slave=0;
--Error 1231
SET @@global.wsrep_restart_slave = -1;
--echo # save the initial value
SET @wsrep_restart_slave_global_saved = @@global.wsrep_restart_slave;
set @@global.wsrep_restart_slave = @start_value;
\ No newline at end of file
--echo # default
SELECT @@global.wsrep_restart_slave;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@session.wsrep_restart_slave;
--echo
--echo # scope and valid values
#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
#TODO: check if it is expected for variable to be dynamic?
SET @@global.wsrep_restart_slave=OFF;
SELECT @@global.wsrep_restart_slave;
#--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SET @@global.wsrep_restart_slave=ON;
SELECT @@global.wsrep_restart_slave;
--echo
--echo # invalid values
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_restart_slave=NULL;
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.wsrep_restart_slave='junk';
--echo
--echo # restore the initial value
SET @@global.wsrep_restart_slave = @wsrep_restart_slave_global_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/have_wsrep.inc
set @start_value = @@wsrep_restart_slave;
--echo #
--echo # wsrep_retry_autocommit
--echo #
set @@global.wsrep_restart_slave=ON;
set @@global.wsrep_restart_slave=OFF;
set @@global.wsrep_restart_slave=1;
set @@global.wsrep_restart_slave=0;
--Error 1231
SET @@global.wsrep_restart_slave = -1;
--echo # save the initial values
SET @wsrep_retry_autocommit_global_saved = @@global.wsrep_retry_autocommit;
SET @wsrep_retry_autocommit_session_saved = @@session.wsrep_retry_autocommit;
set @@global.wsrep_restart_slave = @start_value;
\ No newline at end of file
--echo # default
SELECT @@global.wsrep_retry_autocommit;
--echo
--echo # scope
SET @@session.wsrep_retry_autocommit=1;
SELECT @@session.wsrep_retry_autocommit;
SET @@global.wsrep_retry_autocommit=1;
SELECT @@global.wsrep_retry_autocommit;
--echo
--echo # valid values
SET @@global.wsrep_retry_autocommit=10;
SELECT @@global.wsrep_retry_autocommit;
SET @@global.wsrep_retry_autocommit=0;
SELECT @@global.wsrep_retry_autocommit;
SET @@global.wsrep_retry_autocommit=default;
SELECT @global.wsrep_retry_autocommit;
SET @@session.wsrep_retry_autocommit=10;
SELECT @@session.wsrep_retry_autocommit;
SET @@session.wsrep_retry_autocommit=0;
SELECT @@session.wsrep_retry_autocommit;
SET @@session.wsrep_retry_autocommit=default;
SELECT @session.wsrep_retry_autocommit;
--echo
--echo # invalid values
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_retry_autocommit=NULL;
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_retry_autocommit='junk';
# expect warning : Truncated incorrect wsrep_retry_autocommit value: '-1'
SET @@global.wsrep_retry_autocommit=-1;
SELECT @global.wsrep_retry_autocommit;
--echo
--echo # restore the initial value
SET @@global.wsrep_retry_autocommit = @wsrep_retry_autocommit_global_saved;
SET @@session.wsrep_retry_autocommit = @wsrep_retry_autocommit_session_saved;
--echo # End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
set @start_value = @@wsrep_provider;
set @@global.wsrep_provider=none;
--Error 1231
SET @@global.wsrep_provider = -1;
set @@global.wsrep_provider = @start_value;
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment