summaryrefslogtreecommitdiff
path: root/storage/rocksdb/mysql-test/rocksdb/t/rocksdb_qcache.test
blob: 0369e758f5d32413eb1b00e15e396a6ca0221bcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--source include/have_rocksdb.inc

# Important:
# The test needs to be run with --mysqld=--query-cache-type=1

--source include/have_query_cache.inc
set @save_query_cache_type=@@global.query_cache_type;
set @save_query_cache_size=@@global.query_cache_size;
set @@global.query_cache_type=1;
set @@global.query_cache_size=1024*1024;

--enable_connect_log

create table t1 (pk int primary key, c char(8)) engine=RocksDB;
insert into t1 values (1,'new'),(2,'new');

select * from t1;

--connect (con1,localhost,root,,)

update t1 set c = 'updated';
#select * from t1;

--connection default
flush status;
show status like 'Qcache_hits';
show global status like 'Qcache_hits';
select * from t1;
select sql_no_cache * from t1;
select * from t1 where pk = 1;
show status like 'Qcache_hits';
--echo # MariaDB: Qcache_not_cached is not incremented for select sql_no_cache queries
--echo #          so the following query produces 2, not 3:
show status like 'Qcache_not_cached';
show global status like 'Qcache_hits';

drop table t1;

#
# Cleanup
#
set @@global.query_cache_type=@save_query_cache_type;
set @@global.query_cache_size=@save_query_cache_size;