Debian Codegraph @

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

raw
1 CREATE SCHEMA IF NOT EXISTS xtest;
2 USE xtest;
3
4 ## A. Execute the test using zlib/group
5 #
6
7
8 ## Test setup
9 RUN DROP TABLE IF EXISTS xtest.coll
10
11 0 rows affected
12
13 command ok
14 send Mysqlx.Crud.Insert {
15 collection {
16 name: "coll"
17 schema: "xtest"
18 }
19 data_model: DOCUMENT
20 row {
21 field {
22 type: LITERAL
23 literal {
24 type: V_OCTETS
25 v_octets {
26 value: "{\"_id\": \"1\", \"name\":\"first\", \"prio\":1}"
27 content_type: 2
28 }
29 }
30 }
31 }
32 upsert: false
33 }
34
35
36 1 rows affected
37 Got expected error (code 0)
38 send Mysqlx.Crud.Insert {
39 collection {
40 name: "coll"
41 schema: "xtest"
42 }
43 data_model: DOCUMENT
44 row {
45 field {
46 type: LITERAL
47 literal {
48 type: V_OCTETS
49 v_octets {
50 value: "{\"_id\": \"2\", \"name\":\"second\", \"prio\":2}"
51 content_type: 2
52 }
53 }
54 }
55 }
56 upsert: false
57 }
58
59
60 1 rows affected
61 Got expected error (code 0)
62 send Mysqlx.Crud.Insert {
63 collection {
64 name: "coll"
65 schema: "xtest"
66 }
67 data_model: DOCUMENT
68 row {
69 field {
70 type: LITERAL
71 literal {
72 type: V_OCTETS
73 v_octets {
74 value: "{\"_id\": \"3\", \"name\":\"third\", \"prio\":1}"
75 content_type: 2
76 }
77 }
78 }
79 }
80 upsert: false
81 }
82
83
84 1 rows affected
85 Got expected error (code 0)
86 send Mysqlx.Crud.Insert {
87 collection {
88 name: "coll"
89 schema: "xtest"
90 }
91 data_model: DOCUMENT
92 row {
93 field {
94 type: LITERAL
95 literal {
96 type: V_OCTETS
97 v_octets {
98 value: "{\"_id\": \"5\", \"name\":\"fifth\", \"prio\":4}"
99 content_type: 2
100 }
101 }
102 }
103 }
104 upsert: false
105 }
106
107
108 1 rows affected
109 Got expected error (code 0)
110
111
112 ## I. Validate simple resultsets for CRUD messages
113 #
114 # 1. Assert resultset for CRUD-delete message
115 # 2. Assert resultset for CRUD-update message
116 # 3. Assert resultset for CRUD-create message (doc with id)
117 # 4. Assert resultset for CRUD-create message (doc without id)
118 # 5. Assert resultset for CRUD-read message
119
120 ## II. Validate simple resultset with warnings
121 #
122 # 1. Assert one resultsets for select queries
123
124 #
125 # I.1
126 send Mysqlx.Prepare.Prepare {
127 stmt_id: 1
128 stmt {
129 type: DELETE
130 delete {
131 collection {
132 name: "coll"
133 }
134 data_model: DOCUMENT
135 criteria {
136 type: OPERATOR
137 operator {
138 name: "=="
139 param {
140 type: IDENT
141 identifier {
142 document_path {
143 type: MEMBER
144 value: "name"
145 }
146 }
147 }
148 param {
149 type: LITERAL
150 literal {
151 type: V_OCTETS
152 v_octets {
153 value: "fifth"
154 }
155 }
156 }
157 }
158 }
159 }
160 }
161 }
162
163 RUN recvok
164 send Mysqlx.Prepare.Execute {
165 stmt_id: 1
166 }
167
168 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
169 [ASSERT Mysqlx.Sql.StmtExecuteOk]
170
171 #
172 # I.2
173 send Mysqlx.Prepare.Prepare {
174 stmt_id: 2
175 stmt {
176 type: UPDATE
177 update {
178 collection {
179 name: "coll"
180 }
181 data_model: DOCUMENT
182 operation {
183 source {
184 document_path {
185 type: MEMBER
186 value: "prio"
187 }
188 }
189 operation: ITEM_SET
190 value {
191 type: OPERATOR
192 operator {
193 name: "-"
194 param {
195 type: IDENT
196 identifier {
197 document_path {
198 type: MEMBER
199 value: "prio"
200 }
201 }
202 }
203 param {
204 type: LITERAL
205 literal {
206 type: V_SINT
207 v_signed_int: 1
208 }
209 }
210 }
211 }
212 }
213 }
214 }
215 }
216
217 RUN recvok
218 send Mysqlx.Prepare.Execute {
219 stmt_id: 2
220 }
221
222 [ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING]
223 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:3]
224 [ASSERT Mysqlx.Sql.StmtExecuteOk]
225
226 #
227 # I.3
228 send Mysqlx.Prepare.Prepare {
229 stmt_id: 3
230 stmt {
231 type: INSERT
232 insert {
233 collection {
234 name: "coll"
235 schema: "xtest"
236 }
237 data_model: DOCUMENT
238 row {
239 field {
240 type: LITERAL
241 literal {
242 type: V_OCTETS
243 v_octets {
244 value: "{\"_id\": \"6\", \"name\":\"sixth\", \"prio\":3}"
245 content_type: 2
246 }
247 }
248 }
249 }
250 upsert: false
251 }
252 }
253 }
254
255 RUN recvok
256 send Mysqlx.Prepare.Execute {
257 stmt_id: 3
258 }
259
260 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
261 [ASSERT Mysqlx.Sql.StmtExecuteOk]
262
263 #
264 # I.4
265 send Mysqlx.Prepare.Prepare {
266 stmt_id: 4
267 stmt {
268 type: INSERT
269 insert {
270 collection {
271 name: "coll"
272 schema: "xtest"
273 }
274 data_model: DOCUMENT
275 row {
276 field {
277 type: LITERAL
278 literal {
279 type: V_OCTETS
280 v_octets {
281 value: "{\"name\":\"sixth\", \"prio\":3}"
282 content_type: 2
283 }
284 }
285 }
286 }
287 upsert: false
288 }
289 }
290 }
291
292 RUN recvok
293 send Mysqlx.Prepare.Execute {
294 stmt_id: 4
295 }
296
297 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
298 [ASSERT notice session state change - GENERATED_DOCUMENT_IDS, type: V_OCTETS]
299 [ASSERT Mysqlx.Sql.StmtExecuteOk]
300
301 #
302 # I.5
303 send Mysqlx.Prepare.Prepare {
304 stmt_id: 5
305 stmt {
306 type: FIND
307 find {
308 collection {
309 name: "coll"
310 }
311 data_model: DOCUMENT
312 projection {
313 source {
314 type: IDENT
315 identifier {
316 document_path {
317 type: MEMBER
318 value: "name"
319 }
320 }
321 }
322 alias: "name"
323 }
324 }
325 }
326 }
327
328 RUN recvok
329 send Mysqlx.Prepare.Execute {
330 stmt_id: 5
331 }
332
333 [ASSERT Mysqlx.Resultset.ColumnMetaData]
334 [ASSERT Mysqlx.Resultset.Row]
335 [ASSERT Mysqlx.Resultset.Row]
336 [ASSERT Mysqlx.Resultset.Row]
337 [ASSERT Mysqlx.Resultset.Row]
338 [ASSERT Mysqlx.Resultset.Row]
339 [ASSERT Mysqlx.Resultset.FetchDone]
340 [ASSERT Mysqlx.Sql.StmtExecuteOk]
341
342 #
343 # II.1
344 send Mysqlx.Prepare.Prepare {
345 stmt_id: 6
346 stmt {
347 type: FIND
348 find {
349 collection {
350 name: "coll"
351 }
352 data_model: DOCUMENT
353 projection {
354 source {
355 type: OPERATOR
356 operator {
357 name: "/"
358 param {
359 type: LITERAL
360 literal {
361 type: V_SINT
362 v_signed_int: 1
363 }
364 }
365 param {
366 type: IDENT
367 identifier {
368 document_path {
369 type: MEMBER
370 value: "prio"
371 }
372 }
373 }
374 }
375 }
376 alias: "name"
377 }
378 }
379 }
380 }
381
382 RUN recvok
383 send Mysqlx.Prepare.Execute {
384 stmt_id: 6
385 }
386
387 [ASSERT Mysqlx.Resultset.ColumnMetaData]
388 [ASSERT Mysqlx.Resultset.Row]
389 [ASSERT Mysqlx.Resultset.Row]
390 [ASSERT Mysqlx.Resultset.Row]
391 [ASSERT Mysqlx.Resultset.Row]
392 [ASSERT Mysqlx.Resultset.Row]
393 [ASSERT Mysqlx.Resultset.FetchDone]
394 [ASSERT notice warning - WARNING, 1365]
395 [ASSERT notice warning - WARNING, 1365]
396 [ASSERT Mysqlx.Sql.StmtExecuteOk]
397 Mysqlx.Ok {
398 msg: "bye!"
399 }
400 ok
401
402 ## B. Execute the test using zlib/multiple
403 #
404
405
406 ## Test setup
407 RUN DROP TABLE IF EXISTS xtest.coll
408
409 0 rows affected
410
411 command ok
412 send Mysqlx.Crud.Insert {
413 collection {
414 name: "coll"
415 schema: "xtest"
416 }
417 data_model: DOCUMENT
418 row {
419 field {
420 type: LITERAL
421 literal {
422 type: V_OCTETS
423 v_octets {
424 value: "{\"_id\": \"1\", \"name\":\"first\", \"prio\":1}"
425 content_type: 2
426 }
427 }
428 }
429 }
430 upsert: false
431 }
432
433
434 1 rows affected
435 Got expected error (code 0)
436 send Mysqlx.Crud.Insert {
437 collection {
438 name: "coll"
439 schema: "xtest"
440 }
441 data_model: DOCUMENT
442 row {
443 field {
444 type: LITERAL
445 literal {
446 type: V_OCTETS
447 v_octets {
448 value: "{\"_id\": \"2\", \"name\":\"second\", \"prio\":2}"
449 content_type: 2
450 }
451 }
452 }
453 }
454 upsert: false
455 }
456
457
458 1 rows affected
459 Got expected error (code 0)
460 send Mysqlx.Crud.Insert {
461 collection {
462 name: "coll"
463 schema: "xtest"
464 }
465 data_model: DOCUMENT
466 row {
467 field {
468 type: LITERAL
469 literal {
470 type: V_OCTETS
471 v_octets {
472 value: "{\"_id\": \"3\", \"name\":\"third\", \"prio\":1}"
473 content_type: 2
474 }
475 }
476 }
477 }
478 upsert: false
479 }
480
481
482 1 rows affected
483 Got expected error (code 0)
484 send Mysqlx.Crud.Insert {
485 collection {
486 name: "coll"
487 schema: "xtest"
488 }
489 data_model: DOCUMENT
490 row {
491 field {
492 type: LITERAL
493 literal {
494 type: V_OCTETS
495 v_octets {
496 value: "{\"_id\": \"5\", \"name\":\"fifth\", \"prio\":4}"
497 content_type: 2
498 }
499 }
500 }
501 }
502 upsert: false
503 }
504
505
506 1 rows affected
507 Got expected error (code 0)
508
509
510 ## I. Validate simple resultsets for CRUD messages
511 #
512 # 1. Assert resultset for CRUD-delete message
513 # 2. Assert resultset for CRUD-update message
514 # 3. Assert resultset for CRUD-create message (doc with id)
515 # 4. Assert resultset for CRUD-create message (doc without id)
516 # 5. Assert resultset for CRUD-read message
517
518 ## II. Validate simple resultset with warnings
519 #
520 # 1. Assert one resultsets for select queries
521
522 #
523 # I.1
524 send Mysqlx.Prepare.Prepare {
525 stmt_id: 1
526 stmt {
527 type: DELETE
528 delete {
529 collection {
530 name: "coll"
531 }
532 data_model: DOCUMENT
533 criteria {
534 type: OPERATOR
535 operator {
536 name: "=="
537 param {
538 type: IDENT
539 identifier {
540 document_path {
541 type: MEMBER
542 value: "name"
543 }
544 }
545 }
546 param {
547 type: LITERAL
548 literal {
549 type: V_OCTETS
550 v_octets {
551 value: "fifth"
552 }
553 }
554 }
555 }
556 }
557 }
558 }
559 }
560
561 RUN recvok
562 send Mysqlx.Prepare.Execute {
563 stmt_id: 1
564 }
565
566 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
567 [ASSERT Mysqlx.Sql.StmtExecuteOk]
568
569 #
570 # I.2
571 send Mysqlx.Prepare.Prepare {
572 stmt_id: 2
573 stmt {
574 type: UPDATE
575 update {
576 collection {
577 name: "coll"
578 }
579 data_model: DOCUMENT
580 operation {
581 source {
582 document_path {
583 type: MEMBER
584 value: "prio"
585 }
586 }
587 operation: ITEM_SET
588 value {
589 type: OPERATOR
590 operator {
591 name: "-"
592 param {
593 type: IDENT
594 identifier {
595 document_path {
596 type: MEMBER
597 value: "prio"
598 }
599 }
600 }
601 param {
602 type: LITERAL
603 literal {
604 type: V_SINT
605 v_signed_int: 1
606 }
607 }
608 }
609 }
610 }
611 }
612 }
613 }
614
615 RUN recvok
616 send Mysqlx.Prepare.Execute {
617 stmt_id: 2
618 }
619
620 [ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING]
621 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:3]
622 [ASSERT Mysqlx.Sql.StmtExecuteOk]
623
624 #
625 # I.3
626 send Mysqlx.Prepare.Prepare {
627 stmt_id: 3
628 stmt {
629 type: INSERT
630 insert {
631 collection {
632 name: "coll"
633 schema: "xtest"
634 }
635 data_model: DOCUMENT
636 row {
637 field {
638 type: LITERAL
639 literal {
640 type: V_OCTETS
641 v_octets {
642 value: "{\"_id\": \"6\", \"name\":\"sixth\", \"prio\":3}"
643 content_type: 2
644 }
645 }
646 }
647 }
648 upsert: false
649 }
650 }
651 }
652
653 RUN recvok
654 send Mysqlx.Prepare.Execute {
655 stmt_id: 3
656 }
657
658 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
659 [ASSERT Mysqlx.Sql.StmtExecuteOk]
660
661 #
662 # I.4
663 send Mysqlx.Prepare.Prepare {
664 stmt_id: 4
665 stmt {
666 type: INSERT
667 insert {
668 collection {
669 name: "coll"
670 schema: "xtest"
671 }
672 data_model: DOCUMENT
673 row {
674 field {
675 type: LITERAL
676 literal {
677 type: V_OCTETS
678 v_octets {
679 value: "{\"name\":\"sixth\", \"prio\":3}"
680 content_type: 2
681 }
682 }
683 }
684 }
685 upsert: false
686 }
687 }
688 }
689
690 RUN recvok
691 send Mysqlx.Prepare.Execute {
692 stmt_id: 4
693 }
694
695 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
696 [ASSERT notice session state change - GENERATED_DOCUMENT_IDS, type: V_OCTETS]
697 [ASSERT Mysqlx.Sql.StmtExecuteOk]
698
699 #
700 # I.5
701 send Mysqlx.Prepare.Prepare {
702 stmt_id: 5
703 stmt {
704 type: FIND
705 find {
706 collection {
707 name: "coll"
708 }
709 data_model: DOCUMENT
710 projection {
711 source {
712 type: IDENT
713 identifier {
714 document_path {
715 type: MEMBER
716 value: "name"
717 }
718 }
719 }
720 alias: "name"
721 }
722 }
723 }
724 }
725
726 RUN recvok
727 send Mysqlx.Prepare.Execute {
728 stmt_id: 5
729 }
730
731 [ASSERT Mysqlx.Resultset.ColumnMetaData]
732 [ASSERT Mysqlx.Resultset.Row]
733 [ASSERT Mysqlx.Resultset.Row]
734 [ASSERT Mysqlx.Resultset.Row]
735 [ASSERT Mysqlx.Resultset.Row]
736 [ASSERT Mysqlx.Resultset.Row]
737 [ASSERT Mysqlx.Resultset.FetchDone]
738 [ASSERT Mysqlx.Sql.StmtExecuteOk]
739
740 #
741 # II.1
742 send Mysqlx.Prepare.Prepare {
743 stmt_id: 6
744 stmt {
745 type: FIND
746 find {
747 collection {
748 name: "coll"
749 }
750 data_model: DOCUMENT
751 projection {
752 source {
753 type: OPERATOR
754 operator {
755 name: "/"
756 param {
757 type: LITERAL
758 literal {
759 type: V_SINT
760 v_signed_int: 1
761 }
762 }
763 param {
764 type: IDENT
765 identifier {
766 document_path {
767 type: MEMBER
768 value: "prio"
769 }
770 }
771 }
772 }
773 }
774 alias: "name"
775 }
776 }
777 }
778 }
779
780 RUN recvok
781 send Mysqlx.Prepare.Execute {
782 stmt_id: 6
783 }
784
785 [ASSERT Mysqlx.Resultset.ColumnMetaData]
786 [ASSERT Mysqlx.Resultset.Row]
787 [ASSERT Mysqlx.Resultset.Row]
788 [ASSERT Mysqlx.Resultset.Row]
789 [ASSERT Mysqlx.Resultset.Row]
790 [ASSERT Mysqlx.Resultset.Row]
791 [ASSERT Mysqlx.Resultset.FetchDone]
792 [ASSERT notice warning - WARNING, 1365]
793 [ASSERT notice warning - WARNING, 1365]
794 [ASSERT Mysqlx.Sql.StmtExecuteOk]
795 Mysqlx.Ok {
796 msg: "bye!"
797 }
798 ok
799
800 ## C. Execute the test using zlib/single
801 #
802
803
804 ## Test setup
805 RUN DROP TABLE IF EXISTS xtest.coll
806
807 0 rows affected
808
809 command ok
810 send Mysqlx.Crud.Insert {
811 collection {
812 name: "coll"
813 schema: "xtest"
814 }
815 data_model: DOCUMENT
816 row {
817 field {
818 type: LITERAL
819 literal {
820 type: V_OCTETS
821 v_octets {
822 value: "{\"_id\": \"1\", \"name\":\"first\", \"prio\":1}"
823 content_type: 2
824 }
825 }
826 }
827 }
828 upsert: false
829 }
830
831
832 1 rows affected
833 Got expected error (code 0)
834 send Mysqlx.Crud.Insert {
835 collection {
836 name: "coll"
837 schema: "xtest"
838 }
839 data_model: DOCUMENT
840 row {
841 field {
842 type: LITERAL
843 literal {
844 type: V_OCTETS
845 v_octets {
846 value: "{\"_id\": \"2\", \"name\":\"second\", \"prio\":2}"
847 content_type: 2
848 }
849 }
850 }
851 }
852 upsert: false
853 }
854
855
856 1 rows affected
857 Got expected error (code 0)
858 send Mysqlx.Crud.Insert {
859 collection {
860 name: "coll"
861 schema: "xtest"
862 }
863 data_model: DOCUMENT
864 row {
865 field {
866 type: LITERAL
867 literal {
868 type: V_OCTETS
869 v_octets {
870 value: "{\"_id\": \"3\", \"name\":\"third\", \"prio\":1}"
871 content_type: 2
872 }
873 }
874 }
875 }
876 upsert: false
877 }
878
879
880 1 rows affected
881 Got expected error (code 0)
882 send Mysqlx.Crud.Insert {
883 collection {
884 name: "coll"
885 schema: "xtest"
886 }
887 data_model: DOCUMENT
888 row {
889 field {
890 type: LITERAL
891 literal {
892 type: V_OCTETS
893 v_octets {
894 value: "{\"_id\": \"5\", \"name\":\"fifth\", \"prio\":4}"
895 content_type: 2
896 }
897 }
898 }
899 }
900 upsert: false
901 }
902
903
904 1 rows affected
905 Got expected error (code 0)
906
907
908 ## I. Validate simple resultsets for CRUD messages
909 #
910 # 1. Assert resultset for CRUD-delete message
911 # 2. Assert resultset for CRUD-update message
912 # 3. Assert resultset for CRUD-create message (doc with id)
913 # 4. Assert resultset for CRUD-create message (doc without id)
914 # 5. Assert resultset for CRUD-read message
915
916 ## II. Validate simple resultset with warnings
917 #
918 # 1. Assert one resultsets for select queries
919
920 #
921 # I.1
922 send Mysqlx.Prepare.Prepare {
923 stmt_id: 1
924 stmt {
925 type: DELETE
926 delete {
927 collection {
928 name: "coll"
929 }
930 data_model: DOCUMENT
931 criteria {
932 type: OPERATOR
933 operator {
934 name: "=="
935 param {
936 type: IDENT
937 identifier {
938 document_path {
939 type: MEMBER
940 value: "name"
941 }
942 }
943 }
944 param {
945 type: LITERAL
946 literal {
947 type: V_OCTETS
948 v_octets {
949 value: "fifth"
950 }
951 }
952 }
953 }
954 }
955 }
956 }
957 }
958
959 RUN recvok
960 send Mysqlx.Prepare.Execute {
961 stmt_id: 1
962 }
963
964 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
965 [ASSERT Mysqlx.Sql.StmtExecuteOk]
966
967 #
968 # I.2
969 send Mysqlx.Prepare.Prepare {
970 stmt_id: 2
971 stmt {
972 type: UPDATE
973 update {
974 collection {
975 name: "coll"
976 }
977 data_model: DOCUMENT
978 operation {
979 source {
980 document_path {
981 type: MEMBER
982 value: "prio"
983 }
984 }
985 operation: ITEM_SET
986 value {
987 type: OPERATOR
988 operator {
989 name: "-"
990 param {
991 type: IDENT
992 identifier {
993 document_path {
994 type: MEMBER
995 value: "prio"
996 }
997 }
998 }
999 param {
1000 type: LITERAL
1001 literal {
1002 type: V_SINT
1003 v_signed_int: 1
1004 }
1005 }
1006 }
1007 }
1008 }
1009 }
1010 }
1011 }
1012
1013 RUN recvok
1014 send Mysqlx.Prepare.Execute {
1015 stmt_id: 2
1016 }
1017
1018 [ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING]
1019 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:3]
1020 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1021
1022 #
1023 # I.3
1024 send Mysqlx.Prepare.Prepare {
1025 stmt_id: 3
1026 stmt {
1027 type: INSERT
1028 insert {
1029 collection {
1030 name: "coll"
1031 schema: "xtest"
1032 }
1033 data_model: DOCUMENT
1034 row {
1035 field {
1036 type: LITERAL
1037 literal {
1038 type: V_OCTETS
1039 v_octets {
1040 value: "{\"_id\": \"6\", \"name\":\"sixth\", \"prio\":3}"
1041 content_type: 2
1042 }
1043 }
1044 }
1045 }
1046 upsert: false
1047 }
1048 }
1049 }
1050
1051 RUN recvok
1052 send Mysqlx.Prepare.Execute {
1053 stmt_id: 3
1054 }
1055
1056 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
1057 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1058
1059 #
1060 # I.4
1061 send Mysqlx.Prepare.Prepare {
1062 stmt_id: 4
1063 stmt {
1064 type: INSERT
1065 insert {
1066 collection {
1067 name: "coll"
1068 schema: "xtest"
1069 }
1070 data_model: DOCUMENT
1071 row {
1072 field {
1073 type: LITERAL
1074 literal {
1075 type: V_OCTETS
1076 v_octets {
1077 value: "{\"name\":\"sixth\", \"prio\":3}"
1078 content_type: 2
1079 }
1080 }
1081 }
1082 }
1083 upsert: false
1084 }
1085 }
1086 }
1087
1088 RUN recvok
1089 send Mysqlx.Prepare.Execute {
1090 stmt_id: 4
1091 }
1092
1093 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
1094 [ASSERT notice session state change - GENERATED_DOCUMENT_IDS, type: V_OCTETS]
1095 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1096
1097 #
1098 # I.5
1099 send Mysqlx.Prepare.Prepare {
1100 stmt_id: 5
1101 stmt {
1102 type: FIND
1103 find {
1104 collection {
1105 name: "coll"
1106 }
1107 data_model: DOCUMENT
1108 projection {
1109 source {
1110 type: IDENT
1111 identifier {
1112 document_path {
1113 type: MEMBER
1114 value: "name"
1115 }
1116 }
1117 }
1118 alias: "name"
1119 }
1120 }
1121 }
1122 }
1123
1124 RUN recvok
1125 send Mysqlx.Prepare.Execute {
1126 stmt_id: 5
1127 }
1128
1129 [ASSERT Mysqlx.Resultset.ColumnMetaData]
1130 [ASSERT Mysqlx.Resultset.Row]
1131 [ASSERT Mysqlx.Resultset.Row]
1132 [ASSERT Mysqlx.Resultset.Row]
1133 [ASSERT Mysqlx.Resultset.Row]
1134 [ASSERT Mysqlx.Resultset.Row]
1135 [ASSERT Mysqlx.Resultset.FetchDone]
1136 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1137
1138 #
1139 # II.1
1140 send Mysqlx.Prepare.Prepare {
1141 stmt_id: 6
1142 stmt {
1143 type: FIND
1144 find {
1145 collection {
1146 name: "coll"
1147 }
1148 data_model: DOCUMENT
1149 projection {
1150 source {
1151 type: OPERATOR
1152 operator {
1153 name: "/"
1154 param {
1155 type: LITERAL
1156 literal {
1157 type: V_SINT
1158 v_signed_int: 1
1159 }
1160 }
1161 param {
1162 type: IDENT
1163 identifier {
1164 document_path {
1165 type: MEMBER
1166 value: "prio"
1167 }
1168 }
1169 }
1170 }
1171 }
1172 alias: "name"
1173 }
1174 }
1175 }
1176 }
1177
1178 RUN recvok
1179 send Mysqlx.Prepare.Execute {
1180 stmt_id: 6
1181 }
1182
1183 [ASSERT Mysqlx.Resultset.ColumnMetaData]
1184 [ASSERT Mysqlx.Resultset.Row]
1185 [ASSERT Mysqlx.Resultset.Row]
1186 [ASSERT Mysqlx.Resultset.Row]
1187 [ASSERT Mysqlx.Resultset.Row]
1188 [ASSERT Mysqlx.Resultset.Row]
1189 [ASSERT Mysqlx.Resultset.FetchDone]
1190 [ASSERT notice warning - WARNING, 1365]
1191 [ASSERT notice warning - WARNING, 1365]
1192 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1193 Mysqlx.Ok {
1194 msg: "bye!"
1195 }
1196 ok
1197
1198 ## D. Execute the test using lz4/group
1199 #
1200
1201
1202 ## Test setup
1203 RUN DROP TABLE IF EXISTS xtest.coll
1204
1205 0 rows affected
1206
1207 command ok
1208 send Mysqlx.Crud.Insert {
1209 collection {
1210 name: "coll"
1211 schema: "xtest"
1212 }
1213 data_model: DOCUMENT
1214 row {
1215 field {
1216 type: LITERAL
1217 literal {
1218 type: V_OCTETS
1219 v_octets {
1220 value: "{\"_id\": \"1\", \"name\":\"first\", \"prio\":1}"
1221 content_type: 2
1222 }
1223 }
1224 }
1225 }
1226 upsert: false
1227 }
1228
1229
1230 1 rows affected
1231 Got expected error (code 0)
1232 send Mysqlx.Crud.Insert {
1233 collection {
1234 name: "coll"
1235 schema: "xtest"
1236 }
1237 data_model: DOCUMENT
1238 row {
1239 field {
1240 type: LITERAL
1241 literal {
1242 type: V_OCTETS
1243 v_octets {
1244 value: "{\"_id\": \"2\", \"name\":\"second\", \"prio\":2}"
1245 content_type: 2
1246 }
1247 }
1248 }
1249 }
1250 upsert: false
1251 }
1252
1253
1254 1 rows affected
1255 Got expected error (code 0)
1256 send Mysqlx.Crud.Insert {
1257 collection {
1258 name: "coll"
1259 schema: "xtest"
1260 }
1261 data_model: DOCUMENT
1262 row {
1263 field {
1264 type: LITERAL
1265 literal {
1266 type: V_OCTETS
1267 v_octets {
1268 value: "{\"_id\": \"3\", \"name\":\"third\", \"prio\":1}"
1269 content_type: 2
1270 }
1271 }
1272 }
1273 }
1274 upsert: false
1275 }
1276
1277
1278 1 rows affected
1279 Got expected error (code 0)
1280 send Mysqlx.Crud.Insert {
1281 collection {
1282 name: "coll"
1283 schema: "xtest"
1284 }
1285 data_model: DOCUMENT
1286 row {
1287 field {
1288 type: LITERAL
1289 literal {
1290 type: V_OCTETS
1291 v_octets {
1292 value: "{\"_id\": \"5\", \"name\":\"fifth\", \"prio\":4}"
1293 content_type: 2
1294 }
1295 }
1296 }
1297 }
1298 upsert: false
1299 }
1300
1301
1302 1 rows affected
1303 Got expected error (code 0)
1304
1305
1306 ## I. Validate simple resultsets for CRUD messages
1307 #
1308 # 1. Assert resultset for CRUD-delete message
1309 # 2. Assert resultset for CRUD-update message
1310 # 3. Assert resultset for CRUD-create message (doc with id)
1311 # 4. Assert resultset for CRUD-create message (doc without id)
1312 # 5. Assert resultset for CRUD-read message
1313
1314 ## II. Validate simple resultset with warnings
1315 #
1316 # 1. Assert one resultsets for select queries
1317
1318 #
1319 # I.1
1320 send Mysqlx.Prepare.Prepare {
1321 stmt_id: 1
1322 stmt {
1323 type: DELETE
1324 delete {
1325 collection {
1326 name: "coll"
1327 }
1328 data_model: DOCUMENT
1329 criteria {
1330 type: OPERATOR
1331 operator {
1332 name: "=="
1333 param {
1334 type: IDENT
1335 identifier {
1336 document_path {
1337 type: MEMBER
1338 value: "name"
1339 }
1340 }
1341 }
1342 param {
1343 type: LITERAL
1344 literal {
1345 type: V_OCTETS
1346 v_octets {
1347 value: "fifth"
1348 }
1349 }
1350 }
1351 }
1352 }
1353 }
1354 }
1355 }
1356
1357 RUN recvok
1358 send Mysqlx.Prepare.Execute {
1359 stmt_id: 1
1360 }
1361
1362 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
1363 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1364
1365 #
1366 # I.2
1367 send Mysqlx.Prepare.Prepare {
1368 stmt_id: 2
1369 stmt {
1370 type: UPDATE
1371 update {
1372 collection {
1373 name: "coll"
1374 }
1375 data_model: DOCUMENT
1376 operation {
1377 source {
1378 document_path {
1379 type: MEMBER
1380 value: "prio"
1381 }
1382 }
1383 operation: ITEM_SET
1384 value {
1385 type: OPERATOR
1386 operator {
1387 name: "-"
1388 param {
1389 type: IDENT
1390 identifier {
1391 document_path {
1392 type: MEMBER
1393 value: "prio"
1394 }
1395 }
1396 }
1397 param {
1398 type: LITERAL
1399 literal {
1400 type: V_SINT
1401 v_signed_int: 1
1402 }
1403 }
1404 }
1405 }
1406 }
1407 }
1408 }
1409 }
1410
1411 RUN recvok
1412 send Mysqlx.Prepare.Execute {
1413 stmt_id: 2
1414 }
1415
1416 [ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING]
1417 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:3]
1418 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1419
1420 #
1421 # I.3
1422 send Mysqlx.Prepare.Prepare {
1423 stmt_id: 3
1424 stmt {
1425 type: INSERT
1426 insert {
1427 collection {
1428 name: "coll"
1429 schema: "xtest"
1430 }
1431 data_model: DOCUMENT
1432 row {
1433 field {
1434 type: LITERAL
1435 literal {
1436 type: V_OCTETS
1437 v_octets {
1438 value: "{\"_id\": \"6\", \"name\":\"sixth\", \"prio\":3}"
1439 content_type: 2
1440 }
1441 }
1442 }
1443 }
1444 upsert: false
1445 }
1446 }
1447 }
1448
1449 RUN recvok
1450 send Mysqlx.Prepare.Execute {
1451 stmt_id: 3
1452 }
1453
1454 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
1455 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1456
1457 #
1458 # I.4
1459 send Mysqlx.Prepare.Prepare {
1460 stmt_id: 4
1461 stmt {
1462 type: INSERT
1463 insert {
1464 collection {
1465 name: "coll"
1466 schema: "xtest"
1467 }
1468 data_model: DOCUMENT
1469 row {
1470 field {
1471 type: LITERAL
1472 literal {
1473 type: V_OCTETS
1474 v_octets {
1475 value: "{\"name\":\"sixth\", \"prio\":3}"
1476 content_type: 2
1477 }
1478 }
1479 }
1480 }
1481 upsert: false
1482 }
1483 }
1484 }
1485
1486 RUN recvok
1487 send Mysqlx.Prepare.Execute {
1488 stmt_id: 4
1489 }
1490
1491 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
1492 [ASSERT notice session state change - GENERATED_DOCUMENT_IDS, type: V_OCTETS]
1493 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1494
1495 #
1496 # I.5
1497 send Mysqlx.Prepare.Prepare {
1498 stmt_id: 5
1499 stmt {
1500 type: FIND
1501 find {
1502 collection {
1503 name: "coll"
1504 }
1505 data_model: DOCUMENT
1506 projection {
1507 source {
1508 type: IDENT
1509 identifier {
1510 document_path {
1511 type: MEMBER
1512 value: "name"
1513 }
1514 }
1515 }
1516 alias: "name"
1517 }
1518 }
1519 }
1520 }
1521
1522 RUN recvok
1523 send Mysqlx.Prepare.Execute {
1524 stmt_id: 5
1525 }
1526
1527 [ASSERT Mysqlx.Resultset.ColumnMetaData]
1528 [ASSERT Mysqlx.Resultset.Row]
1529 [ASSERT Mysqlx.Resultset.Row]
1530 [ASSERT Mysqlx.Resultset.Row]
1531 [ASSERT Mysqlx.Resultset.Row]
1532 [ASSERT Mysqlx.Resultset.Row]
1533 [ASSERT Mysqlx.Resultset.FetchDone]
1534 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1535
1536 #
1537 # II.1
1538 send Mysqlx.Prepare.Prepare {
1539 stmt_id: 6
1540 stmt {
1541 type: FIND
1542 find {
1543 collection {
1544 name: "coll"
1545 }
1546 data_model: DOCUMENT
1547 projection {
1548 source {
1549 type: OPERATOR
1550 operator {
1551 name: "/"
1552 param {
1553 type: LITERAL
1554 literal {
1555 type: V_SINT
1556 v_signed_int: 1
1557 }
1558 }
1559 param {
1560 type: IDENT
1561 identifier {
1562 document_path {
1563 type: MEMBER
1564 value: "prio"
1565 }
1566 }
1567 }
1568 }
1569 }
1570 alias: "name"
1571 }
1572 }
1573 }
1574 }
1575
1576 RUN recvok
1577 send Mysqlx.Prepare.Execute {
1578 stmt_id: 6
1579 }
1580
1581 [ASSERT Mysqlx.Resultset.ColumnMetaData]
1582 [ASSERT Mysqlx.Resultset.Row]
1583 [ASSERT Mysqlx.Resultset.Row]
1584 [ASSERT Mysqlx.Resultset.Row]
1585 [ASSERT Mysqlx.Resultset.Row]
1586 [ASSERT Mysqlx.Resultset.Row]
1587 [ASSERT Mysqlx.Resultset.FetchDone]
1588 [ASSERT notice warning - WARNING, 1365]
1589 [ASSERT notice warning - WARNING, 1365]
1590 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1591 Mysqlx.Ok {
1592 msg: "bye!"
1593 }
1594 ok
1595
1596 ## E. Execute the test using lz4/multiple
1597 #
1598
1599
1600 ## Test setup
1601 RUN DROP TABLE IF EXISTS xtest.coll
1602
1603 0 rows affected
1604
1605 command ok
1606 send Mysqlx.Crud.Insert {
1607 collection {
1608 name: "coll"
1609 schema: "xtest"
1610 }
1611 data_model: DOCUMENT
1612 row {
1613 field {
1614 type: LITERAL
1615 literal {
1616 type: V_OCTETS
1617 v_octets {
1618 value: "{\"_id\": \"1\", \"name\":\"first\", \"prio\":1}"
1619 content_type: 2
1620 }
1621 }
1622 }
1623 }
1624 upsert: false
1625 }
1626
1627
1628 1 rows affected
1629 Got expected error (code 0)
1630 send Mysqlx.Crud.Insert {
1631 collection {
1632 name: "coll"
1633 schema: "xtest"
1634 }
1635 data_model: DOCUMENT
1636 row {
1637 field {
1638 type: LITERAL
1639 literal {
1640 type: V_OCTETS
1641 v_octets {
1642 value: "{\"_id\": \"2\", \"name\":\"second\", \"prio\":2}"
1643 content_type: 2
1644 }
1645 }
1646 }
1647 }
1648 upsert: false
1649 }
1650
1651
1652 1 rows affected
1653 Got expected error (code 0)
1654 send Mysqlx.Crud.Insert {
1655 collection {
1656 name: "coll"
1657 schema: "xtest"
1658 }
1659 data_model: DOCUMENT
1660 row {
1661 field {
1662 type: LITERAL
1663 literal {
1664 type: V_OCTETS
1665 v_octets {
1666 value: "{\"_id\": \"3\", \"name\":\"third\", \"prio\":1}"
1667 content_type: 2
1668 }
1669 }
1670 }
1671 }
1672 upsert: false
1673 }
1674
1675
1676 1 rows affected
1677 Got expected error (code 0)
1678 send Mysqlx.Crud.Insert {
1679 collection {
1680 name: "coll"
1681 schema: "xtest"
1682 }
1683 data_model: DOCUMENT
1684 row {
1685 field {
1686 type: LITERAL
1687 literal {
1688 type: V_OCTETS
1689 v_octets {
1690 value: "{\"_id\": \"5\", \"name\":\"fifth\", \"prio\":4}"
1691 content_type: 2
1692 }
1693 }
1694 }
1695 }
1696 upsert: false
1697 }
1698
1699
1700 1 rows affected
1701 Got expected error (code 0)
1702
1703
1704 ## I. Validate simple resultsets for CRUD messages
1705 #
1706 # 1. Assert resultset for CRUD-delete message
1707 # 2. Assert resultset for CRUD-update message
1708 # 3. Assert resultset for CRUD-create message (doc with id)
1709 # 4. Assert resultset for CRUD-create message (doc without id)
1710 # 5. Assert resultset for CRUD-read message
1711
1712 ## II. Validate simple resultset with warnings
1713 #
1714 # 1. Assert one resultsets for select queries
1715
1716 #
1717 # I.1
1718 send Mysqlx.Prepare.Prepare {
1719 stmt_id: 1
1720 stmt {
1721 type: DELETE
1722 delete {
1723 collection {
1724 name: "coll"
1725 }
1726 data_model: DOCUMENT
1727 criteria {
1728 type: OPERATOR
1729 operator {
1730 name: "=="
1731 param {
1732 type: IDENT
1733 identifier {
1734 document_path {
1735 type: MEMBER
1736 value: "name"
1737 }
1738 }
1739 }
1740 param {
1741 type: LITERAL
1742 literal {
1743 type: V_OCTETS
1744 v_octets {
1745 value: "fifth"
1746 }
1747 }
1748 }
1749 }
1750 }
1751 }
1752 }
1753 }
1754
1755 RUN recvok
1756 send Mysqlx.Prepare.Execute {
1757 stmt_id: 1
1758 }
1759
1760 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
1761 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1762
1763 #
1764 # I.2
1765 send Mysqlx.Prepare.Prepare {
1766 stmt_id: 2
1767 stmt {
1768 type: UPDATE
1769 update {
1770 collection {
1771 name: "coll"
1772 }
1773 data_model: DOCUMENT
1774 operation {
1775 source {
1776 document_path {
1777 type: MEMBER
1778 value: "prio"
1779 }
1780 }
1781 operation: ITEM_SET
1782 value {
1783 type: OPERATOR
1784 operator {
1785 name: "-"
1786 param {
1787 type: IDENT
1788 identifier {
1789 document_path {
1790 type: MEMBER
1791 value: "prio"
1792 }
1793 }
1794 }
1795 param {
1796 type: LITERAL
1797 literal {
1798 type: V_SINT
1799 v_signed_int: 1
1800 }
1801 }
1802 }
1803 }
1804 }
1805 }
1806 }
1807 }
1808
1809 RUN recvok
1810 send Mysqlx.Prepare.Execute {
1811 stmt_id: 2
1812 }
1813
1814 [ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING]
1815 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:3]
1816 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1817
1818 #
1819 # I.3
1820 send Mysqlx.Prepare.Prepare {
1821 stmt_id: 3
1822 stmt {
1823 type: INSERT
1824 insert {
1825 collection {
1826 name: "coll"
1827 schema: "xtest"
1828 }
1829 data_model: DOCUMENT
1830 row {
1831 field {
1832 type: LITERAL
1833 literal {
1834 type: V_OCTETS
1835 v_octets {
1836 value: "{\"_id\": \"6\", \"name\":\"sixth\", \"prio\":3}"
1837 content_type: 2
1838 }
1839 }
1840 }
1841 }
1842 upsert: false
1843 }
1844 }
1845 }
1846
1847 RUN recvok
1848 send Mysqlx.Prepare.Execute {
1849 stmt_id: 3
1850 }
1851
1852 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
1853 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1854
1855 #
1856 # I.4
1857 send Mysqlx.Prepare.Prepare {
1858 stmt_id: 4
1859 stmt {
1860 type: INSERT
1861 insert {
1862 collection {
1863 name: "coll"
1864 schema: "xtest"
1865 }
1866 data_model: DOCUMENT
1867 row {
1868 field {
1869 type: LITERAL
1870 literal {
1871 type: V_OCTETS
1872 v_octets {
1873 value: "{\"name\":\"sixth\", \"prio\":3}"
1874 content_type: 2
1875 }
1876 }
1877 }
1878 }
1879 upsert: false
1880 }
1881 }
1882 }
1883
1884 RUN recvok
1885 send Mysqlx.Prepare.Execute {
1886 stmt_id: 4
1887 }
1888
1889 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
1890 [ASSERT notice session state change - GENERATED_DOCUMENT_IDS, type: V_OCTETS]
1891 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1892
1893 #
1894 # I.5
1895 send Mysqlx.Prepare.Prepare {
1896 stmt_id: 5
1897 stmt {
1898 type: FIND
1899 find {
1900 collection {
1901 name: "coll"
1902 }
1903 data_model: DOCUMENT
1904 projection {
1905 source {
1906 type: IDENT
1907 identifier {
1908 document_path {
1909 type: MEMBER
1910 value: "name"
1911 }
1912 }
1913 }
1914 alias: "name"
1915 }
1916 }
1917 }
1918 }
1919
1920 RUN recvok
1921 send Mysqlx.Prepare.Execute {
1922 stmt_id: 5
1923 }
1924
1925 [ASSERT Mysqlx.Resultset.ColumnMetaData]
1926 [ASSERT Mysqlx.Resultset.Row]
1927 [ASSERT Mysqlx.Resultset.Row]
1928 [ASSERT Mysqlx.Resultset.Row]
1929 [ASSERT Mysqlx.Resultset.Row]
1930 [ASSERT Mysqlx.Resultset.Row]
1931 [ASSERT Mysqlx.Resultset.FetchDone]
1932 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1933
1934 #
1935 # II.1
1936 send Mysqlx.Prepare.Prepare {
1937 stmt_id: 6
1938 stmt {
1939 type: FIND
1940 find {
1941 collection {
1942 name: "coll"
1943 }
1944 data_model: DOCUMENT
1945 projection {
1946 source {
1947 type: OPERATOR
1948 operator {
1949 name: "/"
1950 param {
1951 type: LITERAL
1952 literal {
1953 type: V_SINT
1954 v_signed_int: 1
1955 }
1956 }
1957 param {
1958 type: IDENT
1959 identifier {
1960 document_path {
1961 type: MEMBER
1962 value: "prio"
1963 }
1964 }
1965 }
1966 }
1967 }
1968 alias: "name"
1969 }
1970 }
1971 }
1972 }
1973
1974 RUN recvok
1975 send Mysqlx.Prepare.Execute {
1976 stmt_id: 6
1977 }
1978
1979 [ASSERT Mysqlx.Resultset.ColumnMetaData]
1980 [ASSERT Mysqlx.Resultset.Row]
1981 [ASSERT Mysqlx.Resultset.Row]
1982 [ASSERT Mysqlx.Resultset.Row]
1983 [ASSERT Mysqlx.Resultset.Row]
1984 [ASSERT Mysqlx.Resultset.Row]
1985 [ASSERT Mysqlx.Resultset.FetchDone]
1986 [ASSERT notice warning - WARNING, 1365]
1987 [ASSERT notice warning - WARNING, 1365]
1988 [ASSERT Mysqlx.Sql.StmtExecuteOk]
1989 Mysqlx.Ok {
1990 msg: "bye!"
1991 }
1992 ok
1993
1994 ## F. Execute the test using lz4/single
1995 #
1996
1997
1998 ## Test setup
1999 RUN DROP TABLE IF EXISTS xtest.coll
2000
2001 0 rows affected
2002
2003 command ok
2004 send Mysqlx.Crud.Insert {
2005 collection {
2006 name: "coll"
2007 schema: "xtest"
2008 }
2009 data_model: DOCUMENT
2010 row {
2011 field {
2012 type: LITERAL
2013 literal {
2014 type: V_OCTETS
2015 v_octets {
2016 value: "{\"_id\": \"1\", \"name\":\"first\", \"prio\":1}"
2017 content_type: 2
2018 }
2019 }
2020 }
2021 }
2022 upsert: false
2023 }
2024
2025
2026 1 rows affected
2027 Got expected error (code 0)
2028 send Mysqlx.Crud.Insert {
2029 collection {
2030 name: "coll"
2031 schema: "xtest"
2032 }
2033 data_model: DOCUMENT
2034 row {
2035 field {
2036 type: LITERAL
2037 literal {
2038 type: V_OCTETS
2039 v_octets {
2040 value: "{\"_id\": \"2\", \"name\":\"second\", \"prio\":2}"
2041 content_type: 2
2042 }
2043 }
2044 }
2045 }
2046 upsert: false
2047 }
2048
2049
2050 1 rows affected
2051 Got expected error (code 0)
2052 send Mysqlx.Crud.Insert {
2053 collection {
2054 name: "coll"
2055 schema: "xtest"
2056 }
2057 data_model: DOCUMENT
2058 row {
2059 field {
2060 type: LITERAL
2061 literal {
2062 type: V_OCTETS
2063 v_octets {
2064 value: "{\"_id\": \"3\", \"name\":\"third\", \"prio\":1}"
2065 content_type: 2
2066 }
2067 }
2068 }
2069 }
2070 upsert: false
2071 }
2072
2073
2074 1 rows affected
2075 Got expected error (code 0)
2076 send Mysqlx.Crud.Insert {
2077 collection {
2078 name: "coll"
2079 schema: "xtest"
2080 }
2081 data_model: DOCUMENT
2082 row {
2083 field {
2084 type: LITERAL
2085 literal {
2086 type: V_OCTETS
2087 v_octets {
2088 value: "{\"_id\": \"5\", \"name\":\"fifth\", \"prio\":4}"
2089 content_type: 2
2090 }
2091 }
2092 }
2093 }
2094 upsert: false
2095 }
2096
2097
2098 1 rows affected
2099 Got expected error (code 0)
2100
2101
2102 ## I. Validate simple resultsets for CRUD messages
2103 #
2104 # 1. Assert resultset for CRUD-delete message
2105 # 2. Assert resultset for CRUD-update message
2106 # 3. Assert resultset for CRUD-create message (doc with id)
2107 # 4. Assert resultset for CRUD-create message (doc without id)
2108 # 5. Assert resultset for CRUD-read message
2109
2110 ## II. Validate simple resultset with warnings
2111 #
2112 # 1. Assert one resultsets for select queries
2113
2114 #
2115 # I.1
2116 send Mysqlx.Prepare.Prepare {
2117 stmt_id: 1
2118 stmt {
2119 type: DELETE
2120 delete {
2121 collection {
2122 name: "coll"
2123 }
2124 data_model: DOCUMENT
2125 criteria {
2126 type: OPERATOR
2127 operator {
2128 name: "=="
2129 param {
2130 type: IDENT
2131 identifier {
2132 document_path {
2133 type: MEMBER
2134 value: "name"
2135 }
2136 }
2137 }
2138 param {
2139 type: LITERAL
2140 literal {
2141 type: V_OCTETS
2142 v_octets {
2143 value: "fifth"
2144 }
2145 }
2146 }
2147 }
2148 }
2149 }
2150 }
2151 }
2152
2153 RUN recvok
2154 send Mysqlx.Prepare.Execute {
2155 stmt_id: 1
2156 }
2157
2158 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
2159 [ASSERT Mysqlx.Sql.StmtExecuteOk]
2160
2161 #
2162 # I.2
2163 send Mysqlx.Prepare.Prepare {
2164 stmt_id: 2
2165 stmt {
2166 type: UPDATE
2167 update {
2168 collection {
2169 name: "coll"
2170 }
2171 data_model: DOCUMENT
2172 operation {
2173 source {
2174 document_path {
2175 type: MEMBER
2176 value: "prio"
2177 }
2178 }
2179 operation: ITEM_SET
2180 value {
2181 type: OPERATOR
2182 operator {
2183 name: "-"
2184 param {
2185 type: IDENT
2186 identifier {
2187 document_path {
2188 type: MEMBER
2189 value: "prio"
2190 }
2191 }
2192 }
2193 param {
2194 type: LITERAL
2195 literal {
2196 type: V_SINT
2197 v_signed_int: 1
2198 }
2199 }
2200 }
2201 }
2202 }
2203 }
2204 }
2205 }
2206
2207 RUN recvok
2208 send Mysqlx.Prepare.Execute {
2209 stmt_id: 2
2210 }
2211
2212 [ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING]
2213 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:3]
2214 [ASSERT Mysqlx.Sql.StmtExecuteOk]
2215
2216 #
2217 # I.3
2218 send Mysqlx.Prepare.Prepare {
2219 stmt_id: 3
2220 stmt {
2221 type: INSERT
2222 insert {
2223 collection {
2224 name: "coll"
2225 schema: "xtest"
2226 }
2227 data_model: DOCUMENT
2228 row {
2229 field {
2230 type: LITERAL
2231 literal {
2232 type: V_OCTETS
2233 v_octets {
2234 value: "{\"_id\": \"6\", \"name\":\"sixth\", \"prio\":3}"
2235 content_type: 2
2236 }
2237 }
2238 }
2239 }
2240 upsert: false
2241 }
2242 }
2243 }
2244
2245 RUN recvok
2246 send Mysqlx.Prepare.Execute {
2247 stmt_id: 3
2248 }
2249
2250 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
2251 [ASSERT Mysqlx.Sql.StmtExecuteOk]
2252
2253 #
2254 # I.4
2255 send Mysqlx.Prepare.Prepare {
2256 stmt_id: 4
2257 stmt {
2258 type: INSERT
2259 insert {
2260 collection {
2261 name: "coll"
2262 schema: "xtest"
2263 }
2264 data_model: DOCUMENT
2265 row {
2266 field {
2267 type: LITERAL
2268 literal {
2269 type: V_OCTETS
2270 v_octets {
2271 value: "{\"name\":\"sixth\", \"prio\":3}"
2272 content_type: 2
2273 }
2274 }
2275 }
2276 }
2277 upsert: false
2278 }
2279 }
2280 }
2281
2282 RUN recvok
2283 send Mysqlx.Prepare.Execute {
2284 stmt_id: 4
2285 }
2286
2287 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
2288 [ASSERT notice session state change - GENERATED_DOCUMENT_IDS, type: V_OCTETS]
2289 [ASSERT Mysqlx.Sql.StmtExecuteOk]
2290
2291 #
2292 # I.5
2293 send Mysqlx.Prepare.Prepare {
2294 stmt_id: 5
2295 stmt {
2296 type: FIND
2297 find {
2298 collection {
2299 name: "coll"
2300 }
2301 data_model: DOCUMENT
2302 projection {
2303 source {
2304 type: IDENT
2305 identifier {
2306 document_path {
2307 type: MEMBER
2308 value: "name"
2309 }
2310 }
2311 }
2312 alias: "name"
2313 }
2314 }
2315 }
2316 }
2317
2318 RUN recvok
2319 send Mysqlx.Prepare.Execute {
2320 stmt_id: 5
2321 }
2322
2323 [ASSERT Mysqlx.Resultset.ColumnMetaData]
2324 [ASSERT Mysqlx.Resultset.Row]
2325 [ASSERT Mysqlx.Resultset.Row]
2326 [ASSERT Mysqlx.Resultset.Row]
2327 [ASSERT Mysqlx.Resultset.Row]
2328 [ASSERT Mysqlx.Resultset.Row]
2329 [ASSERT Mysqlx.Resultset.FetchDone]
2330 [ASSERT Mysqlx.Sql.StmtExecuteOk]
2331
2332 #
2333 # II.1
2334 send Mysqlx.Prepare.Prepare {
2335 stmt_id: 6
2336 stmt {
2337 type: FIND
2338 find {
2339 collection {
2340 name: "coll"
2341 }
2342 data_model: DOCUMENT
2343 projection {
2344 source {
2345 type: OPERATOR
2346 operator {
2347 name: "/"
2348 param {
2349 type: LITERAL
2350 literal {
2351 type: V_SINT
2352 v_signed_int: 1
2353 }
2354 }
2355 param {
2356 type: IDENT
2357 identifier {
2358 document_path {
2359 type: MEMBER
2360 value: "prio"
2361 }
2362 }
2363 }
2364 }
2365 }
2366 alias: "name"
2367 }
2368 }
2369 }
2370 }
2371
2372 RUN recvok
2373 send Mysqlx.Prepare.Execute {
2374 stmt_id: 6
2375 }
2376
2377 [ASSERT Mysqlx.Resultset.ColumnMetaData]
2378 [ASSERT Mysqlx.Resultset.Row]
2379 [ASSERT Mysqlx.Resultset.Row]
2380 [ASSERT Mysqlx.Resultset.Row]
2381 [ASSERT Mysqlx.Resultset.Row]
2382 [ASSERT Mysqlx.Resultset.Row]
2383 [ASSERT Mysqlx.Resultset.FetchDone]
2384 [ASSERT notice warning - WARNING, 1365]
2385 [ASSERT notice warning - WARNING, 1365]
2386 [ASSERT Mysqlx.Sql.StmtExecuteOk]
2387 Mysqlx.Ok {
2388 msg: "bye!"
2389 }
2390 ok
2391
2392 ## G. Execute the test using zstd/group
2393 #
2394
2395
2396 ## Test setup
2397 RUN DROP TABLE IF EXISTS xtest.coll
2398
2399 0 rows affected
2400
2401 command ok
2402 send Mysqlx.Crud.Insert {
2403 collection {
2404 name: "coll"
2405 schema: "xtest"
2406 }
2407 data_model: DOCUMENT
2408 row {
2409 field {
2410 type: LITERAL
2411 literal {
2412 type: V_OCTETS
2413 v_octets {
2414 value: "{\"_id\": \"1\", \"name\":\"first\", \"prio\":1}"
2415 content_type: 2
2416 }
2417 }
2418 }
2419 }
2420 upsert: false
2421 }
2422
2423
2424 1 rows affected
2425 Got expected error (code 0)
2426 send Mysqlx.Crud.Insert {
2427 collection {
2428 name: "coll"
2429 schema: "xtest"
2430 }
2431 data_model: DOCUMENT
2432 row {
2433 field {
2434 type: LITERAL
2435 literal {
2436 type: V_OCTETS
2437 v_octets {
2438 value: "{\"_id\": \"2\", \"name\":\"second\", \"prio\":2}"
2439 content_type: 2
2440 }
2441 }
2442 }
2443 }
2444 upsert: false
2445 }
2446
2447
2448 1 rows affected
2449 Got expected error (code 0)
2450 send Mysqlx.Crud.Insert {
2451 collection {
2452 name: "coll"
2453 schema: "xtest"
2454 }
2455 data_model: DOCUMENT
2456 row {
2457 field {
2458 type: LITERAL
2459 literal {
2460 type: V_OCTETS
2461 v_octets {
2462 value: "{\"_id\": \"3\", \"name\":\"third\", \"prio\":1}"
2463 content_type: 2
2464 }
2465 }
2466 }
2467 }
2468 upsert: false
2469 }
2470
2471
2472 1 rows affected
2473 Got expected error (code 0)
2474 send Mysqlx.Crud.Insert {
2475 collection {
2476 name: "coll"
2477 schema: "xtest"
2478 }
2479 data_model: DOCUMENT
2480 row {
2481 field {
2482 type: LITERAL
2483 literal {
2484 type: V_OCTETS
2485 v_octets {
2486 value: "{\"_id\": \"5\", \"name\":\"fifth\", \"prio\":4}"
2487 content_type: 2
2488 }
2489 }
2490 }
2491 }
2492 upsert: false
2493 }
2494
2495
2496 1 rows affected
2497 Got expected error (code 0)
2498
2499
2500 ## I. Validate simple resultsets for CRUD messages
2501 #
2502 # 1. Assert resultset for CRUD-delete message
2503 # 2. Assert resultset for CRUD-update message
2504 # 3. Assert resultset for CRUD-create message (doc with id)
2505 # 4. Assert resultset for CRUD-create message (doc without id)
2506 # 5. Assert resultset for CRUD-read message
2507
2508 ## II. Validate simple resultset with warnings
2509 #
2510 # 1. Assert one resultsets for select queries
2511
2512 #
2513 # I.1
2514 send Mysqlx.Prepare.Prepare {
2515 stmt_id: 1
2516 stmt {
2517 type: DELETE
2518 delete {
2519 collection {
2520 name: "coll"
2521 }
2522 data_model: DOCUMENT
2523 criteria {
2524 type: OPERATOR
2525 operator {
2526 name: "=="
2527 param {
2528 type: IDENT
2529 identifier {
2530 document_path {
2531 type: MEMBER
2532 value: "name"
2533 }
2534 }
2535 }
2536 param {
2537 type: LITERAL
2538 literal {
2539 type: V_OCTETS
2540 v_octets {
2541 value: "fifth"
2542 }
2543 }
2544 }
2545 }
2546 }
2547 }
2548 }
2549 }
2550
2551 RUN recvok
2552 send Mysqlx.Prepare.Execute {
2553 stmt_id: 1
2554 }
2555
2556 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
2557 [ASSERT Mysqlx.Sql.StmtExecuteOk]
2558
2559 #
2560 # I.2
2561 send Mysqlx.Prepare.Prepare {
2562 stmt_id: 2
2563 stmt {
2564 type: UPDATE
2565 update {
2566 collection {
2567 name: "coll"
2568 }
2569 data_model: DOCUMENT
2570 operation {
2571 source {
2572 document_path {
2573 type: MEMBER
2574 value: "prio"
2575 }
2576 }
2577 operation: ITEM_SET
2578 value {
2579 type: OPERATOR
2580 operator {
2581 name: "-"
2582 param {
2583 type: IDENT
2584 identifier {
2585 document_path {
2586 type: MEMBER
2587 value: "prio"
2588 }
2589 }
2590 }
2591 param {
2592 type: LITERAL
2593 literal {
2594 type: V_SINT
2595 v_signed_int: 1
2596 }
2597 }
2598 }
2599 }
2600 }
2601 }
2602 }
2603 }
2604
2605 RUN recvok
2606 send Mysqlx.Prepare.Execute {
2607 stmt_id: 2
2608 }
2609
2610 [ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING]
2611 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:3]
2612 [ASSERT Mysqlx.Sql.StmtExecuteOk]
2613
2614 #
2615 # I.3
2616 send Mysqlx.Prepare.Prepare {
2617 stmt_id: 3
2618 stmt {
2619 type: INSERT
2620 insert {
2621 collection {
2622 name: "coll"
2623 schema: "xtest"
2624 }
2625 data_model: DOCUMENT
2626 row {
2627 field {
2628 type: LITERAL
2629 literal {
2630 type: V_OCTETS
2631 v_octets {
2632 value: "{\"_id\": \"6\", \"name\":\"sixth\", \"prio\":3}"
2633 content_type: 2
2634 }
2635 }
2636 }
2637 }
2638 upsert: false
2639 }
2640 }
2641 }
2642
2643 RUN recvok
2644 send Mysqlx.Prepare.Execute {
2645 stmt_id: 3
2646 }
2647
2648 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
2649 [ASSERT Mysqlx.Sql.StmtExecuteOk]
2650
2651 #
2652 # I.4
2653 send Mysqlx.Prepare.Prepare {
2654 stmt_id: 4
2655 stmt {
2656 type: INSERT
2657 insert {
2658 collection {
2659 name: "coll"
2660 schema: "xtest"
2661 }
2662 data_model: DOCUMENT
2663 row {
2664 field {
2665 type: LITERAL
2666 literal {
2667 type: V_OCTETS
2668 v_octets {
2669 value: "{\"name\":\"sixth\", \"prio\":3}"
2670 content_type: 2
2671 }
2672 }
2673 }
2674 }
2675 upsert: false
2676 }
2677 }
2678 }
2679
2680 RUN recvok
2681 send Mysqlx.Prepare.Execute {
2682 stmt_id: 4
2683 }
2684
2685 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
2686 [ASSERT notice session state change - GENERATED_DOCUMENT_IDS, type: V_OCTETS]
2687 [ASSERT Mysqlx.Sql.StmtExecuteOk]
2688
2689 #
2690 # I.5
2691 send Mysqlx.Prepare.Prepare {
2692 stmt_id: 5
2693 stmt {
2694 type: FIND
2695 find {
2696 collection {
2697 name: "coll"
2698 }
2699 data_model: DOCUMENT
2700 projection {
2701 source {
2702 type: IDENT
2703 identifier {
2704 document_path {
2705 type: MEMBER
2706 value: "name"
2707 }
2708 }
2709 }
2710 alias: "name"
2711 }
2712 }
2713 }
2714 }
2715
2716 RUN recvok
2717 send Mysqlx.Prepare.Execute {
2718 stmt_id: 5
2719 }
2720
2721 [ASSERT Mysqlx.Resultset.ColumnMetaData]
2722 [ASSERT Mysqlx.Resultset.Row]
2723 [ASSERT Mysqlx.Resultset.Row]
2724 [ASSERT Mysqlx.Resultset.Row]
2725 [ASSERT Mysqlx.Resultset.Row]
2726 [ASSERT Mysqlx.Resultset.Row]
2727 [ASSERT Mysqlx.Resultset.FetchDone]
2728 [ASSERT Mysqlx.Sql.StmtExecuteOk]
2729
2730 #
2731 # II.1
2732 send Mysqlx.Prepare.Prepare {
2733 stmt_id: 6
2734 stmt {
2735 type: FIND
2736 find {
2737 collection {
2738 name: "coll"
2739 }
2740 data_model: DOCUMENT
2741 projection {
2742 source {
2743 type: OPERATOR
2744 operator {
2745 name: "/"
2746 param {
2747 type: LITERAL
2748 literal {
2749 type: V_SINT
2750 v_signed_int: 1
2751 }
2752 }
2753 param {
2754 type: IDENT
2755 identifier {
2756 document_path {
2757 type: MEMBER
2758 value: "prio"
2759 }
2760 }
2761 }
2762 }
2763 }
2764 alias: "name"
2765 }
2766 }
2767 }
2768 }
2769
2770 RUN recvok
2771 send Mysqlx.Prepare.Execute {
2772 stmt_id: 6
2773 }
2774
2775 [ASSERT Mysqlx.Resultset.ColumnMetaData]
2776 [ASSERT Mysqlx.Resultset.Row]
2777 [ASSERT Mysqlx.Resultset.Row]
2778 [ASSERT Mysqlx.Resultset.Row]
2779 [ASSERT Mysqlx.Resultset.Row]
2780 [ASSERT Mysqlx.Resultset.Row]
2781 [ASSERT Mysqlx.Resultset.FetchDone]
2782 [ASSERT notice warning - WARNING, 1365]
2783 [ASSERT notice warning - WARNING, 1365]
2784 [ASSERT Mysqlx.Sql.StmtExecuteOk]
2785 Mysqlx.Ok {
2786 msg: "bye!"
2787 }
2788 ok
2789
2790 ## H. Execute the test using zstd/multiple
2791 #
2792
2793
2794 ## Test setup
2795 RUN DROP TABLE IF EXISTS xtest.coll
2796
2797 0 rows affected
2798
2799 command ok
2800 send Mysqlx.Crud.Insert {
2801 collection {
2802 name: "coll"
2803 schema: "xtest"
2804 }
2805 data_model: DOCUMENT
2806 row {
2807 field {
2808 type: LITERAL
2809 literal {
2810 type: V_OCTETS
2811 v_octets {
2812 value: "{\"_id\": \"1\", \"name\":\"first\", \"prio\":1}"
2813 content_type: 2
2814 }
2815 }
2816 }
2817 }
2818 upsert: false
2819 }
2820
2821
2822 1 rows affected
2823 Got expected error (code 0)
2824 send Mysqlx.Crud.Insert {
2825 collection {
2826 name: "coll"
2827 schema: "xtest"
2828 }
2829 data_model: DOCUMENT
2830 row {
2831 field {
2832 type: LITERAL
2833 literal {
2834 type: V_OCTETS
2835 v_octets {
2836 value: "{\"_id\": \"2\", \"name\":\"second\", \"prio\":2}"
2837 content_type: 2
2838 }
2839 }
2840 }
2841 }
2842 upsert: false
2843 }
2844
2845
2846 1 rows affected
2847 Got expected error (code 0)
2848 send Mysqlx.Crud.Insert {
2849 collection {
2850 name: "coll"
2851 schema: "xtest"
2852 }
2853 data_model: DOCUMENT
2854 row {
2855 field {
2856 type: LITERAL
2857 literal {
2858 type: V_OCTETS
2859 v_octets {
2860 value: "{\"_id\": \"3\", \"name\":\"third\", \"prio\":1}"
2861 content_type: 2
2862 }
2863 }
2864 }
2865 }
2866 upsert: false
2867 }
2868
2869
2870 1 rows affected
2871 Got expected error (code 0)
2872 send Mysqlx.Crud.Insert {
2873 collection {
2874 name: "coll"
2875 schema: "xtest"
2876 }
2877 data_model: DOCUMENT
2878 row {
2879 field {
2880 type: LITERAL
2881 literal {
2882 type: V_OCTETS
2883 v_octets {
2884 value: "{\"_id\": \"5\", \"name\":\"fifth\", \"prio\":4}"
2885 content_type: 2
2886 }
2887 }
2888 }
2889 }
2890 upsert: false
2891 }
2892
2893
2894 1 rows affected
2895 Got expected error (code 0)
2896
2897
2898 ## I. Validate simple resultsets for CRUD messages
2899 #
2900 # 1. Assert resultset for CRUD-delete message
2901 # 2. Assert resultset for CRUD-update message
2902 # 3. Assert resultset for CRUD-create message (doc with id)
2903 # 4. Assert resultset for CRUD-create message (doc without id)
2904 # 5. Assert resultset for CRUD-read message
2905
2906 ## II. Validate simple resultset with warnings
2907 #
2908 # 1. Assert one resultsets for select queries
2909
2910 #
2911 # I.1
2912 send Mysqlx.Prepare.Prepare {
2913 stmt_id: 1
2914 stmt {
2915 type: DELETE
2916 delete {
2917 collection {
2918 name: "coll"
2919 }
2920 data_model: DOCUMENT
2921 criteria {
2922 type: OPERATOR
2923 operator {
2924 name: "=="
2925 param {
2926 type: IDENT
2927 identifier {
2928 document_path {
2929 type: MEMBER
2930 value: "name"
2931 }
2932 }
2933 }
2934 param {
2935 type: LITERAL
2936 literal {
2937 type: V_OCTETS
2938 v_octets {
2939 value: "fifth"
2940 }
2941 }
2942 }
2943 }
2944 }
2945 }
2946 }
2947 }
2948
2949 RUN recvok
2950 send Mysqlx.Prepare.Execute {
2951 stmt_id: 1
2952 }
2953
2954 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
2955 [ASSERT Mysqlx.Sql.StmtExecuteOk]
2956
2957 #
2958 # I.2
2959 send Mysqlx.Prepare.Prepare {
2960 stmt_id: 2
2961 stmt {
2962 type: UPDATE
2963 update {
2964 collection {
2965 name: "coll"
2966 }
2967 data_model: DOCUMENT
2968 operation {
2969 source {
2970 document_path {
2971 type: MEMBER
2972 value: "prio"
2973 }
2974 }
2975 operation: ITEM_SET
2976 value {
2977 type: OPERATOR
2978 operator {
2979 name: "-"
2980 param {
2981 type: IDENT
2982 identifier {
2983 document_path {
2984 type: MEMBER
2985 value: "prio"
2986 }
2987 }
2988 }
2989 param {
2990 type: LITERAL
2991 literal {
2992 type: V_SINT
2993 v_signed_int: 1
2994 }
2995 }
2996 }
2997 }
2998 }
2999 }
3000 }
3001 }
3002
3003 RUN recvok
3004 send Mysqlx.Prepare.Execute {
3005 stmt_id: 2
3006 }
3007
3008 [ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING]
3009 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:3]
3010 [ASSERT Mysqlx.Sql.StmtExecuteOk]
3011
3012 #
3013 # I.3
3014 send Mysqlx.Prepare.Prepare {
3015 stmt_id: 3
3016 stmt {
3017 type: INSERT
3018 insert {
3019 collection {
3020 name: "coll"
3021 schema: "xtest"
3022 }
3023 data_model: DOCUMENT
3024 row {
3025 field {
3026 type: LITERAL
3027 literal {
3028 type: V_OCTETS
3029 v_octets {
3030 value: "{\"_id\": \"6\", \"name\":\"sixth\", \"prio\":3}"
3031 content_type: 2
3032 }
3033 }
3034 }
3035 }
3036 upsert: false
3037 }
3038 }
3039 }
3040
3041 RUN recvok
3042 send Mysqlx.Prepare.Execute {
3043 stmt_id: 3
3044 }
3045
3046 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
3047 [ASSERT Mysqlx.Sql.StmtExecuteOk]
3048
3049 #
3050 # I.4
3051 send Mysqlx.Prepare.Prepare {
3052 stmt_id: 4
3053 stmt {
3054 type: INSERT
3055 insert {
3056 collection {
3057 name: "coll"
3058 schema: "xtest"
3059 }
3060 data_model: DOCUMENT
3061 row {
3062 field {
3063 type: LITERAL
3064 literal {
3065 type: V_OCTETS
3066 v_octets {
3067 value: "{\"name\":\"sixth\", \"prio\":3}"
3068 content_type: 2
3069 }
3070 }
3071 }
3072 }
3073 upsert: false
3074 }
3075 }
3076 }
3077
3078 RUN recvok
3079 send Mysqlx.Prepare.Execute {
3080 stmt_id: 4
3081 }
3082
3083 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
3084 [ASSERT notice session state change - GENERATED_DOCUMENT_IDS, type: V_OCTETS]
3085 [ASSERT Mysqlx.Sql.StmtExecuteOk]
3086
3087 #
3088 # I.5
3089 send Mysqlx.Prepare.Prepare {
3090 stmt_id: 5
3091 stmt {
3092 type: FIND
3093 find {
3094 collection {
3095 name: "coll"
3096 }
3097 data_model: DOCUMENT
3098 projection {
3099 source {
3100 type: IDENT
3101 identifier {
3102 document_path {
3103 type: MEMBER
3104 value: "name"
3105 }
3106 }
3107 }
3108 alias: "name"
3109 }
3110 }
3111 }
3112 }
3113
3114 RUN recvok
3115 send Mysqlx.Prepare.Execute {
3116 stmt_id: 5
3117 }
3118
3119 [ASSERT Mysqlx.Resultset.ColumnMetaData]
3120 [ASSERT Mysqlx.Resultset.Row]
3121 [ASSERT Mysqlx.Resultset.Row]
3122 [ASSERT Mysqlx.Resultset.Row]
3123 [ASSERT Mysqlx.Resultset.Row]
3124 [ASSERT Mysqlx.Resultset.Row]
3125 [ASSERT Mysqlx.Resultset.FetchDone]
3126 [ASSERT Mysqlx.Sql.StmtExecuteOk]
3127
3128 #
3129 # II.1
3130 send Mysqlx.Prepare.Prepare {
3131 stmt_id: 6
3132 stmt {
3133 type: FIND
3134 find {
3135 collection {
3136 name: "coll"
3137 }
3138 data_model: DOCUMENT
3139 projection {
3140 source {
3141 type: OPERATOR
3142 operator {
3143 name: "/"
3144 param {
3145 type: LITERAL
3146 literal {
3147 type: V_SINT
3148 v_signed_int: 1
3149 }
3150 }
3151 param {
3152 type: IDENT
3153 identifier {
3154 document_path {
3155 type: MEMBER
3156 value: "prio"
3157 }
3158 }
3159 }
3160 }
3161 }
3162 alias: "name"
3163 }
3164 }
3165 }
3166 }
3167
3168 RUN recvok
3169 send Mysqlx.Prepare.Execute {
3170 stmt_id: 6
3171 }
3172
3173 [ASSERT Mysqlx.Resultset.ColumnMetaData]
3174 [ASSERT Mysqlx.Resultset.Row]
3175 [ASSERT Mysqlx.Resultset.Row]
3176 [ASSERT Mysqlx.Resultset.Row]
3177 [ASSERT Mysqlx.Resultset.Row]
3178 [ASSERT Mysqlx.Resultset.Row]
3179 [ASSERT Mysqlx.Resultset.FetchDone]
3180 [ASSERT notice warning - WARNING, 1365]
3181 [ASSERT notice warning - WARNING, 1365]
3182 [ASSERT Mysqlx.Sql.StmtExecuteOk]
3183 Mysqlx.Ok {
3184 msg: "bye!"
3185 }
3186 ok
3187
3188 ## I. Execute the test using zstd/single
3189 #
3190
3191
3192 ## Test setup
3193 RUN DROP TABLE IF EXISTS xtest.coll
3194
3195 0 rows affected
3196
3197 command ok
3198 send Mysqlx.Crud.Insert {
3199 collection {
3200 name: "coll"
3201 schema: "xtest"
3202 }
3203 data_model: DOCUMENT
3204 row {
3205 field {
3206 type: LITERAL
3207 literal {
3208 type: V_OCTETS
3209 v_octets {
3210 value: "{\"_id\": \"1\", \"name\":\"first\", \"prio\":1}"
3211 content_type: 2
3212 }
3213 }
3214 }
3215 }
3216 upsert: false
3217 }
3218
3219
3220 1 rows affected
3221 Got expected error (code 0)
3222 send Mysqlx.Crud.Insert {
3223 collection {
3224 name: "coll"
3225 schema: "xtest"
3226 }
3227 data_model: DOCUMENT
3228 row {
3229 field {
3230 type: LITERAL
3231 literal {
3232 type: V_OCTETS
3233 v_octets {
3234 value: "{\"_id\": \"2\", \"name\":\"second\", \"prio\":2}"
3235 content_type: 2
3236 }
3237 }
3238 }
3239 }
3240 upsert: false
3241 }
3242
3243
3244 1 rows affected
3245 Got expected error (code 0)
3246 send Mysqlx.Crud.Insert {
3247 collection {
3248 name: "coll"
3249 schema: "xtest"
3250 }
3251 data_model: DOCUMENT
3252 row {
3253 field {
3254 type: LITERAL
3255 literal {
3256 type: V_OCTETS
3257 v_octets {
3258 value: "{\"_id\": \"3\", \"name\":\"third\", \"prio\":1}"
3259 content_type: 2
3260 }
3261 }
3262 }
3263 }
3264 upsert: false
3265 }
3266
3267
3268 1 rows affected
3269 Got expected error (code 0)
3270 send Mysqlx.Crud.Insert {
3271 collection {
3272 name: "coll"
3273 schema: "xtest"
3274 }
3275 data_model: DOCUMENT
3276 row {
3277 field {
3278 type: LITERAL
3279 literal {
3280 type: V_OCTETS
3281 v_octets {
3282 value: "{\"_id\": \"5\", \"name\":\"fifth\", \"prio\":4}"
3283 content_type: 2
3284 }
3285 }
3286 }
3287 }
3288 upsert: false
3289 }
3290
3291
3292 1 rows affected
3293 Got expected error (code 0)
3294
3295
3296 ## I. Validate simple resultsets for CRUD messages
3297 #
3298 # 1. Assert resultset for CRUD-delete message
3299 # 2. Assert resultset for CRUD-update message
3300 # 3. Assert resultset for CRUD-create message (doc with id)
3301 # 4. Assert resultset for CRUD-create message (doc without id)
3302 # 5. Assert resultset for CRUD-read message
3303
3304 ## II. Validate simple resultset with warnings
3305 #
3306 # 1. Assert one resultsets for select queries
3307
3308 #
3309 # I.1
3310 send Mysqlx.Prepare.Prepare {
3311 stmt_id: 1
3312 stmt {
3313 type: DELETE
3314 delete {
3315 collection {
3316 name: "coll"
3317 }
3318 data_model: DOCUMENT
3319 criteria {
3320 type: OPERATOR
3321 operator {
3322 name: "=="
3323 param {
3324 type: IDENT
3325 identifier {
3326 document_path {
3327 type: MEMBER
3328 value: "name"
3329 }
3330 }
3331 }
3332 param {
3333 type: LITERAL
3334 literal {
3335 type: V_OCTETS
3336 v_octets {
3337 value: "fifth"
3338 }
3339 }
3340 }
3341 }
3342 }
3343 }
3344 }
3345 }
3346
3347 RUN recvok
3348 send Mysqlx.Prepare.Execute {
3349 stmt_id: 1
3350 }
3351
3352 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
3353 [ASSERT Mysqlx.Sql.StmtExecuteOk]
3354
3355 #
3356 # I.2
3357 send Mysqlx.Prepare.Prepare {
3358 stmt_id: 2
3359 stmt {
3360 type: UPDATE
3361 update {
3362 collection {
3363 name: "coll"
3364 }
3365 data_model: DOCUMENT
3366 operation {
3367 source {
3368 document_path {
3369 type: MEMBER
3370 value: "prio"
3371 }
3372 }
3373 operation: ITEM_SET
3374 value {
3375 type: OPERATOR
3376 operator {
3377 name: "-"
3378 param {
3379 type: IDENT
3380 identifier {
3381 document_path {
3382 type: MEMBER
3383 value: "prio"
3384 }
3385 }
3386 }
3387 param {
3388 type: LITERAL
3389 literal {
3390 type: V_SINT
3391 v_signed_int: 1
3392 }
3393 }
3394 }
3395 }
3396 }
3397 }
3398 }
3399 }
3400
3401 RUN recvok
3402 send Mysqlx.Prepare.Execute {
3403 stmt_id: 2
3404 }
3405
3406 [ASSERT notice session state change - PRODUCED_MESSAGE, type: V_STRING]
3407 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:3]
3408 [ASSERT Mysqlx.Sql.StmtExecuteOk]
3409
3410 #
3411 # I.3
3412 send Mysqlx.Prepare.Prepare {
3413 stmt_id: 3
3414 stmt {
3415 type: INSERT
3416 insert {
3417 collection {
3418 name: "coll"
3419 schema: "xtest"
3420 }
3421 data_model: DOCUMENT
3422 row {
3423 field {
3424 type: LITERAL
3425 literal {
3426 type: V_OCTETS
3427 v_octets {
3428 value: "{\"_id\": \"6\", \"name\":\"sixth\", \"prio\":3}"
3429 content_type: 2
3430 }
3431 }
3432 }
3433 }
3434 upsert: false
3435 }
3436 }
3437 }
3438
3439 RUN recvok
3440 send Mysqlx.Prepare.Execute {
3441 stmt_id: 3
3442 }
3443
3444 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
3445 [ASSERT Mysqlx.Sql.StmtExecuteOk]
3446
3447 #
3448 # I.4
3449 send Mysqlx.Prepare.Prepare {
3450 stmt_id: 4
3451 stmt {
3452 type: INSERT
3453 insert {
3454 collection {
3455 name: "coll"
3456 schema: "xtest"
3457 }
3458 data_model: DOCUMENT
3459 row {
3460 field {
3461 type: LITERAL
3462 literal {
3463 type: V_OCTETS
3464 v_octets {
3465 value: "{\"name\":\"sixth\", \"prio\":3}"
3466 content_type: 2
3467 }
3468 }
3469 }
3470 }
3471 upsert: false
3472 }
3473 }
3474 }
3475
3476 RUN recvok
3477 send Mysqlx.Prepare.Execute {
3478 stmt_id: 4
3479 }
3480
3481 [ASSERT notice session state change - ROWS_AFFECTED, v_unsigned_int:1]
3482 [ASSERT notice session state change - GENERATED_DOCUMENT_IDS, type: V_OCTETS]
3483 [ASSERT Mysqlx.Sql.StmtExecuteOk]
3484
3485 #
3486 # I.5
3487 send Mysqlx.Prepare.Prepare {
3488 stmt_id: 5
3489 stmt {
3490 type: FIND
3491 find {
3492 collection {
3493 name: "coll"
3494 }
3495 data_model: DOCUMENT
3496 projection {
3497 source {
3498 type: IDENT
3499 identifier {
3500 document_path {
3501 type: MEMBER
3502 value: "name"
3503 }
3504 }
3505 }
3506 alias: "name"
3507 }
3508 }
3509 }
3510 }
3511
3512 RUN recvok
3513 send Mysqlx.Prepare.Execute {
3514 stmt_id: 5
3515 }
3516
3517 [ASSERT Mysqlx.Resultset.ColumnMetaData]
3518 [ASSERT Mysqlx.Resultset.Row]
3519 [ASSERT Mysqlx.Resultset.Row]
3520 [ASSERT Mysqlx.Resultset.Row]
3521 [ASSERT Mysqlx.Resultset.Row]
3522 [ASSERT Mysqlx.Resultset.Row]
3523 [ASSERT Mysqlx.Resultset.FetchDone]
3524 [ASSERT Mysqlx.Sql.StmtExecuteOk]
3525
3526 #
3527 # II.1
3528 send Mysqlx.Prepare.Prepare {
3529 stmt_id: 6
3530 stmt {
3531 type: FIND
3532 find {
3533 collection {
3534 name: "coll"
3535 }
3536 data_model: DOCUMENT
3537 projection {
3538 source {
3539 type: OPERATOR
3540 operator {
3541 name: "/"
3542 param {
3543 type: LITERAL
3544 literal {
3545 type: V_SINT
3546 v_signed_int: 1
3547 }
3548 }
3549 param {
3550 type: IDENT
3551 identifier {
3552 document_path {
3553 type: MEMBER
3554 value: "prio"
3555 }
3556 }
3557 }
3558 }
3559 }
3560 alias: "name"
3561 }
3562 }
3563 }
3564 }
3565
3566 RUN recvok
3567 send Mysqlx.Prepare.Execute {
3568 stmt_id: 6
3569 }
3570
3571 [ASSERT Mysqlx.Resultset.ColumnMetaData]
3572 [ASSERT Mysqlx.Resultset.Row]
3573 [ASSERT Mysqlx.Resultset.Row]
3574 [ASSERT Mysqlx.Resultset.Row]
3575 [ASSERT Mysqlx.Resultset.Row]
3576 [ASSERT Mysqlx.Resultset.Row]
3577 [ASSERT Mysqlx.Resultset.FetchDone]
3578 [ASSERT notice warning - WARNING, 1365]
3579 [ASSERT notice warning - WARNING, 1365]
3580 [ASSERT Mysqlx.Sql.StmtExecuteOk]
3581 Mysqlx.Ok {
3582 msg: "bye!"
3583 }
3584 ok