summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/sys_vars/t/innodb_doublewrite_basic.test
blob: 4e76c0ac33d78a140f300198daba01519a51b303 (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
44
45
46
--source include/have_innodb.inc

SELECT @@GLOBAL.innodb_doublewrite;

SET @@GLOBAL.innodb_doublewrite=0;
SELECT @@GLOBAL.innodb_doublewrite;

SET @@GLOBAL.innodb_doublewrite=2;
--error ER_WRONG_VALUE_FOR_VAR
SET @@GLOBAL.innodb_doublewrite=3;
SELECT @@GLOBAL.innodb_doublewrite;
SET @@GLOBAL.innodb_doublewrite=1;
SELECT @@GLOBAL.innodb_doublewrite;

SELECT COUNT(VARIABLE_VALUE)
FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
WHERE VARIABLE_NAME='innodb_doublewrite';

--echo '#---------------------BS_STVARS_026_04----------------------#'
################################################################################
#  Check if accessing variable with and without GLOBAL point to same variable  #
################################################################################
SELECT @@innodb_doublewrite = @@GLOBAL.innodb_doublewrite;
--echo 1 Expected

--echo '#---------------------BS_STVARS_026_05----------------------#'
################################################################################
#   Check if innodb_doublewrite can be accessed with and without @@ sign       #
################################################################################

SELECT COUNT(@@innodb_doublewrite);
--echo 1 Expected

--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@local.innodb_doublewrite);
--echo Expected error 'Variable is a GLOBAL variable'

--Error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT COUNT(@@SESSION.innodb_doublewrite);
--echo Expected error 'Variable is a GLOBAL variable'

SELECT COUNT(@@GLOBAL.innodb_doublewrite);
--echo 1 Expected

--error ER_INCORRECT_GLOBAL_LOCAL_VAR
SELECT @@innodb_doublewrite = @@SESSION.innodb_doublewrite;