Debian Codegraph @

mysql-test/suite/x/r/insert_table.result

raw
1 create schema xtest default charset='utf8mb4';
2 RUN use xtest
3
4 0 rows affected
5 RUN create table simpletable (id int auto_increment primary key, value int)
6
7 0 rows affected
8 RUN create table mytable (i int NOT NULL, ui int unsigned, vc varchar(100), f float, d double, dt datetime, ts timestamp(5), j json)
9
10 0 rows affected
11 send Mysqlx.Crud.Insert {
12 collection {
13 name: "mytable"
14 schema: "xtest"
15 }
16 data_model: TABLE
17 projection {
18 name: "i"
19 }
20 projection {
21 name: "ui"
22 }
23 projection {
24 name: "vc"
25 }
26 projection {
27 name: "f"
28 }
29 projection {
30 name: "d"
31 }
32 projection {
33 name: "dt"
34 }
35 projection {
36 name: "ts"
37 }
38 projection {
39 name: "j"
40 }
41 }
42
43 Mysqlx.Error {
44 severity: ERROR
45 code: 5013
46 msg: "Missing row data for Insert"
47 sql_state: "HY000"
48 }
49
50 RUN select count(*) from xtest.mytable
51 count(*)
52 0
53 0 rows affected
54 RUN truncate table xtest.mytable
55
56 0 rows affected
57 send Mysqlx.Crud.Insert {
58 collection {
59 name: "mytable"
60 schema: "xtest"
61 }
62 data_model: TABLE
63 projection {
64 name: "i"
65 }
66 projection {
67 name: "ui"
68 }
69 projection {
70 name: "vc"
71 }
72 projection {
73 name: "f"
74 }
75 projection {
76 name: "d"
77 }
78 projection {
79 name: "dt"
80 }
81 projection {
82 name: "ts"
83 }
84 projection {
85 name: "j"
86 }
87 row {
88 field {
89 type: LITERAL
90 literal {
91 type: V_SINT
92 v_signed_int: -100
93 }
94 }
95 field {
96 type: LITERAL
97 literal {
98 type: V_UINT
99 v_unsigned_int: 100
100 }
101 }
102 field {
103 type: LITERAL
104 literal {
105 type: V_STRING
106 v_string {
107 value: ""
108 }
109 }
110 }
111 field {
112 type: LITERAL
113 literal {
114 type: V_FLOAT
115 v_float: 0.333333
116 }
117 }
118 field {
119 type: LITERAL
120 literal {
121 type: V_DOUBLE
122 v_double: 0.333333333333
123 }
124 }
125 field {
126 type: LITERAL
127 literal {
128 type: V_STRING
129 v_string {
130 value: "2015-05-05 1:20:30"
131 }
132 }
133 }
134 field {
135 type: LITERAL
136 literal {
137 type: V_STRING
138 v_string {
139 value: "2015-06-06 03:10:20.12345"
140 }
141 }
142 }
143 field {
144 type: LITERAL
145 literal {
146 type: V_STRING
147 v_string {
148 value: "{\"name\":\"Me\"}"
149 }
150 }
151 }
152 }
153 row {
154 field {
155 type: LITERAL
156 literal {
157 type: V_NULL
158 }
159 }
160 field {
161 type: LITERAL
162 literal {
163 type: V_UINT
164 v_unsigned_int: 50
165 }
166 }
167 field {
168 type: LITERAL
169 literal {
170 type: V_STRING
171 v_string {
172 value: "new\'string"
173 }
174 }
175 }
176 field {
177 type: LITERAL
178 literal {
179 type: V_FLOAT
180 v_float: 0
181 }
182 }
183 field {
184 type: LITERAL
185 literal {
186 type: V_DOUBLE
187 v_double: 1
188 }
189 }
190 field {
191 type: LITERAL
192 literal {
193 type: V_STRING
194 v_string {
195 value: "2000-1-1 1:1:1"
196 }
197 }
198 }
199 field {
200 type: LITERAL
201 literal {
202 type: V_STRING
203 v_string {
204 value: "1999-2-2 2:2:2.22222"
205 }
206 }
207 }
208 field {
209 type: LITERAL
210 literal {
211 type: V_NULL
212 }
213 }
214 }
215 }
216
217 Mysqlx.Error {
218 severity: ERROR
219 code: 1048
220 msg: "Column \'i\' cannot be null"
221 sql_state: "23000"
222 }
223
224 RUN select count(*) from xtest.mytable
225 count(*)
226 0
227 0 rows affected
228 RUN truncate table xtest.mytable
229
230 0 rows affected
231 Valid cases
232 send Mysqlx.Crud.Insert {
233 collection {
234 name: "mytable"
235 schema: "xtest"
236 }
237 data_model: TABLE
238 projection {
239 name: "i"
240 }
241 projection {
242 name: "ui"
243 }
244 projection {
245 name: "vc"
246 }
247 projection {
248 name: "f"
249 }
250 projection {
251 name: "d"
252 }
253 projection {
254 name: "dt"
255 }
256 projection {
257 name: "ts"
258 }
259 projection {
260 name: "j"
261 }
262 row {
263 field {
264 type: LITERAL
265 literal {
266 type: V_SINT
267 v_signed_int: -100
268 }
269 }
270 field {
271 type: LITERAL
272 literal {
273 type: V_UINT
274 v_unsigned_int: 100
275 }
276 }
277 field {
278 type: LITERAL
279 literal {
280 type: V_STRING
281 v_string {
282 value: "string"
283 }
284 }
285 }
286 field {
287 type: LITERAL
288 literal {
289 type: V_FLOAT
290 v_float: 0.333333
291 }
292 }
293 field {
294 type: LITERAL
295 literal {
296 type: V_DOUBLE
297 v_double: 0.333333333333
298 }
299 }
300 field {
301 type: LITERAL
302 literal {
303 type: V_STRING
304 v_string {
305 value: "2015-05-05 1:20:30"
306 }
307 }
308 }
309 field {
310 type: LITERAL
311 literal {
312 type: V_STRING
313 v_string {
314 value: "2015-06-06 03:10:20.12345"
315 }
316 }
317 }
318 field {
319 type: LITERAL
320 literal {
321 type: V_STRING
322 v_string {
323 value: "{\"name\":\"Me\"}"
324 }
325 }
326 }
327 }
328 }
329
330
331 1 rows affected
332 RUN select count(*) from xtest.mytable
333 count(*)
334 1
335 0 rows affected
336 RUN truncate table xtest.mytable
337
338 0 rows affected
339 send Mysqlx.Crud.Insert {
340 collection {
341 name: "mytable"
342 schema: "xtest"
343 }
344 data_model: TABLE
345 projection {
346 name: "i"
347 }
348 projection {
349 name: "ui"
350 }
351 projection {
352 name: "vc"
353 }
354 projection {
355 name: "f"
356 }
357 projection {
358 name: "d"
359 }
360 projection {
361 name: "dt"
362 }
363 projection {
364 name: "ts"
365 }
366 projection {
367 name: "j"
368 }
369 row {
370 field {
371 type: LITERAL
372 literal {
373 type: V_SINT
374 v_signed_int: -100
375 }
376 }
377 field {
378 type: LITERAL
379 literal {
380 type: V_UINT
381 v_unsigned_int: 100
382 }
383 }
384 field {
385 type: LITERAL
386 literal {
387 type: V_STRING
388 v_string {
389 value: ""
390 }
391 }
392 }
393 field {
394 type: LITERAL
395 literal {
396 type: V_FLOAT
397 v_float: 0.333333
398 }
399 }
400 field {
401 type: LITERAL
402 literal {
403 type: V_DOUBLE
404 v_double: 0.333333333333
405 }
406 }
407 field {
408 type: LITERAL
409 literal {
410 type: V_STRING
411 v_string {
412 value: "2015-05-05 1:20:30"
413 }
414 }
415 }
416 field {
417 type: LITERAL
418 literal {
419 type: V_STRING
420 v_string {
421 value: "2015-06-06 03:10:20.12345"
422 }
423 }
424 }
425 field {
426 type: LITERAL
427 literal {
428 type: V_STRING
429 v_string {
430 value: "{\"name\":\"Me\"}"
431 }
432 }
433 }
434 }
435 row {
436 field {
437 type: LITERAL
438 literal {
439 type: V_SINT
440 v_signed_int: -50
441 }
442 }
443 field {
444 type: LITERAL
445 literal {
446 type: V_UINT
447 v_unsigned_int: 50
448 }
449 }
450 field {
451 type: LITERAL
452 literal {
453 type: V_STRING
454 v_string {
455 value: "new\'string"
456 }
457 }
458 }
459 field {
460 type: LITERAL
461 literal {
462 type: V_FLOAT
463 v_float: 0
464 }
465 }
466 field {
467 type: LITERAL
468 literal {
469 type: V_DOUBLE
470 v_double: 1
471 }
472 }
473 field {
474 type: LITERAL
475 literal {
476 type: V_STRING
477 v_string {
478 value: "2000-1-1 1:1:1"
479 }
480 }
481 }
482 field {
483 type: LITERAL
484 literal {
485 type: V_STRING
486 v_string {
487 value: "1999-2-2 2:2:2.22222"
488 }
489 }
490 }
491 field {
492 type: LITERAL
493 literal {
494 type: V_NULL
495 }
496 }
497 }
498 }
499
500
501 2 rows affected
502 Records: 2 Duplicates: 0 Warnings: 0
503 send Mysqlx.Crud.Insert {
504 collection {
505 name: "simpletable"
506 schema: "xtest"
507 }
508 data_model: TABLE
509 projection {
510 name: "value"
511 }
512 row {
513 field {
514 type: LITERAL
515 literal {
516 type: V_SINT
517 v_double: 5
518 }
519 }
520 }
521 row {
522 field {
523 type: LITERAL
524 literal {
525 type: V_SINT
526 v_double: 6
527 }
528 }
529 }
530 }
531
532
533 2 rows affected
534 last insert id: 1
535 Records: 2 Duplicates: 0 Warnings: 0
536 RUN select count(*) from xtest.mytable
537 count(*)
538 2
539 0 rows affected
540 Mysqlx.Ok {
541 msg: "bye!"
542 }
543 ok