Commit 03a8eaa0 authored by Marko Mäkelä's avatar Marko Mäkelä

Fix some badly written Galera tests

galera.galera_kill_applier: Make the test less likely to fail
by adding sleep time.

galera.query_cache: Remove data truncation.

Part of the test file looks like it has been misinterpreted as latin1
and wrongly converted to UTF-8 encoding. In MariaDB 10.1, the server would
only warn about data truncation and not issue an error. 10.2 is stricter.
(The test should be carefully reviewed if it really makes sense.)
parent a36c369b
# Execute FLUSH/RESET commands.
# On node-1
connection node_1;
SET @query_cache_size_saved=@@GLOBAL.query_cache_size;
SET @query_cache_type_saved=@@GLOBAL.query_cache_type;
set GLOBAL query_cache_size=1355776;
......@@ -8,6 +9,7 @@ flush query cache;
reset query cache;
flush status;
# On node-2
connection node_2;
SET @query_cache_size_saved=@@GLOBAL.query_cache_size;
SET @query_cache_type_saved=@@GLOBAL.query_cache_type;
set GLOBAL query_cache_size=1355776;
......@@ -15,6 +17,7 @@ flush query cache;
reset query cache;
flush status;
# On node-1
connection node_1;
create table t1 (a int not null) engine=innodb;
insert into t1 values (1),(2),(3);
select * from t1;
......@@ -47,6 +50,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
# On node-2
connection node_2;
select * from t1;
a
1
......@@ -77,6 +81,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
# On node-1
connection node_1;
delete from t1 where a=1;
show status like "Qcache_queries_in_cache";
Variable_name Value
......@@ -85,6 +90,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
# On node-2
connection node_2;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
......@@ -92,6 +98,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
# On node-1
connection node_1;
select * from t1;
a
2
......@@ -103,6 +110,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
# On node-2
connection node_2;
select * from t1;
a
2
......@@ -114,6 +122,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
# On node-1
connection node_1;
update t1 set a=1 where a=3;
show status like "Qcache_queries_in_cache";
Variable_name Value
......@@ -122,6 +131,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
# On node-2
connection node_2;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
......@@ -129,6 +139,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
# On node-1
connection node_1;
select * from t1;
a
2
......@@ -140,6 +151,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
# On node-2
connection node_2;
select * from t1;
a
2
......@@ -151,6 +163,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
# On node-1
connection node_1;
drop table t1;
show status like "Qcache_queries_in_cache";
Variable_name Value
......@@ -159,6 +172,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 1
# On node-2
connection node_2;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
......@@ -167,6 +181,7 @@ Variable_name Value
Qcache_hits 1
# On node-1
connection node_1;
create table t1 (a int not null) ENGINE=MyISAM;
insert into t1 values (1),(2),(3);
create table t2 (a int not null) ENGINE=MyISAM;
......@@ -323,6 +338,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 3
# On node-2
connection node_2;
select * from t3;
a
select * from t3;
......@@ -338,6 +354,7 @@ Variable_name Value
Qcache_hits 2
drop table t1, t2, t3;
# On node-1
connection node_1;
set query_cache_type=demand;
create table t1 (a int not null) engine=innodb;
insert into t1 values (1),(2),(3);
......@@ -371,6 +388,7 @@ Variable_name Value
Qcache_queries_in_cache 1
set query_cache_type=on;
# On node-2
connection node_2;
set query_cache_type=demand;
select * from t1;
a
......@@ -402,6 +420,7 @@ Variable_name Value
Qcache_queries_in_cache 1
set query_cache_type=on;
# On node-1
connection node_1;
reset query cache;
show status like "Qcache_queries_in_cache";
Variable_name Value
......@@ -410,6 +429,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 4
# On node-2
connection node_2;
reset query cache;
show status like "Qcache_queries_in_cache";
Variable_name Value
......@@ -418,6 +438,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 3
# On node-1
connection node_1;
select sql_no_cache * from t1;
a
1
......@@ -430,6 +451,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 4
# On node-2
connection node_2;
select sql_no_cache * from t1;
a
1
......@@ -443,6 +465,7 @@ Variable_name Value
Qcache_hits 3
drop table t1;
# On node-1
connection node_1;
create table t1 (a text not null) engine=innodb;
select CONNECTION_ID() from t1;
CONNECTION_ID()
......@@ -483,6 +506,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 4
# On node-2
connection node_2;
select CONNECTION_ID() from t1;
CONNECTION_ID()
select FOUND_ROWS();
......@@ -523,6 +547,7 @@ Variable_name Value
Qcache_hits 3
drop table t1;
# On node-1
connection node_1;
create database mysqltest;
create table mysqltest.t1 (i int not null auto_increment, a int, primary key
(i)) engine=innodb;
......@@ -548,6 +573,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 4
# On node-2
connection node_2;
select * from t1;
a
show status like "Qcache_queries_in_cache";
......@@ -574,10 +600,9 @@ Variable_name Value
Qcache_hits 3
drop table t1;
# On node-1
connection node_1;
create table t1 (a char(1) not null collate koi8r_general_ci) engine=innodb;
insert into t1 values(_koi8r"á");
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
insert into t1 values(_koi8r 0xc3);
set CHARACTER SET koi8r;
select * from t1;
a
......@@ -594,6 +619,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 4
# On node-2
connection node_2;
set CHARACTER SET koi8r;
select * from t1;
a
......@@ -611,6 +637,7 @@ Variable_name Value
Qcache_hits 3
drop table t1;
# On node-1
connection node_1;
create database if not exists mysqltest;
create table mysqltest.t1 (i int not null) engine=innodb;
create table t1 (i int not null) engine=innodb;
......@@ -637,6 +664,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 6
# On node-2
connection node_2;
select * from t1;
i
2
......@@ -660,6 +688,7 @@ Qcache_hits 5
drop database mysqltest;
drop table t1;
# On node-1
connection node_1;
create table t1 (i int not null) engine=innodb;
insert into t1 (i) values (1),(2),(3),(4);
select SQL_CALC_FOUND_ROWS * from t1 limit 2;
......@@ -713,6 +742,7 @@ show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
# On node-2
connection node_2;
select SQL_CALC_FOUND_ROWS * from t1 limit 2;
i
1
......@@ -765,9 +795,11 @@ Variable_name Value
Qcache_queries_in_cache 2
drop table t1;
# On node-2
connection node_2;
flush query cache;
reset query cache;
# On node-1
connection node_1;
flush query cache;
reset query cache;
create table t1 (a int not null) ENGINE=MYISAM;
......@@ -802,6 +834,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 9
# On node-2
connection node_2;
select * from t1;
a
select * from t1;
......@@ -830,6 +863,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 8
# On node-1
connection node_1;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
......@@ -837,6 +871,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 9
# On node-2
connection node_2;
show global variables like "query_cache_min_res_unit";
Variable_name Value
query_cache_min_res_unit 4096
......@@ -847,6 +882,7 @@ show global variables like "query_cache_min_res_unit";
Variable_name Value
query_cache_min_res_unit 1000
# On node-1
connection node_1;
show global variables like "query_cache_min_res_unit";
Variable_name Value
query_cache_min_res_unit 4096
......@@ -887,6 +923,7 @@ show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
# On node-2
connection node_2;
select * from t1;
a
1
......@@ -935,6 +972,7 @@ show global variables like "query_cache_min_res_unit";
Variable_name Value
query_cache_min_res_unit 4096
# On node-1
connection node_1;
select a from t2;
a
1
......@@ -957,6 +995,7 @@ show global variables like "query_cache_min_res_unit";
Variable_name Value
query_cache_min_res_unit 4096
# On node-1
connection node_1;
create table t1 (a int not null) engine=innodb;
insert into t1 values (1);
select "aaa" from t1;
......@@ -972,6 +1011,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
# On node-2
connection node_2;
select "aaa" from t1;
aaa
aaa
......@@ -986,6 +1026,7 @@ Variable_name Value
Qcache_hits 11
drop table t1;
# On node-1
connection node_1;
create table t1 (a int) engine=innodb;
set GLOBAL query_cache_size=1000;
Warnings:
......@@ -1052,6 +1093,7 @@ query_cache_size 102400
select * from t1;
a
# On node-2
connection node_2;
set GLOBAL query_cache_size=1000;
Warnings:
Warning 1292 Truncated incorrect query_cache_size value: '1000'
......@@ -1118,6 +1160,7 @@ select * from t1;
a
drop table t1;
# On node-1
connection node_1;
set GLOBAL query_cache_size=1048576;
create table t1 (i int not null) engine=innodb;
create table t2 (i int not null) engine=innodb;
......@@ -1149,6 +1192,7 @@ Qcache_hits 12
update t1 set i=(select distinct 1 from (select * from t2) a);
drop table t3;
# On node-2
connection node_2;
set GLOBAL query_cache_size=1048576;
select * from t1;
i
......@@ -1168,6 +1212,7 @@ Variable_name Value
Qcache_hits 11
drop table t1, t2;
# On node-1
connection node_1;
use mysql;
select * from db;
show status like "Qcache_queries_in_cache";
......@@ -1185,6 +1230,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
# On node-1
connection node_1;
create table t1(id int auto_increment primary key) engine=innodb;
insert into t1 values (1), (2), (3);
select * from t1;
......@@ -1199,6 +1245,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
# On node-2
connection node_2;
select * from t1;
id
1
......@@ -1211,6 +1258,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
# On node-1
connection node_1;
alter table t1 rename to t2;
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
......@@ -1221,6 +1269,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
# On node-2
connection node_2;
select * from t1;
ERROR 42S02: Table 'test.t1' doesn't exist
show status like "Qcache_queries_in_cache";
......@@ -1231,6 +1280,7 @@ Variable_name Value
Qcache_hits 11
drop table t2;
# On node-1
connection node_1;
create table t1 (word char(20) not null) engine=innodb;
select * from t1;
word
......@@ -1251,6 +1301,7 @@ select count(*) from t1;
count(*)
70
# On node-2
connection node_2;
select count(*) from t1;
count(*)
70
......@@ -1272,6 +1323,7 @@ count(*)
140
drop table t1;
# On node-1
connection node_1;
create table t1 (a int) engine=innodb;
insert into t1 values (1),(2),(3);
show status like "Qcache_queries_in_cache";
......@@ -1292,6 +1344,7 @@ Variable_name Value
Qcache_hits 12
drop table t1;
# On node-1
connection node_1;
create table t1 (a int) engine=innodb;
insert into t1 values (1),(2);
show status like "Qcache_queries_in_cache";
......@@ -1316,6 +1369,7 @@ Variable_name Value
Qcache_hits 12
SET SQL_SELECT_LIMIT=DEFAULT;
# On node-2
connection node_2;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
......@@ -1339,6 +1393,7 @@ Qcache_hits 11
SET SQL_SELECT_LIMIT=DEFAULT;
drop table t1;
# On node-1
connection node_1;
create table t1 (a int not null) engine=innodb;
create table t2 (a int not null) engine=innodb;
set query_cache_wlock_invalidate=1;
......@@ -1380,6 +1435,7 @@ unlock table;
drop view v1;
set query_cache_wlock_invalidate=default;
# On node-2
connection node_2;
set query_cache_wlock_invalidate=1;
create view v1 as select * from t1;
select * from t1;
......@@ -1420,6 +1476,7 @@ drop view v1;
set query_cache_wlock_invalidate=default;
drop table t1,t2;
# On node-1
connection node_1;
create table t1 (id int primary key) engine=innodb;
insert into t1 values (1),(2),(3);
select * from t1;
......@@ -1433,12 +1490,10 @@ a
drop table t1;
drop table t1;
# On node-1
connection node_1;
SET NAMES koi8r;
CREATE TABLE t1 (a char(1) character set koi8r) engine=innodb;
INSERT INTO t1 VALUES (_koi8r'á'),(_koi8r'Á');
Warnings:
Warning 1265 Data truncated for column 'a' at row 1
Warning 1265 Data truncated for column 'a' at row 2
INSERT INTO t1 VALUES (_koi8r 0xc3),(_koi8r 0xc3);
SELECT a,'Â','â'='Â' FROM t1;
a  'â'='Â'
 0
