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 --source include/have_innodb.inc
26
27 SET @start_global_value = @@global.innodb_file_per_table;
28 SELECT @start_global_value;
29
30
31 --echo '#---------------------BS_STVARS_028_01----------------------#'
32 ####################################################################
33 # Displaying default value #
34 ####################################################################
35 SELECT COUNT(@@GLOBAL.innodb_file_per_table);
36 --echo 1 Expected
37
38
39 --echo '#---------------------BS_STVARS_028_02----------------------#'
40 ####################################################################
41 # Check if Value can set #
42 ####################################################################
43
44 SET @@global.innodb_file_per_table = 0;
45 SELECT @@global.innodb_file_per_table;
46
47 SET @@global.innodb_file_per_table ='On' ;
48 SELECT @@global.innodb_file_per_table;
49
50 SET @@global.innodb_file_per_table ='Off' ;
51 SELECT @@global.innodb_file_per_table;
52
53 SET @@global.innodb_file_per_table = 1;
54 SELECT @@global.innodb_file_per_table;
55
56 --echo '#---------------------BS_STVARS_028_03----------------------#'
57 #################################################################
58 # Check if the value in GLOBAL Table matches value in variable #
59 #################################################################
60
61 --disable_warnings
62 SELECT IF(@@GLOBAL.innodb_file_per_table,'ON','OFF') = VARIABLE_VALUE
63 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
64 WHERE VARIABLE_NAME='innodb_file_per_table';
65 --enable_warnings
66 --echo 1 Expected
67
68 SELECT COUNT(@@GLOBAL.innodb_file_per_table);
69 --echo 1 Expected
70
71 --disable_warnings
72 SELECT COUNT(VARIABLE_VALUE)
73 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
74 WHERE VARIABLE_NAME='innodb_file_per_table';
75 --enable_warnings
76 --echo 1 Expected
77
78
79
80 --echo '#---------------------BS_STVARS_028_04----------------------#'
81 ################################################################################
82 # Check if accessing variable with and without GLOBAL point to same variable #
83 ################################################################################
84 SELECT @@innodb_file_per_table = @@GLOBAL.innodb_file_per_table;
85 --echo 1 Expected
86
87
88
89 --echo '#---------------------BS_STVARS_028_05----------------------#'
90 ################################################################################
91 # Check if innodb_file_per_table can be accessed with and without @@ sign #
92 ################################################################################
93
94 SELECT COUNT(@@innodb_file_per_table);
95 --echo 1 Expected
96
97 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
98 SELECT COUNT(@@local.innodb_file_per_table);
99 --echo Expected error 'Variable is a GLOBAL variable'
100
101 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
102 SELECT COUNT(@@SESSION.innodb_file_per_table);
103 --echo Expected error 'Variable is a GLOBAL variable'
104
105 SELECT COUNT(@@GLOBAL.innodb_file_per_table);
106 --echo 1 Expected
107
108 --Error ER_BAD_FIELD_ERROR
109 SELECT innodb_file_per_table = @@SESSION.innodb_file_per_table;
110
111 #
112 # Cleanup
113 #
114
115 SET @@global.innodb_file_per_table = @start_global_value;
116 SELECT @@global.innodb_file_per_table;