Debian Codegraph @

mysql-test/suite/x/t/insert_table_bad_numcolumns.test

raw
1 ## generated
2 ## Rel: Insert a row with mismatched number of column/params
3
4 --source include/xplugin_preamble.inc
5 --source include/xplugin_create_user.inc
6
7 create schema xtest default charset='utf8mb4';
8
9 ## Test starts here
10 --write_file $MYSQL_TMP_DIR/insert_table_bad_numcolumns.xpl
11 ## Test data
12 -->sql
13 use xtest;
14 create table mytable (i int NOT NULL, ui int unsigned, vc varchar(100), f float, d double, dt datetime, ts timestamp(5), j json);
15 -->endsql
16
17 Mysqlx.Crud.Insert {
18 collection {
19 name: "mytable"
20 schema: "xtest"
21 }
22 data_model: TABLE
23 projection {
24 name: "i"
25 }
26 projection {
27 name: "ui"
28 }
29 projection {
30 name: "vc"
31 }
32 projection {
33 name: "f"
34 }
35 projection {
36 name: "d"
37 }
38 projection {
39 name: "dt"
40 }
41 projection {
42 name: "ts"
43 }
44 projection {
45 name: "j"
46 }
47 row {
48 field {
49 type: LITERAL
50 literal {
51 type: V_SINT
52 v_signed_int: -100
53 }
54 }
55 field {
56 type: LITERAL
57 literal {
58 type: V_UINT
59 v_unsigned_int: 100
60 }
61 }
62 field {
63 type: LITERAL
64 literal {
65 type: V_STRING
66 v_string {
67 value: ""
68 }
69 }
70 }
71 field {
72 type: LITERAL
73 literal {
74 type: V_FLOAT
75 v_float: 0.333333
76 }
77 }
78 field {
79 type: LITERAL
80 literal {
81 type: V_DOUBLE
82 v_double: 0.333333333333
83 }
84 }
85 field {
86 type: LITERAL
87 literal {
88 type: V_STRING
89 v_string {
90 value: "2015-05-05 1:20:30"
91 }
92 }
93 }
94 field {
95 type: LITERAL
96 literal {
97 type: V_STRING
98 v_string {
99 value: "2015-06-06 03:10:20.12345"
100 }
101 }
102 }
103 field {
104 type: LITERAL
105 literal {
106 type: V_STRING
107 v_string {
108 value: "{\"name\":\"Me\"}"
109 }
110 }
111 }
112 field {
113 type: LITERAL
114 literal {
115 type: V_SINT
116 v_signed_int: 1234
117 }
118 }
119 }
120 }
121
122 ## expect Mysqlx.Error
123 -->recv
124 Mysqlx.Crud.Insert {
125 collection {
126 name: "mytable"
127 schema: "xtest"
128 }
129 data_model: TABLE
130 projection {
131 name: "ui"
132 }
133 projection {
134 name: "vc"
135 }
136 projection {
137 name: "f"
138 }
139 projection {
140 name: "d"
141 }
142 projection {
143 name: "dt"
144 }
145 projection {
146 name: "ts"
147 }
148 projection {
149 name: "j"
150 }
151 row {
152 field {
153 type: LITERAL
154 literal {
155 type: V_SINT
156 v_signed_int: -100
157 }
158 }
159 field {
160 type: LITERAL
161 literal {
162 type: V_UINT
163 v_unsigned_int: 100
164 }
165 }
166 field {
167 type: LITERAL
168 literal {
169 type: V_STRING
170 v_string {
171 value: ""
172 }
173 }
174 }
175 field {
176 type: LITERAL
177 literal {
178 type: V_FLOAT
179 v_float: 0.333333
180 }
181 }
182 field {
183 type: LITERAL
184 literal {
185 type: V_DOUBLE
186 v_double: 0.333333333333
187 }
188 }
189 field {
190 type: LITERAL
191 literal {
192 type: V_STRING
193 v_string {
194 value: "2015-05-05 1:20:30"
195 }
196 }
197 }
198 field {
199 type: LITERAL
200 literal {
201 type: V_STRING
202 v_string {
203 value: "2015-06-06 03:10:20.12345"
204 }
205 }
206 }
207 field {
208 type: LITERAL
209 literal {
210 type: V_STRING
211 v_string {
212 value: "{\"name\":\"Me\"}"
213 }
214 }
215 }
216 }
217 }
218
219 ## expect Mysqlx.Error
220 -->recv
221 Mysqlx.Crud.Insert {
222 collection {
223 name: "mytable"
224 schema: "xtest"
225 }
226 data_model: TABLE
227 projection {
228 name: "i"
229 }
230 projection {
231 name: "ui"
232 }
233 projection {
234 name: "vc"
235 }
236 projection {
237 name: "f"
238 }
239 projection {
240 name: "d"
241 }
242 projection {
243 name: "dt"
244 }
245 projection {
246 name: "ts"
247 }
248 projection {
249 name: "j"
250 }
251 row {
252 field {
253 type: LITERAL
254 literal {
255 type: V_UINT
256 v_unsigned_int: 100
257 }
258 }
259 field {
260 type: LITERAL
261 literal {
262 type: V_STRING
263 v_string {
264 value: ""
265 }
266 }
267 }
268 field {
269 type: LITERAL
270 literal {
271 type: V_FLOAT
272 v_float: 0.333333
273 }
274 }
275 field {
276 type: LITERAL
277 literal {
278 type: V_DOUBLE
279 v_double: 0.333333333333
280 }
281 }
282 field {
283 type: LITERAL
284 literal {
285 type: V_STRING
286 v_string {
287 value: "2015-05-05 1:20:30"
288 }
289 }
290 }
291 field {
292 type: LITERAL
293 literal {
294 type: V_STRING
295 v_string {
296 value: "2015-06-06 03:10:20.12345"
297 }
298 }
299 }
300 field {
301 type: LITERAL
302 literal {
303 type: V_STRING
304 v_string {
305 value: "{\"name\":\"Me\"}"
306 }
307 }
308 }
309 }
310 }
311
312 ## expect Mysqlx.Error
313 -->recv
314 Mysqlx.Sql.StmtExecute {
315 stmt: "select count(*) from xtest.mytable"
316 }
317
318 ## expect Mysqlx.Resultset.ColumnMetaData
319 -->recv
320 ## expect Mysqlx.Resultset.Row
321 -->recv
322 ## expect Mysqlx.Resultset.FetchDone
323 -->recv
324 ## expect Notice
325 -->recv
326 ## expect Mysqlx.Sql.StmtExecuteOk
327 -->recv
328 EOF
329
330 --exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/insert_table_bad_numcolumns.xpl 2>&1
331
332 ## Cleanup
333 --source ../include/xplugin_cleanup.inc