......@@ -1484,6 +1539,7 @@ Variable_name Value
Qcache_queries_in_cache 4
SET NAMES default;
# On node-2
connection node_2;
SELECT a,'Â','â'='Â' FROM t1;
a  'â'='Â'
? Â 0
......@@ -1529,6 +1585,7 @@ Variable_name Value
Qcache_queries_in_cache 4
drop table t1;
# On node-1
connection node_1;
create table t1 (a int) engine=innodb;
show status like "Qcache_queries_in_cache";
Variable_name Value
......@@ -1553,6 +1610,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 13
# On node-2
connection node_2;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
......@@ -1577,6 +1635,7 @@ Variable_name Value
Qcache_hits 12
drop table t1;
# On node-1
connection node_1;
set session query_cache_type = 2;
create table t1(a int) engine=innodb;
select table_name from information_schema.tables
......@@ -1614,6 +1673,7 @@ show status like "Qcache_hits";
Variable_name Value
Qcache_hits 14
# On node-2
connection node_2;
select a from t1;
a
select a from t1;
......@@ -1636,10 +1696,12 @@ Qcache_hits 13
drop table t1;
# Restore original settings.
# On node-1
connection node_1;
SET GLOBAL query_cache_size=@query_cache_size_saved;
SET GLOBAL query_cache_type=@query_cache_type_saved;
# On node-2
connection node_2;
SET GLOBAL query_cache_size=@query_cache_size_saved;
SET GLOBAL query_cache_type=@query_cache_type_saved;
# End of test
......@@ -6,7 +6,7 @@
--source include/have_innodb.inc
--connection node_1
--sleep 1
--sleep 2
--let $applier_thread = `SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE IS NULL LIMIT 1`
--disable_query_log
......
......@@ -323,7 +323,7 @@ drop table t1;
--echo # On node-1
--connection node_1
create table t1 (a char(1) not null collate koi8r_general_ci) engine=innodb;
insert into t1 values(_koi8r"á");
insert into t1 values(_koi8r 0xc3);
set CHARACTER SET koi8r;
select * from t1;
set CHARACTER SET cp1251_koi8;
......@@ -861,7 +861,7 @@ drop table t1;
--connection node_1
SET NAMES koi8r;
CREATE TABLE t1 (a char(1) character set koi8r) engine=innodb;
INSERT INTO t1 VALUES (_koi8r'á'),(_koi8r'Á');
INSERT INTO t1 VALUES (_koi8r 0xc3),(_koi8r 0xc3);
#
# Run select
#
......
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