'#________________________VAR_03_query_cache_type__________________#'
echo '##'
--echo '#---------------------WL6372_VAR_3_01----------------------#'
####################################################################
#   Checking default value                                         #
####################################################################
SELECT COUNT(@@GLOBAL.query_cache_type)
1 Expected
SELECT @@GLOBAL.query_cache_type;
@@GLOBAL.query_cache_type
OFF
OFF Expected
'#---------------------WL6372_VAR_3_02----------------------#'
# Restart server with query_cache_type 1;
SELECT @@GLOBAL.query_cache_type;
@@GLOBAL.query_cache_type
ON
ON Expected
SET @@GLOBAL.query_cache_type=DEFAULT;
SELECT @@GLOBAL.query_cache_type;
@@GLOBAL.query_cache_type
OFF
OFF Expected
'#---------------------WL6372_VAR_3_03----------------------#'
SET @@local.query_cache_type=1;
SELECT @@Local.query_cache_type;
@@Local.query_cache_type
ON
ON Expected
SET @@session.query_cache_type=1;
SELECT @@Session.query_cache_type;
@@Session.query_cache_type
ON
ON Expected
SET @@GLOBAL.query_cache_type=1;
SELECT @@GLOBAL.query_cache_type;
@@GLOBAL.query_cache_type
ON
ON Expected
SET @@GLOBAL.query_cache_type=DEFAULT;
SELECT @@GLOBAL.query_cache_type;
@@GLOBAL.query_cache_type
OFF
OFF Expected
SET @@Session.query_cache_type=DEFAULT;
SELECT @@Session.query_cache_type;
@@Session.query_cache_type
OFF
OFF Expected
SET @@Local.query_cache_type=DEFAULT;
SELECT @@Local.query_cache_type;
@@Local.query_cache_type
OFF
OFF Expected
'#---------------------WL6372_VAR_3_04----------------------#'
SELECT @@GLOBAL.query_cache_type = VARIABLE_VALUE
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='query_cache_type';
@@GLOBAL.query_cache_type = VARIABLE_VALUE
1
1 Expected
SELECT COUNT(@@GLOBAL.query_cache_type);
COUNT(@@GLOBAL.query_cache_type)
1
1 Expected
SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES 
WHERE VARIABLE_NAME='query_cache_type';
COUNT(VARIABLE_VALUE)
1
1 Expected
'#---------------------WL6372_VAR_3_05----------------------#'
SELECT @@query_cache_type = @@GLOBAL.query_cache_type;
@@query_cache_type = @@GLOBAL.query_cache_type
1
1 Expected
SELECT @@query_cache_type = @@Session.query_cache_type;
@@query_cache_type = @@Session.query_cache_type
1
1 Expected
SELECT COUNT(@@local.query_cache_type);
COUNT(@@local.query_cache_type)
1
1 Expected 
SELECT COUNT(@@SESSION.query_cache_type);
COUNT(@@SESSION.query_cache_type)
1
1 Expected 
SELECT COUNT(@@GLOBAL.query_cache_type);
COUNT(@@GLOBAL.query_cache_type)
1
1 Expected
SELECT query_cache_type = @@SESSION.query_cache_type;
ERROR 42S22: Unknown column 'query_cache_type' in 'field list'
Expected error 'Unknown column query_cache_type in field list'
'#---------------------WL6372_VAR_3_06----------------------#'
Check the size of the vardir
The output size is in unit blocks
TRUE
TRUE Expected
'#---------------------WL6372_VAR_3_07----------------------#'
# create 1 table and insert 3 rows each
DROP TABLE IF EXISTS tab1;
===============
create table & Index
===============
CREATE TABLE tab1 (col_1 text(10))
ENGINE=INNODB ;
===============
Load the data
===============
SET @col_1 = repeat('a', 10);
INSERT INTO tab1
VALUES (@col_1);
INSERT INTO tab1
VALUES (@col_1);
INSERT INTO tab1
VALUES (@col_1);
commit;
set @@GLOBAL.query_cache_type=DEFAULT;
select 1 from tab1 limit 1;
1
1
1 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_hits';
variable_value
0
0 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_inserts';
variable_value
0
0 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache';
variable_value
0
0 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
variable_value
25
25 Expected
select 1 from tab1 limit 1;
1
1
1 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_hits';
variable_value
0
0 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_inserts';
variable_value
0
0 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache';
variable_value
0
0 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
variable_value
30
30 Expected
select 1 from tab1 limit 2;
1
1
1
1 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_hits';
variable_value
0
0 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_inserts';
variable_value
0
0 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache';
variable_value
0
0 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
variable_value
35
35 Expected
# Restart server with query_cache_type ON
select 1 from tab1 limit 1;
1
1
1 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_hits';
variable_value
0
0 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_inserts';
variable_value
1
1 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache';
variable_value
1
1 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
variable_value
8
8 Expected
select 1 from tab1 limit 2;
1
1
1
1 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_hits';
variable_value
0
0 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_inserts';
variable_value
2
2 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache';
variable_value
2
2 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
variable_value
12
12 Expected
select 1 from tab1 limit 1;
1
1
1 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_hits';
variable_value
1
1 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_inserts';
variable_value
2
2 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_queries_in_cache';
variable_value
2
2 Expected
select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
variable_value
16
16 Expected
# opening another client session
select variable_value from information_schema.global_status where variable_name ='Qcache_not_cached';
variable_value
17
17 Expected
#cleanup
DROP TABLE IF EXISTS tab1;
