Debian Codegraph @

mysql-test/suite/sys_vars/t/innodb_undo_tablespaces_basic.test

raw
1 ################## mysql-test/t/innodb_undo_tablespaces_basic.test ############
2 # #
3 # Variable Name: innodb_undo_tablespaces #
4 # Scope: Global #
5 # Access Type: Static #
6 # Data Type: string #
7 # #
8 # #
9 # Creation Date: 2011-07-05 #
10 # Author : Sunny Bains #
11 # #
12 # #
13 # Description: Read-only config global variable innodb_undo_tablespaces #
14 # * Value check #
15 # * Scope check #
16 # #
17 ###############################################################################
18
19 # We need to reboot in order to get rid of extra undo tablespaces.
20 --source include/not_valgrind.inc
21
22 let MYSQLD_DATADIR = `select @@datadir`;
23
24 SELECT @@GLOBAL.innodb_undo_tablespaces >= 2;
25 let $undo_tablespaces=`SELECT @@GLOBAL.innodb_undo_tablespaces`;
26
27
28 ####################################################################
29 # Make sure the value can be set at runtime #
30 # Test for invalid range and expect a warning
31 ####################################################################
32
33 --disable_query_log
34 call mtr.add_suppression("\\[Warning\\] .*MY-\\d+.* Expected to open 127 undo tablespaces but found 0. Will create the rest");
35 --enable_query_log
36
37 SET GLOBAL innodb_undo_tablespaces=2;
38 SELECT @@innodb_undo_tablespaces;
39 --echo # 2 Expected
40
41 SET GLOBAL innodb_undo_tablespaces=1;
42 --echo # Expected warning 'Truncated incorrect innodb_undo_tablespaces value'
43 SELECT @@innodb_undo_tablespaces;
44 --echo # 2 Expected
45
46 SET GLOBAL innodb_undo_tablespaces=0;
47 --echo # Expected warning 'Truncated incorrect innodb_undo_tablespaces value'
48 SELECT @@innodb_undo_tablespaces;
49 --echo # 2 Expected
50
51 SET GLOBAL innodb_undo_tablespaces=-1;
52 --echo # Expected warning 'Truncated incorrect innodb_undo_tablespaces value'
53 SELECT @@innodb_undo_tablespaces;
54 --echo # 2 Expected
55
56 --replace_result $undo_tablespaces ORIGINAL_VALUE
57 --eval SET @@GLOBAL.innodb_undo_tablespaces=$undo_tablespaces;
58
59 SELECT COUNT(@@GLOBAL.innodb_undo_tablespaces);
60 --echo # 1 Expected
61
62
63 ################################################################################
64 # Check if the value in GLOBAL table matches value in variable #
65 ################################################################################
66
67 --disable_warnings
68 --disable_query_log
69 eval SELECT VARIABLE_VALUE-$undo_tablespaces DIFFERENCE
70 FROM performance_schema.global_variables
71 WHERE VARIABLE_NAME='innodb_undo_tablespaces';
72 --enable_query_log
73 --enable_warnings
74 --echo 0 Expected
75
76
77 ################################################################################
78 # Check if accessing variable with and without GLOBAL point to same variable #
79 ################################################################################
80 SELECT @@innodb_undo_tablespaces = @@GLOBAL.innodb_undo_tablespaces;
81 --echo # 1 Expected
82
83
84 ################################################################################
85 # Check if innodb_undo_tablespaces can be accessed with and without @@ sign #
86 ################################################################################
87
88 SELECT COUNT(@@innodb_undo_tablespaces);
89 --echo # 1 Expected
90
91 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
92 SELECT COUNT(@@local.innodb_undo_tablespaces);
93 --echo # Expected error 'Variable is a GLOBAL variable'
94
95 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
96 SELECT COUNT(@@SESSION.innodb_undo_tablespaces);
97 --echo # Expected error 'Variable is a GLOBAL variable'
98
99 SELECT COUNT(@@GLOBAL.innodb_undo_tablespaces);
100 --echo # 1 Expected
101
102 --Error ER_BAD_FIELD_ERROR
103 SELECT innodb_undo_tablespaces;
104 --echo # Expected error 'Unknown column'