summaryrefslogtreecommitdiffstats
path: root/mysql-test/include/have_query_cache_disabled.inc
blob: 9087fa392e1739c14ff56d00ae99ed2e897dce96 (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
# Skip the test if 'query cache' is disabled.
# Note : There are 2 techniques to disable query cache :
#        (1) Set query_cache_type to 0 or OFF
#        (2) Set query_cache_size to 0

disable_query_log;

let $do_skip=0;

let $qc_var_1= query_get_value("SELECT COUNT(*) AS var1 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME = 'have_query_cache' AND variable_value = 'YES'", var1, 1);
if ($qc_var_1 == 1)
{
  let $do_skip=1;
}

# Check if 'query_cache_type' is OFF
let $qc_var_2= query_get_value("SELECT COUNT(*) AS var2 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME = 'query_cache_type' AND VARIABLE_VALUE = 'OFF'", var2, 1);
if ($qc_var_2 == 1)
{
  let $do_skip=0;
}

# Check if 'query_cache_size' is 0
let $qc_var_3= query_get_value("SELECT COUNT(*) AS var3 FROM INFORMATION_SCHEMA.SESSION_VARIABLES WHERE VARIABLE_NAME = 'query_cache_size' AND VARIABLE_VALUE = 0", var3, 1);

if ($qc_var_3 == 1)
{
  let $do_skip=0;
}

if ($do_skip)
{
  skip Query Cache enabled, skipping test;
}

enable_query_log;