Debian Codegraph @

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

raw
1
2
3 ################## mysql-test\t\innodb_file_per_table_basic.test ##############
4 # #
5 # Variable Name: innodb_file_per_table #
6 # Scope: Global #
7 # Access Type: Dynamic #
8 # Data Type: boolean #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author : Sharique Abdullah #
13 # #
14 # #
15 # Description:Test Cases of Dynamic System Variable innodb_file_per_table #
16 # that checks the behavior of this variable in the following ways #
17 # * Value Check #
18 # * Scope Check #
19 # #
20 # Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
21 # server-system-variables.html #
22 # #
23 ###############################################################################
24
25
26 SET @start_global_value = @@global.innodb_file_per_table;
27 SELECT @start_global_value;
28
29
30 --echo '#---------------------BS_STVARS_028_01----------------------#'
31 ####################################################################
32 # Displaying default value #
33 ####################################################################
34 SELECT COUNT(@@GLOBAL.innodb_file_per_table);
35 --echo 1 Expected
36
37
38 --echo '#---------------------BS_STVARS_028_02----------------------#'
39 ####################################################################
40 # Check if Value can set #
41 ####################################################################
42
43 SET @@global.innodb_file_per_table = 0;
44 SELECT @@global.innodb_file_per_table;
45
46 SET @@global.innodb_file_per_table ='On' ;
47 SELECT @@global.innodb_file_per_table;
48
49 SET @@global.innodb_file_per_table ='Off' ;
50 SELECT @@global.innodb_file_per_table;
51
52 SET @@global.innodb_file_per_table = 1;
53 SELECT @@global.innodb_file_per_table;
54
55 --echo '#---------------------BS_STVARS_028_03----------------------#'
56 #################################################################
57 # Check if the value in GLOBAL Table matches value in variable #
58 #################################################################
59
60 --disable_warnings
61 SELECT IF(@@GLOBAL.innodb_file_per_table,'ON','OFF') = VARIABLE_VALUE
62 FROM performance_schema.global_variables
63 WHERE VARIABLE_NAME='innodb_file_per_table';
64 --enable_warnings
65 --echo 1 Expected
66
67 SELECT COUNT(@@GLOBAL.innodb_file_per_table);
68 --echo 1 Expected
69
70 --disable_warnings
71 SELECT COUNT(VARIABLE_VALUE)
72 FROM performance_schema.global_variables
73 WHERE VARIABLE_NAME='innodb_file_per_table';
74 --enable_warnings
75 --echo 1 Expected
76
77
78
79 --echo '#---------------------BS_STVARS_028_04----------------------#'
80 ################################################################################
81 # Check if accessing variable with and without GLOBAL point to same variable #
82 ################################################################################
83 SELECT @@innodb_file_per_table = @@GLOBAL.innodb_file_per_table;
84 --echo 1 Expected
85
86
87
88 --echo '#---------------------BS_STVARS_028_05----------------------#'
89 ################################################################################
90 # Check if innodb_file_per_table can be accessed with and without @@ sign #
91 ################################################################################
92
93 SELECT COUNT(@@innodb_file_per_table);
94 --echo 1 Expected
95
96 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
97 SELECT COUNT(@@local.innodb_file_per_table);
98 --echo Expected error 'Variable is a GLOBAL variable'
99
100 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
101 SELECT COUNT(@@SESSION.innodb_file_per_table);
102 --echo Expected error 'Variable is a GLOBAL variable'
103
104 SELECT COUNT(@@GLOBAL.innodb_file_per_table);
105 --echo 1 Expected
106
107 --Error ER_BAD_FIELD_ERROR
108 SELECT innodb_file_per_table;
109
110 #
111 # Cleanup
112 #
113
114 SET @@global.innodb_file_per_table = @start_global_value;
115 SELECT @@global.innodb_file_per_table;