Warning 1282 Query cache failed to set size 1024; new query cache size is 0
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 0
select * from t1;
a
set GLOBAL query_cache_size=10240;
Warnings:
Warning 1282 Query cache failed to set size 10240; new query cache size is 0
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 0
select * from t1;
a
set GLOBAL query_cache_size=20480;
Warnings:
Warning 1282 Query cache failed to set size 20480; new query cache size is 0
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 0
select * from t1;
a
set GLOBAL query_cache_size=40960;
Warnings:
Warning 1282 Query cache failed to set size 40960; new query cache size is 0
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 0
select * from t1;
a
set GLOBAL query_cache_size=51200;
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 51200
select * from t1;
a
set GLOBAL query_cache_size=61440;
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 61440
select * from t1;
a
set GLOBAL query_cache_size=81920;
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 81920
select * from t1;
a
set GLOBAL query_cache_size=102400;
show global variables like "query_cache_size";
Variable_name Value
query_cache_size 102400
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;
select * from t1;
i
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
create temporary table t3 (i int not null);
select * from t2;
i
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
select * from t3;
i
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
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
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
select * from t2;
i
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
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";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
use test;
select * from mysql.db;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
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;
id
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
# On node-2
connection node_2;
select * from t1;
id
1
2
3
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
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
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
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";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_hits";
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
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
load data infile 'MYSQLTEST_VARDIR/std_data/words.dat' into table t1;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
# On node-2
connection node_2;
select count(*) from t1;
count(*)
70
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
load data infile 'MYSQLTEST_VARDIR/std_data/words.dat' into table t1;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
select count(*) from t1;
count(*)
140
drop table t1;
#
# INTO OUTFILE/DUMPFILE test
#
# 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";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
select * from t1 into outfile "query_cache.out.file";
Warnings:
Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
select * from t1 into outfile "query_cache.out.file";
select * from t1 limit 1 into dumpfile "query_cache.dump.file";
Warnings:
Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 36
drop table t1;
#
# Test of SQL_SELECT_LIMIT
#
# 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";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
select * from t1;
a
1
2
SET SQL_SELECT_LIMIT=1;
select * from t1;
a
1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 38
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
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
select * from t1;
a
1
2
SET SQL_SELECT_LIMIT=1;
select * from t1;
a
1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
SET SQL_SELECT_LIMIT=DEFAULT;
drop table t1;
#
# WRITE LOCK & QC
#
# 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;
create view v1 as select * from t1;
select * from t1;
a
select * from t2;
a
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 40
lock table t1 write, t2 read;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
unlock table;
select * from t1;
a
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
lock table v1 write;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 41
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;
a
select * from t2;
a
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
lock table t1 write, t2 read;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
unlock table;
select * from t1;
a
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
lock table v1 write;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 35
unlock table;
drop view v1;
set query_cache_wlock_invalidate=default;
drop table t1,t2;
#
# Hiding real table stored in query cache by temporary table
#
# 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;
id
1
2
3
create temporary table t1 (a int not null auto_increment primary key);
select * from t1;
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 0xc3),(_koi8r 0xc3);
SELECT a,'Â','â'='Â' FROM t1;
a  'â'='Â'
 0
 0
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 43
set collation_connection=koi8r_bin;
SELECT a,'Â','â'='Â' FROM t1;
a  'â'='Â'
 0
 0
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 44
set character_set_client=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
a ? '?'='?'
? 1
? 1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 45
set character_set_results=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
a ? 'â'='Â'
? 1
? 1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 4
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 46
SET NAMES default;
# On node-2
connection node_2;
#
# Run select
#
SELECT a,'Â','â'='Â' FROM t1;
a  'â'='Â'
? Â 0
? Â 0
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
set collation_connection=koi8r_bin;
SELECT a,'Â','â'='Â' FROM t1;
a ?? 'â'='Â'
? ?? 1
? ?? 1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 2
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 37
set character_set_client=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
a ?? '??'='?'
? ?? 1
? ?? 1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 3
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 38
set character_set_results=cp1251;
SELECT a,'Â','â'='Â' FROM t1;
a ? 'â'='Â'
? 1
? 1
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 4
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
show status like "Qcache_inserts";
Variable_name Value
Qcache_inserts 39
drop table t1;
#
# Comments before command
#
# On node-1
connection node_1;
create table t1 (a int) engine=innodb;
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
/**/ select * from t1;
a
/**/ select * from t1;
a
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
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
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 11
/**/ select * from t1;
a
/**/ select * from t1;
a
show status like "Qcache_queries_in_cache";
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 12
drop table t1;
#
# Information schema & query cache test
#
# 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
where table_schema="test";
table_name
t1
drop table t1;
select table_name from information_schema.tables
where table_schema="test";
table_name
set session query_cache_type = 1;
set global query_cache_size=1024*1024;
flush query cache;
create table t1 ( a int ) engine=myisam;
insert into t1 values (1);
select a from t1;
a
1
select a from t1;
a
1
show status like 'qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 14
repair table t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
show status like 'qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 0
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;
a
show status like 'qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 1
show status like "Qcache_hits";
Variable_name Value
Qcache_hits 13
repair table t1;
Table Op Msg_type Msg_text
test.t1 repair status OK
show status like 'qcache_queries_in_cache';
Variable_name Value
Qcache_queries_in_cache 0
show status like "Qcache_hits";
Variable_name Value
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;
GAL-501 : MDEV-24645 galera_3nodes.GAL-501 MTR failed: failed to open gcomm backend connection: 110
galera_2_cluster : MDEV-22195 temporarily disabled due to issues to be fixed with MDEV-22195
galera_gtid_2_cluster : MDEV-23775 Galera test failure on galera_3nodes.galera_gtid_2_cluster
galera_ist_gcache_rollover : MDEV-23578 WSREP: exception caused by message: {v=0,t=1,ut=255,o=4,s=0,sr=0,as=1,f=6,src=50524cfe,srcvid=view_id(REG,50524cfe,4),insvid=view_id(UNKNOWN,00000000,0),ru=00000000,r=[-1,-1],fs=75,nl=(}
galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to MySQL server during query
galera_load_data_ist : MDEV-24639 galera_3nodes.galera_load_data_ist MTR failed with SIGABRT: query 'reap' failed: 2013: Lost connection to MySQL server during query