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 SELECT @@global.concurrent_insert = VARIABLE_VALUE
125 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES
126 WHERE VARIABLE_NAME='concurrent_insert';
127
128
129 --echo '#---------------------FN_DYNVARS_018_07----------------------#'
130 ###################################################################
131 # Check if ON and OFF values can be used on variable #
132 ###################################################################
133
134 --Error ER_WRONG_VALUE_FOR_VAR
135 SET @@global.concurrent_insert = OFF;
136 --Error ER_WRONG_VALUE_FOR_VAR
137 SET @@global.concurrent_insert = ON;
138
139
140 --echo '#---------------------FN_DYNVARS_018_08----------------------#'
141 ###################################################################
142 # Check if TRUE and FALSE values can be used on variable #
143 ###################################################################
144
145 SET @@global.concurrent_insert = TRUE;
146 SELECT @@global.concurrent_insert;
147 SET @@global.concurrent_insert = FALSE;
148 SELECT @@global.concurrent_insert;
149
150 --echo '#---------------------FN_DYNVARS_018_09----------------------#'
151 ###############################################################################
152 # Check if accessing variable without SCOPE points to same global variable #
153 ###############################################################################
154
155 SET @@global.concurrent_insert = 1;
156 SELECT @@concurrent_insert = @@global.concurrent_insert;
157
158
159 --echo '#---------------------FN_DYNVARS_018_10----------------------#'
160 ###############################################################################
161 # Check if concurrent_insert can be accessed with and without @@ sign #
162 ###############################################################################
163
164 --Error ER_GLOBAL_VARIABLE
165 SET concurrent_insert = 1;
166 SELECT @@concurrent_insert;
167 --Error ER_UNKNOWN_TABLE
168 SELECT global.concurrent_insert;
169 --Error ER_BAD_FIELD_ERROR
170 SELECT concurrent_insert = @@session.concurrent_insert;
171
172 ##############################
173 # Restore initial value #
174 ##############################
175
176 SET @@global.concurrent_insert = @start_value;
177 SELECT @@global.concurrent_insert;
178
179 #######################################################
180 # END OF concurrent_insert TESTS #
181 #######################################################
182