Debian Codegraph @

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

raw
1 ############## mysql-test\t\concurrent_insert_basic.test #######################
2 # #
3 # Variable Name: concurrent_insert #
4 # Scope: GLOBAL #
5 # Access Type: Dynamic #
6 # Data Type: Boolean & Numeric #
7 # Default Value: 1 #
8 # Valid Values: 0,1 & 2 #
9 # #
10 # #
11 # Creation Date: 2008-02-07 #
12 # Author: Salman Rawala #
13 # #
14 # Description: Test Cases of Dynamic System Variable "concurrent_insert" #
15 # that checks behavior of this variable in the following ways #
16 # * Default Value #
17 # * Valid & Invalid values #
18 # * Scope & Access method #
19 # * Data Integrity . #
20 # #
21 # Reference: http://dev.mysql.com/doc/refman/5.1/en/ #
22 # server-system-variables.html#option_mysqld_concurrent_insert #
23 # #
24 ################################################################################
25
26 --source include/load_sysvars.inc
27
28 #################################################################
29 # START OF concurrent_insert TESTS #
30 #################################################################
31
32
33 #########################################################################
34 # Saving initial value of concurrent_insert in a temporary variable #
35 #########################################################################
36
37 SET @start_value = @@global.concurrent_insert;
38 SELECT @start_value;
39
40 --echo '#--------------------FN_DYNVARS_018_01------------------------#'
41 #########################################################################
42 # Display the DEFAULT value of concurrent_insert #
43 #########################################################################
44
45 SET @@global.concurrent_insert = 0;
46 SET @@global.concurrent_insert = DEFAULT;
47 SELECT @@global.concurrent_insert;
48
49 --echo '#---------------------FN_DYNVARS_018_02-------------------------#'
50 ###############################################
51 # Verify default value of variable #
52 ###############################################
53
54 SET @@global.concurrent_insert = DEFAULT;
55 SELECT @@global.concurrent_insert = 1;
56
57
58 --echo '#--------------------FN_DYNVARS_018_03------------------------#'
59 #########################################################################
60 # Change the value of concurrent_insert to a valid value #
61 #########################################################################
62
63 SET @@global.concurrent_insert = 0;
64 SELECT @@global.concurrent_insert;
65 SET @@global.concurrent_insert = 1;
66 SELECT @@global.concurrent_insert;
67 SET @@global.concurrent_insert = 2;
68 SELECT @@global.concurrent_insert;
69
70 SET @@global.concurrent_insert = NEVER;
71 SELECT @@global.concurrent_insert;
72 SET @@global.concurrent_insert = AUTO;
73 SELECT @@global.concurrent_insert;
74 SET @@global.concurrent_insert = ALWAYS;
75 SELECT @@global.concurrent_insert;
76
77 --echo '#--------------------FN_DYNVARS_018_04-------------------------#'
78 ###########################################################################
79 # Change the value of concurrent_insert to invalid value #
80 ###########################################################################
81
82 --error ER_WRONG_VALUE_FOR_VAR
83 SET @@global.concurrent_insert = -1;
84 --error ER_WRONG_VALUE_FOR_VAR
85 SET @@global.concurrent_insert = 100;
86 --Error ER_WRONG_VALUE_FOR_VAR
87 SET @@global.concurrent_insert = TRUEF;
88 --Error ER_WRONG_VALUE_FOR_VAR
89 SET @@global.concurrent_insert = TRUE_F;
90 --Error ER_WRONG_VALUE_FOR_VAR
91 SET @@global.concurrent_insert = FALSE0;
92 --Error ER_WRONG_VALUE_FOR_VAR
93 SET @@global.concurrent_insert = OON;
94 --Error ER_WRONG_VALUE_FOR_VAR
95 SET @@global.concurrent_insert = ONN;
96 --Error ER_WRONG_VALUE_FOR_VAR
97 SET @@global.concurrent_insert = OOFF;
98 --Error ER_WRONG_VALUE_FOR_VAR
99 SET @@global.concurrent_insert = 0FF;
100 --Error ER_WRONG_VALUE_FOR_VAR
101 SET @@global.concurrent_insert = ' ';
102 --Error ER_WRONG_VALUE_FOR_VAR
103 SET @@global.concurrent_insert = " ";
104 --Error ER_WRONG_VALUE_FOR_VAR
105 SET @@global.concurrent_insert = '';
106
107
108 --echo '#-------------------FN_DYNVARS_018_05----------------------------#'
109 #####################################################################
110 # Test if accessing session concurrent_insert gives error #
111 #####################################################################
112
113 --Error ER_GLOBAL_VARIABLE
114 SET @@session.concurrent_insert = 1;
115 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
116 SELECT @@session.concurrent_insert = 1;
117
118
119 --echo '#----------------------FN_DYNVARS_018_06------------------------#'
120 ####################################################################
121 # Check if the value in GLOBAL Tables matches values in variable #
122 ####################################################################
123
124 --disable_warnings
125 SELECT @@global.concurrent_insert = VARIABLE_VALUE
126 FROM performance_schema.global_variables
127 WHERE VARIABLE_NAME='concurrent_insert';
128 --enable_warnings
129
130
131 --echo '#---------------------FN_DYNVARS_018_07----------------------#'
132 ###################################################################
133 # Check if ON and OFF values can be used on variable #
134 ###################################################################
135
136 --Error ER_WRONG_VALUE_FOR_VAR
137 SET @@global.concurrent_insert = OFF;
138 --Error ER_WRONG_VALUE_FOR_VAR
139 SET @@global.concurrent_insert = ON;
140
141
142 --echo '#---------------------FN_DYNVARS_018_08----------------------#'
143 ###################################################################
144 # Check if TRUE and FALSE values can be used on variable #
145 ###################################################################
146
147 SET @@global.concurrent_insert = TRUE;
148 SELECT @@global.concurrent_insert;
149 SET @@global.concurrent_insert = FALSE;
150 SELECT @@global.concurrent_insert;
151
152 --echo '#---------------------FN_DYNVARS_018_09----------------------#'
153 ###############################################################################
154 # Check if accessing variable without SCOPE points to same global variable #
155 ###############################################################################
156
157 SET @@global.concurrent_insert = 1;
158 SELECT @@concurrent_insert = @@global.concurrent_insert;
159
160
161 --echo '#---------------------FN_DYNVARS_018_10----------------------#'
162 ###############################################################################
163 # Check if concurrent_insert can be accessed with and without @@ sign #
164 ###############################################################################
165
166 --Error ER_GLOBAL_VARIABLE
167 SET concurrent_insert = 1;
168 SELECT @@concurrent_insert;
169 --Error ER_PARSE_ERROR
170 SET global.concurrent_insert = 1;
171 --Error ER_UNKNOWN_TABLE
172 SELECT global.concurrent_insert;
173 --Error ER_BAD_FIELD_ERROR
174 SELECT concurrent_insert;
175 --Error ER_INCORRECT_GLOBAL_LOCAL_VAR
176 SELECT @@session.concurrent_insert;
177
178 ##############################
179 # Restore initial value #
180 ##############################
181
182 SET @@global.concurrent_insert = @start_value;
183 SELECT @@global.concurrent_insert;
184
185 #######################################################
186 # END OF concurrent_insert TESTS #
187 #######################################################
188