summaryrefslogtreecommitdiff
path: root/mysql-test/suite/sys_vars/t/innodb_log_checkpoint_now_basic.test
blob: f59ebf649c31cad0b8ca325cdaeabd2da70529d8 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
--source include/have_innodb.inc
--source include/have_debug.inc
# Valgrind builds may block on this one
--source include/not_valgrind.inc

SET @start_global_value = @@global.innodb_log_checkpoint_now;
SELECT @start_global_value;

#
# exists as global only
#
select @@global.innodb_log_checkpoint_now in (0, 1);
select @@global.innodb_log_checkpoint_now;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
select @@session.innodb_log_checkpoint_now;
show global variables like 'innodb_log_checkpoint_now';
show session variables like 'innodb_log_checkpoint_now';
--disable_warnings
select * from information_schema.global_variables where variable_name='innodb_log_checkpoint_now';
select * from information_schema.session_variables where variable_name='innodb_log_checkpoint_now';
--enable_warnings

#
# show that it's writable
#
set global innodb_log_checkpoint_now=1;
# Should always be OFF
select @@global.innodb_log_checkpoint_now;
--disable_warnings
select * from information_schema.global_variables where variable_name='innodb_log_checkpoint_now';
select * from information_schema.session_variables where variable_name='innodb_log_checkpoint_now';
--enable_warnings

set @@global.innodb_log_checkpoint_now=0;
# Should always be OFF
select @@global.innodb_log_checkpoint_now;
--disable_warnings
select * from information_schema.global_variables where variable_name='innodb_log_checkpoint_now';
select * from information_schema.session_variables where variable_name='innodb_log_checkpoint_now';
--enable_warnings

set global innodb_log_checkpoint_now=ON;
# Should always be OFF
select @@global.innodb_log_checkpoint_now;
--disable_warnings
select * from information_schema.global_variables where variable_name='innodb_log_checkpoint_now';
select * from information_schema.session_variables where variable_name='innodb_log_checkpoint_now';
--enable_warnings

set global innodb_log_checkpoint_now=OFF;
# Should always be OFF
select @@global.innodb_log_checkpoint_now;
--disable_warnings
select * from information_schema.global_variables where variable_name='innodb_log_checkpoint_now';
select * from information_schema.session_variables where variable_name='innodb_log_checkpoint_now';
--enable_warnings

--error ER_GLOBAL_VARIABLE
set session innodb_log_checkpoint_now='some';

--error ER_GLOBAL_VARIABLE
set @@session.innodb_log_checkpoint_now='some';

#
# incorrect types
#
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_log_checkpoint_now=1.1;
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_log_checkpoint_now='foo';
--error ER_WRONG_VALUE_FOR_VAR
set global innodb_log_checkpoint_now=-2;
--error ER_WRONG_TYPE_FOR_VAR
set global innodb_log_checkpoint_now=1e1;

#
# Cleanup
#

SET @@global.innodb_log_checkpoint_now = @start_global_value;
SELECT @@global.innodb_log_checkpoint_now;