Debian Codegraph @

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

raw
1 ##### mysql-test\t\innodb_compression_failure_threshold_pct_basic.test ########
2 # #
3 # Variable Name: innodb_compression_failure_threshold_pct #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: Numeric #
7 # Default Value: 5 #
8 # Range: 0-100 #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Rizwan #
13 # #
14 #Description: Test Cases of Dynamic System Variable #
15 # innodb_compression_failure_threshold_pct #
16 # that checks the behavior of #
17 # this variable in the following ways #
18 # * Default Value #
19 # * Valid & Invalid values #
20 # * Scope & Access method #
21 # * Data Integrity #
22 # #
23 # Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
24 # server-system-variables.html #
25 # #
26 ###############################################################################
27 --source include/have_innodb.inc
28 --source include/load_sysvars.inc
29
30 ######################################################################
31 # START OF innodb_compression_failure_threshold_pct TESTS #
32 ######################################################################
33
34
35 ############################################################################################
36 # Saving initial value of innodb_compression_failure_threshold_pct in a temporary variable #
37 ############################################################################################
38
39 SET @global_start_value = @@global.innodb_compression_failure_threshold_pct;
40 SELECT @global_start_value;
41
42 --echo '#--------------------FN_DYNVARS_046_01------------------------#'
43 ########################################################################
44 # Display the DEFAULT value of innodb_compression_failure_threshold_pct#
45 ########################################################################
46
47 SET @@global.innodb_compression_failure_threshold_pct = 0;
48 SET @@global.innodb_compression_failure_threshold_pct = DEFAULT;
49 SELECT @@global.innodb_compression_failure_threshold_pct;
50
51 --echo '#---------------------FN_DYNVARS_046_02-------------------------#'
52 ##############################################################################################
53 # check if innodb_compression_failure_threshold_pct can be accessed with and without @@ sign #
54 ##############################################################################################
55
56 --Error ER_GLOBAL_VARIABLE
57 SET innodb_compression_failure_threshold_pct = 1;
58 SELECT @@innodb_compression_failure_threshold_pct;
59
60 --Error ER_UNKNOWN_TABLE
61 SELECT local.innodb_compression_failure_threshold_pct;
62
63 SET global innodb_compression_failure_threshold_pct = 0;
64 SELECT @@global.innodb_compression_failure_threshold_pct;
65
66 --echo '#--------------------FN_DYNVARS_046_03------------------------#'
67 #################################################################################
68 # change the value of innodb_compression_failure_threshold_pct to a valid value #
69 #################################################################################
70
71 SET @@global.innodb_compression_failure_threshold_pct = 0;
72 SELECT @@global.innodb_compression_failure_threshold_pct;
73
74 SET @@global.innodb_compression_failure_threshold_pct = 1;
75 SELECT @@global.innodb_compression_failure_threshold_pct;
76 SET @@global.innodb_compression_failure_threshold_pct = 100;
77 SELECT @@global.innodb_compression_failure_threshold_pct;
78
79 --echo '#--------------------FN_DYNVARS_046_04-------------------------#'
80 ################################################################################
81 # Cange the value of innodb_compression_failure_threshold_pct to invalid value #
82 ################################################################################
83
84 SET @@global.innodb_compression_failure_threshold_pct = -1;
85 SELECT @@global.innodb_compression_failure_threshold_pct;
86
87 --Error ER_WRONG_TYPE_FOR_VAR
88 SET @@global.innodb_compression_failure_threshold_pct = "T";
89 SELECT @@global.innodb_compression_failure_threshold_pct;
90 --Error ER_WRONG_TYPE_FOR_VAR
91 SET @@global.innodb_compression_failure_threshold_pct = 1.1;
92 SELECT @@global.innodb_compression_failure_threshold_pct;
93
94 --Error ER_WRONG_TYPE_FOR_VAR
95 SET @@global.innodb_compression_failure_threshold_pct = "Y";
96 SELECT @@global.innodb_compression_failure_threshold_pct;
97
98 SET @@global.innodb_compression_failure_threshold_pct = 101;
99 SELECT @@global.innodb_compression_failure_threshold_pct;
100 --Error ER_WRONG_TYPE_FOR_VAR
101 SET @@global.innodb_compression_failure_threshold_pct = " ";
102 SELECT @@global.innodb_compression_failure_threshold_pct;
103 --Error ER_WRONG_TYPE_FOR_VAR
104 SET @@global.innodb_compression_failure_threshold_pct = ' ';
105 SELECT @@global.innodb_compression_failure_threshold_pct;
106
107 --echo '#----------------------FN_DYNVARS_046_05------------------------#'
108 #########################################################################
109 # Check if the value in GLOBAL Table matches value in variable #
110 #########################################################################
111
112 --disable_warnings
113 SELECT @@global.innodb_compression_failure_threshold_pct =
114 VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
115 WHERE VARIABLE_NAME='innodb_compression_failure_threshold_pct';
116 --enable_warnings
117 SELECT @@global.innodb_compression_failure_threshold_pct;
118 --disable_warnings
119 SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
120 WHERE VARIABLE_NAME='innodb_compression_failure_threshold_pct';
121 --enable_warnings
122
123 --echo '#---------------------FN_DYNVARS_046_06-------------------------#'
124 ###################################################################
125 # Check if ON and OFF values can be used on variable #
126 ###################################################################
127
128 --ERROR ER_WRONG_TYPE_FOR_VAR
129 SET @@global.innodb_compression_failure_threshold_pct = OFF;
130 SELECT @@global.innodb_compression_failure_threshold_pct;
131
132 --ERROR ER_WRONG_TYPE_FOR_VAR
133 SET @@global.innodb_compression_failure_threshold_pct = ON;
134 SELECT @@global.innodb_compression_failure_threshold_pct;
135
136 --echo '#---------------------FN_DYNVARS_046_07----------------------#'
137 ###################################################################
138 # Check if TRUE and FALSE values can be used on variable #
139 ###################################################################
140
141 SET @@global.innodb_compression_failure_threshold_pct = TRUE;
142 SELECT @@global.innodb_compression_failure_threshold_pct;
143 SET @@global.innodb_compression_failure_threshold_pct = FALSE;
144 SELECT @@global.innodb_compression_failure_threshold_pct;
145
146 ##############################
147 # Restore initial value #
148 ##############################
149
150 SET @@global.innodb_compression_failure_threshold_pct = @global_start_value;
151 SELECT @@global.innodb_compression_failure_threshold_pct;
152
153 ###############################################################
154 # END OF innodb_compression_failure_threshold_pct TESTS #
155 ###############################################################