Debian Codegraph @

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

raw
1 ==============================================
2 CRUD INSERT SCENARIOS
3 ==============================================
4
5 ================================================================================
6 PREAMBLE
7 ================================================================================
8 create user insertcruduser@localhost identified by 'insertcruduser';
9 grant all on *.* to insertcruduser@localhost;
10 ================================================================================
11 TEST START
12 ================================================================================
13 RUN DROP SCHEMA if EXISTS mysqlxplugin
14
15 0 rows affected
16 RUN CREATE SCHEMA mysqlxplugin DEFAULT CHARSET='utf8'
17
18 1 rows affected
19 RUN USE mysqlxplugin
20
21 0 rows affected
22 RUN CREATE TABLE categories (
23 CategoryID int NOT NULL AUTO_INCREMENT,
24 CategoryName varchar(100),
25 CategoryDescription varchar(200),
26 CategoryIMEI tinyint,
27 CategoryDecimal decimal(5,2),
28 CategoryBool bit(1),
29 PRIMARY key (CategoryID)
30 )
31
32 0 rows affected
33 RUN SHOW STATUS like 'Mysqlx_crud_insert'
34 Variable_name Value
35 Mysqlx_crud_insert 0
36 0 rows affected
37 Insert multiple rows
38 send Mysqlx.Crud.Insert {
39 collection {
40 name: "categories"
41 schema: "mysqlxplugin"
42 }
43 data_model: TABLE
44 projection {
45 name: "CategoryID"
46 }
47 projection {
48 name: "CategoryName"
49 }
50 projection {
51 name: "CategoryDescription"
52 }
53 projection {
54 name: "CategoryIMEI"
55 }
56 projection {
57 name: "CategoryDecimal"
58 }
59 projection {
60 name: "CategoryBool"
61 }
62 row {
63 field {
64 type: LITERAL
65 literal {
66 type: V_SINT
67 v_signed_int: 1
68 }
69 }
70 field {
71 type: LITERAL
72 literal {
73 type: V_STRING
74 v_string {
75 value: "Sports"
76 }
77 }
78 }
79 field {
80 type: LITERAL
81 literal {
82 type: V_STRING
83 v_string {
84 value: "Sports related category"
85 }
86 }
87 }
88 field {
89 type: LITERAL
90 literal {
91 type: V_SINT
92 v_signed_int: 1
93 }
94 }
95 field {
96 type: LITERAL
97 literal {
98 type: V_DOUBLE
99 v_double: 235.15
100 }
101 }
102 field {
103 type: LITERAL
104 literal {
105 type: V_BOOL
106 v_bool: false
107 }
108 }
109 }
110 row {
111 field {
112 type: LITERAL
113 literal {
114 type: V_SINT
115 v_signed_int: 2
116 }
117 }
118 field {
119 type: LITERAL
120 literal {
121 type: V_STRING
122 v_string {
123 value: "Entertaiment"
124 }
125 }
126 }
127 field {
128 type: LITERAL
129 literal {
130 type: V_STRING
131 v_string {
132 value: "Entertaiment related category"
133 }
134 }
135 }
136 field {
137 type: LITERAL
138 literal {
139 type: V_SINT
140 v_signed_int: 2
141 }
142 }
143 field {
144 type: LITERAL
145 literal {
146 type: V_DOUBLE
147 v_double: 156.17
148 }
149 }
150 field {
151 type: LITERAL
152 literal {
153 type: V_BOOL
154 v_bool: true
155 }
156 }
157 }
158 row {
159 field {
160 type: LITERAL
161 literal {
162 type: V_SINT
163 v_signed_int: 18
164 }
165 }
166 field {
167 type: LITERAL
168 literal {
169 type: V_STRING
170 v_string {
171 value: "Cooking"
172 }
173 }
174 }
175 field {
176 type: LITERAL
177 literal {
178 type: V_STRING
179 v_string {
180 value: "Cooking related category"
181 }
182 }
183 }
184 field {
185 type: LITERAL
186 literal {
187 type: V_SINT
188 v_signed_int: 18
189 }
190 }
191 field {
192 type: LITERAL
193 literal {
194 type: V_DOUBLE
195 v_double: 116.17
196 }
197 }
198 field {
199 type: LITERAL
200 literal {
201 type: V_BOOL
202 v_bool: true
203 }
204 }
205 }
206 }
207
208
209 3 rows affected
210 last insert id: 18
211 Records: 3 Duplicates: 0 Warnings: 0
212 RUN select * from categories
213 CategoryID CategoryName CategoryDescription CategoryIMEI CategoryDecimal CategoryBool
214 1 Sports Sports related category 1 235.15 0
215 2 Entertaiment Entertaiment related category 2 156.17 1
216 18 Cooking Cooking related category 18 116.17 1
217 0 rows affected
218 RUN SHOW STATUS like 'Mysqlx_crud_insert'
219 Variable_name Value
220 Mysqlx_crud_insert 1
221 0 rows affected
222 Insert Quotes with scape character
223 send Mysqlx.Crud.Insert {
224 collection {
225 name: "categories"
226 schema: "mysqlxplugin"
227 }
228 data_model: TABLE
229 projection {
230 name: "CategoryID"
231 }
232 projection {
233 name: "CategoryName"
234 }
235 projection {
236 name: "CategoryDescription"
237 }
238 projection {
239 name: "CategoryIMEI"
240 }
241 projection {
242 name: "CategoryDecimal"
243 }
244 projection {
245 name: "CategoryBool"
246 }
247 row {
248 field {
249 type: LITERAL
250 literal {
251 type: V_SINT
252 v_signed_int: 3
253 }
254 }
255 field {
256 type: LITERAL
257 literal {
258 type: V_STRING
259 v_string {
260 value: "\"Quotes\""
261 }
262 }
263 }
264 field {
265 type: LITERAL
266 literal {
267 type: V_STRING
268 v_string {
269 value: "Quote related category"
270 }
271 }
272 }
273 field {
274 type: LITERAL
275 literal {
276 type: V_SINT
277 v_signed_int: 3
278 }
279 }
280 field {
281 type: LITERAL
282 literal {
283 type: V_DOUBLE
284 v_double: 184.25
285 }
286 }
287 field {
288 type: LITERAL
289 literal {
290 type: V_BOOL
291 v_bool: false
292 }
293 }
294 }
295 }
296
297
298 1 rows affected
299 last insert id: 3
300 RUN select * from categories
301 CategoryID CategoryName CategoryDescription CategoryIMEI CategoryDecimal CategoryBool
302 1 Sports Sports related category 1 235.15 0
303 2 Entertaiment Entertaiment related category 2 156.17 1
304 3 "Quotes" Quote related category 3 184.25 0
305 18 Cooking Cooking related category 18 116.17 1
306 0 rows affected
307 RUN SHOW STATUS like 'Mysqlx_crud_insert'
308 Variable_name Value
309 Mysqlx_crud_insert 2
310 0 rows affected
311 Insert NULL values
312 send Mysqlx.Crud.Insert {
313 collection {
314 name: "categories"
315 schema: "mysqlxplugin"
316 }
317 data_model: TABLE
318 projection {
319 name: "CategoryID"
320 }
321 projection {
322 name: "CategoryName"
323 }
324 projection {
325 name: "CategoryDescription"
326 }
327 projection {
328 name: "CategoryIMEI"
329 }
330 projection {
331 name: "CategoryDecimal"
332 }
333 projection {
334 name: "CategoryBool"
335 }
336 row {
337 field {
338 type: LITERAL
339 literal {
340 type: V_NULL
341 }
342 }
343 field {
344 type: LITERAL
345 literal {
346 type: V_NULL
347 }
348 }
349 field {
350 type: LITERAL
351 literal {
352 type: V_NULL
353 }
354 }
355 field {
356 type: LITERAL
357 literal {
358 type: V_NULL
359 }
360 }
361 field {
362 type: LITERAL
363 literal {
364 type: V_NULL
365 }
366 }
367 field {
368 type: LITERAL
369 literal {
370 type: V_NULL
371 }
372 }
373 }
374 }
375
376
377 1 rows affected
378 last insert id: 19
379 RUN select * from categories
380 CategoryID CategoryName CategoryDescription CategoryIMEI CategoryDecimal CategoryBool
381 1 Sports Sports related category 1 235.15 0
382 2 Entertaiment Entertaiment related category 2 156.17 1
383 3 "Quotes" Quote related category 3 184.25 0
384 18 Cooking Cooking related category 18 116.17 1
385 19 null null null null null
386 0 rows affected
387 RUN SHOW STATUS like 'Mysqlx_crud_insert'
388 Variable_name Value
389 Mysqlx_crud_insert 3
390 0 rows affected
391 Insert Corner decimal value
392 send Mysqlx.Crud.Insert {
393 collection {
394 name: "categories"
395 schema: "mysqlxplugin"
396 }
397 data_model: TABLE
398 projection {
399 name: "CategoryID"
400 }
401 projection {
402 name: "CategoryName"
403 }
404 projection {
405 name: "CategoryDescription"
406 }
407 projection {
408 name: "CategoryIMEI"
409 }
410 projection {
411 name: "CategoryDecimal"
412 }
413 projection {
414 name: "CategoryBool"
415 }
416 row {
417 field {
418 type: LITERAL
419 literal {
420 type: V_SINT
421 v_signed_int: 6
422 }
423 }
424 field {
425 type: LITERAL
426 literal {
427 type: V_STRING
428 v_string {
429 value: "Kitchen2"
430 }
431 }
432 }
433 field {
434 type: LITERAL
435 literal {
436 type: V_STRING
437 v_string {
438 value: "Kitchen2 related category"
439 }
440 }
441 }
442 field {
443 type: LITERAL
444 literal {
445 type: V_SINT
446 v_signed_int: 6
447 }
448 }
449 field {
450 type: LITERAL
451 literal {
452 type: V_DOUBLE
453 v_double: 999.99
454 }
455 }
456 field {
457 type: LITERAL
458 literal {
459 type: V_BOOL
460 v_bool: true
461 }
462 }
463 }
464 row {
465 field {
466 type: LITERAL
467 literal {
468 type: V_SINT
469 v_signed_int: 12
470 }
471 }
472 field {
473 type: LITERAL
474 literal {
475 type: V_STRING
476 v_string {
477 value: "Kitchen"
478 }
479 }
480 }
481 field {
482 type: LITERAL
483 literal {
484 type: V_STRING
485 v_string {
486 value: "Kitchen related category"
487 }
488 }
489 }
490 field {
491 type: LITERAL
492 literal {
493 type: V_SINT
494 v_signed_int: 12
495 }
496 }
497 field {
498 type: LITERAL
499 literal {
500 type: V_DOUBLE
501 v_double: -999.99
502 }
503 }
504 field {
505 type: LITERAL
506 literal {
507 type: V_BOOL
508 v_bool: false
509 }
510 }
511 }
512 }
513
514
515 2 rows affected
516 last insert id: 12
517 Records: 2 Duplicates: 0 Warnings: 0
518 RUN select * from categories
519 CategoryID CategoryName CategoryDescription CategoryIMEI CategoryDecimal CategoryBool
520 1 Sports Sports related category 1 235.15 0
521 2 Entertaiment Entertaiment related category 2 156.17 1
522 3 "Quotes" Quote related category 3 184.25 0
523 6 Kitchen2 Kitchen2 related category 6 999.99 1
524 12 Kitchen Kitchen related category 12 -999.99 0
525 18 Cooking Cooking related category 18 116.17 1
526 19 null null null null null
527 0 rows affected
528 RUN SHOW STATUS like 'Mysqlx_crud_insert'
529 Variable_name Value
530 Mysqlx_crud_insert 4
531 0 rows affected
532 Insert Corner tiny int value
533 send Mysqlx.Crud.Insert {
534 collection {
535 name: "categories"
536 schema: "mysqlxplugin"
537 }
538 data_model: TABLE
539 projection {
540 name: "CategoryID"
541 }
542 projection {
543 name: "CategoryName"
544 }
545 projection {
546 name: "CategoryDescription"
547 }
548 projection {
549 name: "CategoryIMEI"
550 }
551 projection {
552 name: "CategoryDecimal"
553 }
554 projection {
555 name: "CategoryBool"
556 }
557 row {
558 field {
559 type: LITERAL
560 literal {
561 type: V_SINT
562 v_signed_int: 13
563 }
564 }
565 field {
566 type: LITERAL
567 literal {
568 type: V_STRING
569 v_string {
570 value: "Kitchen"
571 }
572 }
573 }
574 field {
575 type: LITERAL
576 literal {
577 type: V_STRING
578 v_string {
579 value: "Kitchen related category"
580 }
581 }
582 }
583 field {
584 type: LITERAL
585 literal {
586 type: V_SINT
587 v_signed_int: 127
588 }
589 }
590 field {
591 type: LITERAL
592 literal {
593 type: V_DOUBLE
594 v_double: 156.99
595 }
596 }
597 field {
598 type: LITERAL
599 literal {
600 type: V_BOOL
601 v_bool: false
602 }
603 }
604 }
605 row {
606 field {
607 type: LITERAL
608 literal {
609 type: V_SINT
610 v_signed_int: 14
611 }
612 }
613 field {
614 type: LITERAL
615 literal {
616 type: V_STRING
617 v_string {
618 value: "Kitchen"
619 }
620 }
621 }
622 field {
623 type: LITERAL
624 literal {
625 type: V_STRING
626 v_string {
627 value: "Kitchen related category"
628 }
629 }
630 }
631 field {
632 type: LITERAL
633 literal {
634 type: V_SINT
635 v_signed_int: -128
636 }
637 }
638 field {
639 type: LITERAL
640 literal {
641 type: V_DOUBLE
642 v_double: 156.99
643 }
644 }
645 field {
646 type: LITERAL
647 literal {
648 type: V_BOOL
649 v_bool: false
650 }
651 }
652 }
653 }
654
655
656 2 rows affected
657 last insert id: 14
658 Records: 2 Duplicates: 0 Warnings: 0
659 RUN select * from categories
660 CategoryID CategoryName CategoryDescription CategoryIMEI CategoryDecimal CategoryBool
661 1 Sports Sports related category 1 235.15 0
662 2 Entertaiment Entertaiment related category 2 156.17 1
663 3 "Quotes" Quote related category 3 184.25 0
664 6 Kitchen2 Kitchen2 related category 6 999.99 1
665 12 Kitchen Kitchen related category 12 -999.99 0
666 13 Kitchen Kitchen related category 127 156.99 0
667 14 Kitchen Kitchen related category -128 156.99 0
668 18 Cooking Cooking related category 18 116.17 1
669 19 null null null null null
670 0 rows affected
671 RUN SHOW STATUS like 'Mysqlx_crud_insert'
672 Variable_name Value
673 Mysqlx_crud_insert 5
674 0 rows affected
675 Mysqlx.Ok {
676 msg: "bye!"
677 }
678 ok
679 .
680 #---------- START NEGATIVE TABLE TESTING----------#
681 .
682 RUN USE mysqlxplugin
683
684 0 rows affected
685 Repeat key column ID
686 send Mysqlx.Crud.Insert {
687 collection {
688 name: "categories"
689 schema: "mysqlxplugin"
690 }
691 data_model: TABLE
692 projection {
693 name: "CategoryID"
694 }
695 projection {
696 name: "CategoryName"
697 }
698 projection {
699 name: "CategoryDescription"
700 }
701 projection {
702 name: "CategoryIMEI"
703 }
704 projection {
705 name: "CategoryDecimal"
706 }
707 projection {
708 name: "CategoryBool"
709 }
710 row {
711 field {
712 type: LITERAL
713 literal {
714 type: V_SINT
715 v_signed_int: 1
716 }
717 }
718 field {
719 type: LITERAL
720 literal {
721 type: V_STRING
722 v_string {
723 value: "Home"
724 }
725 }
726 }
727 field {
728 type: LITERAL
729 literal {
730 type: V_STRING
731 v_string {
732 value: "Home related category"
733 }
734 }
735 }
736 field {
737 type: LITERAL
738 literal {
739 type: V_SINT
740 v_signed_int: 1
741 }
742 }
743 field {
744 type: LITERAL
745 literal {
746 type: V_FLOAT
747 v_float: 235.15
748 }
749 }
750 field {
751 type: LITERAL
752 literal {
753 type: V_BOOL
754 v_bool: false
755 }
756 }
757 }
758 }
759
760 Got expected error: Duplicate entry '1' for key 'categories.PRIMARY' (code 1062)
761 Data types corner value plus 1
762 send Mysqlx.Crud.Insert {
763 collection {
764 name: "categories"
765 schema: "mysqlxplugin"
766 }
767 data_model: TABLE
768 projection {
769 name: "CategoryID"
770 }
771 projection {
772 name: "CategoryName"
773 }
774 projection {
775 name: "CategoryDescription"
776 }
777 projection {
778 name: "CategoryIMEI"
779 }
780 projection {
781 name: "CategoryDecimal"
782 }
783 projection {
784 name: "CategoryBool"
785 }
786 row {
787 field {
788 type: LITERAL
789 literal {
790 type: V_SINT
791 v_signed_int: 5
792 }
793 }
794 field {
795 type: LITERAL
796 literal {
797 type: V_STRING
798 v_string {
799 value: "Kitchen"
800 }
801 }
802 }
803 field {
804 type: LITERAL
805 literal {
806 type: V_STRING
807 v_string {
808 value: "Kitchen related category"
809 }
810 }
811 }
812 field {
813 type: LITERAL
814 literal {
815 type: V_SINT
816 v_signed_int: 4
817 }
818 }
819 field {
820 type: LITERAL
821 literal {
822 type: V_DOUBLE
823 v_double: 1000
824 }
825 }
826 field {
827 type: LITERAL
828 literal {
829 type: V_BOOL
830 v_bool: false
831 }
832 }
833 }
834 row {
835 field {
836 type: LITERAL
837 literal {
838 type: V_SINT
839 v_signed_int: 5
840 }
841 }
842 field {
843 type: LITERAL
844 literal {
845 type: V_STRING
846 v_string {
847 value: "Kitchen"
848 }
849 }
850 }
851 field {
852 type: LITERAL
853 literal {
854 type: V_STRING
855 v_string {
856 value: "Kitchen related category"
857 }
858 }
859 }
860 field {
861 type: LITERAL
862 literal {
863 type: V_SINT
864 v_signed_int: 128
865 }
866 }
867 field {
868 type: LITERAL
869 literal {
870 type: V_DOUBLE
871 v_double: 125.35
872 }
873 }
874 field {
875 type: LITERAL
876 literal {
877 type: V_BOOL
878 v_bool: false
879 }
880 }
881 }
882 }
883
884 Got expected error: Out of range value for column 'CategoryDecimal' at row 1 (code 1264)
885 String value in tiny int data type column
886 send Mysqlx.Crud.Insert {
887 collection {
888 name: "categories"
889 schema: "mysqlxplugin"
890 }
891 data_model: TABLE
892 projection {
893 name: "CategoryID"
894 }
895 projection {
896 name: "CategoryName"
897 }
898 projection {
899 name: "CategoryDescription"
900 }
901 projection {
902 name: "CategoryIMEI"
903 }
904 projection {
905 name: "CategoryDecimal"
906 }
907 projection {
908 name: "CategoryBool"
909 }
910 row {
911 field {
912 type: LITERAL
913 literal {
914 type: V_SINT
915 v_signed_int: 5
916 }
917 }
918 field {
919 type: LITERAL
920 literal {
921 type: V_STRING
922 v_string {
923 value: "Kitchen"
924 }
925 }
926 }
927 field {
928 type: LITERAL
929 literal {
930 type: V_STRING
931 v_string {
932 value: "Kitchen related category"
933 }
934 }
935 }
936 field {
937 type: LITERAL
938 literal {
939 type: V_STRING
940 v_string {
941 value: "TinyInt"
942 }
943 }
944 }
945 field {
946 type: LITERAL
947 literal {
948 type: V_DOUBLE
949 v_double: 235.15
950 }
951 }
952 field {
953 type: LITERAL
954 literal {
955 type: V_BOOL
956 v_bool: false
957 }
958 }
959 }
960 }
961
962 Got expected error: Incorrect integer value: 'TinyInt' for column 'CategoryIMEI' at row 1 (code 1366)
963 String value in decimal data type column
964 send Mysqlx.Crud.Insert {
965 collection {
966 name: "categories"
967 schema: "mysqlxplugin"
968 }
969 data_model: TABLE
970 projection {
971 name: "CategoryID"
972 }
973 projection {
974 name: "CategoryName"
975 }
976 projection {
977 name: "CategoryDescription"
978 }
979 projection {
980 name: "CategoryIMEI"
981 }
982 projection {
983 name: "CategoryDecimal"
984 }
985 projection {
986 name: "CategoryBool"
987 }
988 row {
989 field {
990 type: LITERAL
991 literal {
992 type: V_SINT
993 v_signed_int: 5
994 }
995 }
996 field {
997 type: LITERAL
998 literal {
999 type: V_STRING
1000 v_string {
1001 value: "Kitchen"
1002 }
1003 }
1004 }
1005 field {
1006 type: LITERAL
1007 literal {
1008 type: V_STRING
1009 v_string {
1010 value: "Kitchen related category"
1011 }
1012 }
1013 }
1014 field {
1015 type: LITERAL
1016 literal {
1017 type: V_SINT
1018 v_signed_int: 4
1019 }
1020 }
1021 field {
1022 type: LITERAL
1023 literal {
1024 type: V_STRING
1025 v_string {
1026 value: "Decimal"
1027 }
1028 }
1029 }
1030 field {
1031 type: LITERAL
1032 literal {
1033 type: V_BOOL
1034 v_bool: false
1035 }
1036 }
1037 }
1038 }
1039
1040 Got expected error: Incorrect decimal value: 'Decimal' for column 'CategoryDecimal' at row 1 (code 1366)
1041 Invalid Schema name
1042 send Mysqlx.Crud.Insert {
1043 collection {
1044 name: "categories"
1045 schema: "schema_no_exist"
1046 }
1047 data_model: TABLE
1048 projection {
1049 name: "CategoryID"
1050 }
1051 projection {
1052 name: "CategoryName"
1053 }
1054 projection {
1055 name: "CategoryDescription"
1056 }
1057 projection {
1058 name: "CategoryIMEI"
1059 }
1060 projection {
1061 name: "CategoryDecimal"
1062 }
1063 projection {
1064 name: "CategoryBool"
1065 }
1066 row {
1067 field {
1068 type: LITERAL
1069 literal {
1070 type: V_SINT
1071 v_signed_int: 5
1072 }
1073 }
1074 field {
1075 type: LITERAL
1076 literal {
1077 type: V_STRING
1078 v_string {
1079 value: "Kitchen"
1080 }
1081 }
1082 }
1083 field {
1084 type: LITERAL
1085 literal {
1086 type: V_STRING
1087 v_string {
1088 value: "Kitchen related category"
1089 }
1090 }
1091 }
1092 field {
1093 type: LITERAL
1094 literal {
1095 type: V_SINT
1096 v_signed_int: 4
1097 }
1098 }
1099 field {
1100 type: LITERAL
1101 literal {
1102 type: V_DOUBLE
1103 v_double: 256.54
1104 }
1105 }
1106 field {
1107 type: LITERAL
1108 literal {
1109 type: V_BOOL
1110 v_bool: false
1111 }
1112 }
1113 }
1114 }
1115
1116 Got expected error: Unknown database 'schema_no_exist' (code 1049)
1117 Invalid Table name
1118 send Mysqlx.Crud.Insert {
1119 collection {
1120 name: "table_no_exist"
1121 schema: "mysqlxplugin"
1122 }
1123 data_model: TABLE
1124 projection {
1125 name: "CategoryID"
1126 }
1127 projection {
1128 name: "CategoryName"
1129 }
1130 projection {
1131 name: "CategoryDescription"
1132 }
1133 projection {
1134 name: "CategoryIMEI"
1135 }
1136 projection {
1137 name: "CategoryDecimal"
1138 }
1139 projection {
1140 name: "CategoryBool"
1141 }
1142 row {
1143 field {
1144 type: LITERAL
1145 literal {
1146 type: V_STRING
1147 v_string {
1148 value: "NoIntValue"
1149 }
1150 }
1151 }
1152 field {
1153 type: LITERAL
1154 literal {
1155 type: V_STRING
1156 v_string {
1157 value: "Kitchen"
1158 }
1159 }
1160 }
1161 field {
1162 type: LITERAL
1163 literal {
1164 type: V_STRING
1165 v_string {
1166 value: "Kitchen related category"
1167 }
1168 }
1169 }
1170 field {
1171 type: LITERAL
1172 literal {
1173 type: V_SINT
1174 v_signed_int: 4
1175 }
1176 }
1177 field {
1178 type: LITERAL
1179 literal {
1180 type: V_DOUBLE
1181 v_double: 256.54
1182 }
1183 }
1184 field {
1185 type: LITERAL
1186 literal {
1187 type: V_BOOL
1188 v_bool: false
1189 }
1190 }
1191 }
1192 }
1193
1194 Got expected error: Table 'mysqlxplugin.table_no_exist' doesn't exist (code 1146)
1195 Invalid Column name
1196 send Mysqlx.Crud.Insert {
1197 collection {
1198 name: "categories_no_exist"
1199 schema: "mysqlxplugin"
1200 }
1201 data_model: TABLE
1202 projection {
1203 name: "CategoryID"
1204 }
1205 projection {
1206 name: "ColumnNoExist"
1207 }
1208 projection {
1209 name: "CategoryDescription"
1210 }
1211 projection {
1212 name: "CategoryIMEI"
1213 }
1214 projection {
1215 name: "CategoryDecimal"
1216 }
1217 projection {
1218 name: "CategoryBool"
1219 }
1220 row {
1221 field {
1222 type: LITERAL
1223 literal {
1224 type: V_SINT
1225 v_signed_int: 5
1226 }
1227 }
1228 field {
1229 type: LITERAL
1230 literal {
1231 type: V_STRING
1232 v_string {
1233 value: "Kitchen"
1234 }
1235 }
1236 }
1237 field {
1238 type: LITERAL
1239 literal {
1240 type: V_STRING
1241 v_string {
1242 value: "Kitchen related category"
1243 }
1244 }
1245 }
1246 field {
1247 type: LITERAL
1248 literal {
1249 type: V_SINT
1250 v_signed_int: 4
1251 }
1252 }
1253 field {
1254 type: LITERAL
1255 literal {
1256 type: V_STRING
1257 v_string {
1258 value: "NotADouble"
1259 }
1260 }
1261 }
1262 field {
1263 type: LITERAL
1264 literal {
1265 type: V_BOOL
1266 v_bool: false
1267 }
1268 }
1269 }
1270 }
1271
1272 Got expected error: Table 'mysqlxplugin.categories_no_exist' doesn't exist (code 1146)
1273 send Mysqlx.Crud.Insert {
1274 collection {
1275 name: "categories"
1276 schema: "mysqlxplugin"
1277 }
1278 data_model: TABLE
1279 projection {
1280 name: "CategoryID"
1281 }
1282 projection {
1283 name: "CategoryName"
1284 }
1285 projection {
1286 name: "CategoryDescription"
1287 }
1288 projection {
1289 name: "CategoryIMEI"
1290 }
1291 projection {
1292 name: "CategoryDecimal"
1293 }
1294 projection {
1295 name: "CategoryBool"
1296 }
1297 row {
1298 field {
1299 type: LITERAL
1300 literal {
1301 type: V_SINT
1302 v_signed_int: 16
1303 }
1304 }
1305 field {
1306 type: LITERAL
1307 literal {
1308 type: V_STRING
1309 v_string {
1310 value: "Kitchen"
1311 }
1312 }
1313 }
1314 field {
1315 type: LITERAL
1316 literal {
1317 type: V_STRING
1318 v_string {
1319 value: "Kitchen related category"
1320 }
1321 }
1322 }
1323 field {
1324 type: LITERAL
1325 literal {
1326 type: V_SINT
1327 v_signed_int: 4
1328 }
1329 }
1330 field {
1331 type: LITERAL
1332 literal {
1333 type: V_DOUBLE
1334 v_double: 235.65
1335 }
1336 }
1337 field {
1338 type: LITERAL
1339 literal {
1340 type: V_STRING
1341 v_string {
1342 value: "NotAboolValue"
1343 }
1344 }
1345 }
1346 }
1347 }
1348
1349 Got expected error: Data too long for column 'CategoryBool' at row 1 (code 1406)
1350 RUN select * from categories order by CategoryID asc
1351 CategoryID CategoryName CategoryDescription CategoryIMEI CategoryDecimal CategoryBool
1352 1 Sports Sports related category 1 235.15 0
1353 2 Entertaiment Entertaiment related category 2 156.17 1
1354 3 "Quotes" Quote related category 3 184.25 0
1355 6 Kitchen2 Kitchen2 related category 6 999.99 1
1356 12 Kitchen Kitchen related category 12 -999.99 0
1357 13 Kitchen Kitchen related category 127 156.99 0
1358 14 Kitchen Kitchen related category -128 156.99 0
1359 18 Cooking Cooking related category 18 116.17 1
1360 19 null null null null null
1361 0 rows affected
1362 Mysqlx.Ok {
1363 msg: "bye!"
1364 }
1365 ok
1366 .
1367 #---------- START COLLECTION TESTING----------#
1368 .
1369 RUN CREATE SCHEMA mysqlxplugin_coll
1370
1371 1 rows affected
1372 RUN USE mysqlxplugin_coll
1373
1374 0 rows affected
1375
1376 command ok
1377 Insert a row into a Document column
1378 send Mysqlx.Crud.Insert {
1379 collection {
1380 name: "main_collection"
1381 schema: "mysqlxplugin_coll"
1382 }
1383 data_model: DOCUMENT
1384 row {
1385 field {
1386 type: LITERAL
1387 literal {
1388 type: V_STRING
1389 v_string {
1390 value: "\n{\n \"_id\": \"1\",\n \"name\": \"Omar Port\", \"id\": \"1\"\n}"
1391 }
1392 }
1393 }
1394 }
1395 }
1396
1397
1398 1 rows affected
1399 RUN select doc from main_collection
1400 doc
1401 {"id": "1", "_id": "1", "name": "Omar Port"}
1402 0 rows affected
1403 Insert multiple rows into a Document column
1404 send Mysqlx.Crud.Insert {
1405 collection {
1406 name: "main_collection"
1407 schema: "mysqlxplugin_coll"
1408 }
1409 data_model: DOCUMENT
1410 row {
1411 field {
1412 type: LITERAL
1413 literal {
1414 type: V_STRING
1415 v_string {
1416 value: "\n{\n \"_id\": \"2\",\n \"name\": \"Omar Bras\", \"id\": \"2\"\n}"
1417 }
1418 }
1419 }
1420 }
1421 row {
1422 field {
1423 type: LITERAL
1424 literal {
1425 type: V_STRING
1426 v_string {
1427 value: "\n{\n \"_id\": \"3\",\n \"name\": \"Omar Mex\", \"id\": \"3\"\n}"
1428 }
1429 }
1430 }
1431 }
1432 }
1433
1434
1435 2 rows affected
1436 Records: 2 Duplicates: 0 Warnings: 0
1437 RUN select doc from main_collection
1438 doc
1439 {"id": "1", "_id": "1", "name": "Omar Port"}
1440 {"id": "2", "_id": "2", "name": "Omar Bras"}
1441 {"id": "3", "_id": "3", "name": "Omar Mex"}
1442 0 rows affected
1443 Insert malformed JSON into Document column
1444 send Mysqlx.Crud.Insert {
1445 collection {
1446 name: "main_collection"
1447 schema: "mysqlxplugin_coll"
1448 }
1449 data_model: DOCUMENT
1450 row {
1451 field {
1452 type: LITERAL
1453 literal {
1454 type: V_STRING
1455 v_string {
1456 value: "\n{\n \"_id\": \"1\",\n \"from\": {\n \"name\": \"Omar Alf\", \"id\": \"10\"\n }\n {\n \"name\": \"Omar Mend\", \"id\": \"11\"\n }\n}"
1457 }
1458 }
1459 }
1460 }
1461 }
1462
1463 Got expected error: Invalid JSON text: "Missing a comma or '}' after an object member." at position 98 in value for column 'main_collection.doc'. (code 3140)
1464 ================================================================================
1465 CLEAN UP
1466 ================================================================================
1467 RUN SELECT doc FROM main_collection
1468 doc
1469 {"id": "1", "_id": "1", "name": "Omar Port"}
1470 {"id": "2", "_id": "2", "name": "Omar Bras"}
1471 {"id": "3", "_id": "3", "name": "Omar Mex"}
1472 0 rows affected
1473 RUN DROP SCHEMA if EXISTS mysqlxplugin
1474
1475 1 rows affected
1476 RUN DROP SCHEMA if EXISTS mysqlxplugin_coll
1477
1478 1 rows affected
1479 RUN DROP USER insertcruduser@localhost
1480
1481 0 rows affected
1482 Mysqlx.Ok {
1483 msg: "bye!"
1484 }
1485 ok