Debian Codegraph @

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

raw
1 ########### ../t/delete_crud_o.test ###########
2 ### #
3 ### This test runs aims to run DELETE operation statements #
4 ### variant with mysqlxtest client for Table and Document data models. #
5 ### Test covers #
6 ### - delete with different operators #
7 ### - delete multiple rows #
8 ### - status variable Mysqlx_crud_delete for number of Delete #
9 ### requests received #
10 ### #
11 ########################################################################
12 #
13
14 --echo ==============================================
15 --echo CRUD DELETE SCENARIOS
16 --echo ==============================================
17 --echo
18
19 ## Preamble
20 --echo ================================================================================
21 --echo PREAMBLE
22 --echo ================================================================================
23 --source include/xplugin_preamble.inc
24 create user deletecruduser@localhost identified by 'deletecruduser';
25 grant all on *.* to deletecruduser@localhost;
26
27 ## TEST STARTS HERE
28 --echo ================================================================================
29 --echo TEST START
30 --echo ================================================================================
31 --write_file $MYSQL_TMP_DIR/mysqlx-delete_sql.xpl
32 -->sql
33 DROP SCHEMA if EXISTS mysqlxplugin;
34 CREATE SCHEMA mysqlxplugin DEFAULT CHARSET='utf8';
35 USE mysqlxplugin;
36
37 CREATE TABLE categories (
38 CategoryID int NOT NULL AUTO_INCREMENT,
39 CategoryName varchar(100),
40 CategoryDescription varchar(200),
41 CategoryIMEI tinyint,
42 CategoryDecimal decimal(5,2),
43 PRIMARY key (CategoryID)
44 );
45
46 INSERT INTO categories(CategoryID, CategoryName, CategoryDescription, CategoryIMEI, CategoryDecimal)
47 VALUES
48 (1,'Sports','Sports related category',1,235.15),
49 (2,'Entertaiment','Entertaiment related category',2,235.15),
50 (3, 'Home','Home related category',3,235.15),
51 (4, 'Kitchen','Kitchen related category',4,235.15),
52 (5, 'Garden','Garden related category',5,535.15),
53 (6, 'Toys','Toys related category',6,635.15);
54
55 CREATE TABLE extracategoryinfo (
56 extracategoryinfoID int NOT NULL AUTO_INCREMENT,
57 CategoryID int NOT NULL,
58 MainParentCategoryName varchar(100),
59 PRIMARY key (extracategoryinfoID)
60 );
61
62 INSERT INTO extracategoryinfo(extracategoryinfoID, CategoryID, MainParentCategoryName)
63 VALUES
64 (1,1,'People'),
65 (2,2,'People'),
66 (3,2,'House'),
67 (4,3,'House'),
68 (5,1,'People'),
69 (6,2,'People'),
70 (7,2,'House'),
71 (8,3,'House'),
72 (9,1,'People'),
73 (10,2,'House');
74
75 ## SQL safe updates as 1 will allow to delete only when you use a key column in the wehere clause
76 SET SQL_SAFE_UPDATES = 1;
77 SHOW STATUS like 'Mysqlx_crud_delete';
78 -->endsql
79
80 -->sql
81 select * from mysqlxplugin.extracategoryinfo;
82
83 -->endsql
84
85 -->echo Delete with In, && operators
86 Mysqlx.Crud.Delete {
87 collection {
88 name: "extracategoryinfo"
89 schema: "mysqlxplugin"
90 }
91 data_model: TABLE
92 criteria {
93 type: OPERATOR
94 operator {
95 name: "&&"
96 param {
97 type: OPERATOR
98 operator {
99 name: "in"
100 param {
101 type: IDENT
102 identifier {
103 name: "extracategoryinfoID"
104 }
105 }
106 param {
107 type: LITERAL
108 literal {
109 type: V_SINT
110 v_signed_int: 1
111 }
112 }
113 param {
114 type: LITERAL
115 literal {
116 type: V_SINT
117 v_signed_int: 3
118 }
119 }
120 }
121 }
122 param {
123 type: OPERATOR
124 operator {
125 name: "=="
126 param {
127 type: IDENT
128 identifier {
129 name: "CategoryID"
130 }
131 }
132 param {
133 type: LITERAL
134 literal {
135 type: V_SINT
136 v_signed_int: 2
137 }
138 }
139 }
140 }
141 }
142 }
143 }
144 #-- Mysqlx.Sql.StmtExecuteOk
145 -->recvresult
146
147 -->sql
148 select * from mysqlxplugin.extracategoryinfo;
149 SHOW STATUS like 'Mysqlx_crud_delete';
150 -->endsql
151
152 -->echo Delete with == operator
153 Mysqlx.Crud.Delete {
154 collection {
155 name: "extracategoryinfo"
156 schema: "mysqlxplugin"
157 }
158 data_model: TABLE
159 criteria {
160 type: OPERATOR
161 operator {
162 name: "=="
163 param {
164 type: IDENT
165 identifier {
166 name: "extracategoryinfoID"
167 }
168 }
169 param {
170 type: LITERAL
171 literal {
172 type: V_SINT
173 v_signed_int: 1
174 }
175 }
176 }
177 }
178 }
179 #-- Mysqlx.Sql.StmtExecuteOk
180 -->recvresult
181
182 -->sql
183 select * from mysqlxplugin.extracategoryinfo;
184 SHOW STATUS like 'Mysqlx_crud_delete';
185 -->endsql
186
187 -->echo Error 1175 expected because of the safe mode = 1
188 Mysqlx.Crud.Delete {
189 collection {
190 name: "extracategoryinfo"
191 schema: "mysqlxplugin"
192 }
193 data_model: TABLE
194 criteria {
195 type: OPERATOR
196 operator {
197 name: "=="
198 param {
199 type: IDENT
200 identifier {
201 name: "MainParentCategoryName"
202 }
203 }
204 param {
205 type: LITERAL
206 literal {
207 type: V_OCTETS
208 v_octets {value:"People"}
209 }
210 }
211 }
212 }
213 }
214 #-- Mysqlx.Error
215 -->recv
216
217 -->echo Error 1175 expected because of the safe mode = 1
218 Mysqlx.Crud.Delete {
219 collection {
220 name: "extracategoryinfo"
221 schema: "mysqlxplugin"
222 }
223 data_model: TABLE
224 criteria {
225 type: OPERATOR
226 operator {
227 name: "||"
228 param {
229 type: OPERATOR
230 operator {
231 name: "in"
232 param {
233 type: IDENT
234 identifier {
235 name: "MainParentCategoryName"
236 }
237 }
238 param {
239 type: LITERAL
240 literal {
241 type: V_OCTETS
242 v_octets {value:"House"}
243 }
244 }
245 }
246 }
247 param {
248 type: OPERATOR
249 operator {
250 name: "in"
251 param {
252 type: IDENT
253 identifier {
254 name: "CategoryID"
255 }
256 }
257 param {
258 type: LITERAL
259 literal {
260 type: V_SINT
261 v_signed_int: 4
262 }
263 }
264 }
265 }
266 }
267 }
268 }
269 #-- Mysqlx.Error
270 -->recv
271
272 -->echo Error 1175 expected because of the safe mode = 1
273 Mysqlx.Crud.Delete {
274 collection {
275 name: "categories"
276 schema: "mysqlxplugin"
277 }
278 data_model: TABLE
279 criteria {
280 type: OPERATOR
281 operator {
282 name: "=="
283 param {
284 type: IDENT
285 identifier {
286 name: "CategoryIMEI"
287 }
288 }
289 param {
290 type: LITERAL
291 literal {
292 type: V_SINT
293 v_signed_int: 1
294 }
295 }
296 }
297 }
298 }
299 #-- Mysqlx.Error
300 -->recv
301
302 -->sql
303 select * from mysqlxplugin.extracategoryinfo;
304
305 -->endsql
306
307 EOF
308
309 --exec $MYSQLXTEST -u deletecruduser --password='deletecruduser' --file=$MYSQL_TMP_DIR/mysqlx-delete_sql.xpl 2>&1
310 --remove_file $MYSQL_TMP_DIR/mysqlx-delete_sql.xpl
311
312 --echo .
313 --echo #---------- START TEST WITH SAFE MODE OFF ----------#
314 --echo .
315
316 ## ******************************************
317 ## 2. Start test with safe mode off |
318 ## |
319 ## ******************************************
320
321 --write_file $MYSQL_TMP_DIR/mysqlx-delete_sql_safemode_0.xpl
322 -->sql
323 USE mysqlxplugin;
324 ## SQL safe updates as 0 will allow to delete without the need to use a key column
325 SET SQL_SAFE_UPDATES = 0;
326 select * from mysqlxplugin.extracategoryinfo;
327 -->endsql
328
329 -->echo Delete all
330 Mysqlx.Crud.Delete {
331 collection {
332 name: "extracategoryinfo"
333 schema: "mysqlxplugin"
334 }
335 data_model: TABLE
336 }
337 #-- Mysqlx.Sql.StmtExecuteOk
338 -->recvresult
339
340 -->sql
341 select * from mysqlxplugin.extracategoryinfo;
342
343 -->endsql
344
345 -->sql
346 INSERT INTO extracategoryinfo(extracategoryinfoID, CategoryID, MainParentCategoryName)
347 VALUES
348 (1,1,'People'),
349 (2,2,'People'),
350 (3,2,'House'),
351 (4,3,'House'),
352 (5,1,'People'),
353 (6,2,'People2'),
354 (7,2,'House2'),
355 (8,3,'House2'),
356 (9,9,'People2'),
357 (10,10,'House2'),
358 (11,11,'House3'),
359 (12,12,'House4'),
360 (13,13,'House5'),
361 (14,14,'House6');
362 -->endsql
363
364 -->sql
365 select * from mysqlxplugin.extracategoryinfo;
366
367 -->endsql
368
369 -->echo Delete works ok because of the safe mode = 0
370 Mysqlx.Crud.Delete {
371 collection {
372 name: "extracategoryinfo"
373 schema: "mysqlxplugin"
374 }
375 data_model: TABLE
376 criteria {
377 type: OPERATOR
378 operator {
379 name: "=="
380 param {
381 type: IDENT
382 identifier {
383 name: "MainParentCategoryName"
384 }
385 }
386 param {
387 type: LITERAL
388 literal {
389 type: V_OCTETS
390 v_octets {value:"People"}
391 }
392 }
393 }
394 }
395 }
396 #-- Mysqlx.Sql.StmtExecuteOk
397 -->recvresult
398
399 -->sql
400 select * from mysqlxplugin.extracategoryinfo;
401 SHOW STATUS like 'Mysqlx_crud_delete';
402 -->endsql
403
404 -->echo Delete with || operator and in
405 Mysqlx.Crud.Delete {
406 collection {
407 name: "extracategoryinfo"
408 schema: "mysqlxplugin"
409 }
410 data_model: TABLE
411 criteria {
412 type: OPERATOR
413 operator {
414 name: "||"
415 param {
416 type: OPERATOR
417 operator {
418 name: "in"
419 param {
420 type: IDENT
421 identifier {
422 name: "MainParentCategoryName"
423 }
424 }
425 param {
426 type: LITERAL
427 literal {
428 type: V_OCTETS
429 v_octets {value:"House"}
430 }
431 }
432 }
433 }
434 param {
435 type: OPERATOR
436 operator {
437 name: "in"
438 param {
439 type: IDENT
440 identifier {
441 name: "CategoryID"
442 }
443 }
444 param {
445 type: LITERAL
446 literal {
447 type: V_SINT
448 v_signed_int: 4
449 }
450 }
451 }
452 }
453 }
454 }
455 }
456 #-- Mysqlx.Sql.StmtExecuteOk
457 -->recvresult
458
459 -->sql
460 select * from mysqlxplugin.extracategoryinfo;
461 SHOW STATUS like 'Mysqlx_crud_delete';
462 -->endsql
463
464 -->echo Delete with || operator and not in
465 Mysqlx.Crud.Delete {
466 collection {
467 name: "extracategoryinfo"
468 schema: "mysqlxplugin"
469 }
470 data_model: TABLE
471 criteria {
472 type: OPERATOR
473 operator {
474 name: "||"
475 param {
476 type: OPERATOR
477 operator {
478 name: "not_in"
479 param {
480 type: IDENT
481 identifier {
482 name: "MainParentCategoryName"
483 }
484 }
485 param {
486 type: LITERAL
487 literal {
488 type: V_OCTETS
489 v_octets {value:"House"}
490 }
491 }
492 }
493 }
494 param {
495 type: OPERATOR
496 operator {
497 name: "in"
498 param {
499 type: IDENT
500 identifier {
501 name: "CategoryID"
502 }
503 }
504 param {
505 type: LITERAL
506 literal {
507 type: V_SINT
508 v_signed_int: 8
509 }
510 }
511 }
512 }
513 }
514 }
515 }
516 #-- Mysqlx.Sql.StmtExecuteOk
517 -->recvresult
518
519 -->sql
520 select * from mysqlxplugin.extracategoryinfo;
521
522 select * from mysqlxplugin.categories;
523 SHOW STATUS like 'Mysqlx_crud_delete';
524 -->endsql
525
526 -->echo Delete with != operator
527 Mysqlx.Crud.Delete {
528 collection {
529 name: "categories"
530 schema: "mysqlxplugin"
531 }
532 data_model: TABLE
533 criteria {
534 type: OPERATOR
535 operator {
536 name: "!="
537 param {
538 type: IDENT
539 identifier {
540 name: "CategoryIMEI"
541 }
542 }
543 param {
544 type: LITERAL
545 literal {
546 type: V_SINT
547 v_signed_int: 1
548 }
549 }
550 }
551 }
552 }
553 #-- Mysqlx.Sql.StmtExecuteOk
554 -->recvresult
555
556 -->sql
557 select * from mysqlxplugin.categories;
558
559 select * from mysqlxplugin.extracategoryinfo;
560
561 INSERT INTO extracategoryinfo(extracategoryinfoID, CategoryID, MainParentCategoryName)
562 VALUES
563 (9,9,'People'),
564 (10,10,'People'),
565 (11,11,'People'),
566 (12,12,'House'),
567 (13,13,'House'),
568 (14,14,'House');
569
570 select * from mysqlxplugin.extracategoryinfo;
571 -->endsql
572
573 -->echo Delete with > and < operators
574 Mysqlx.Crud.Delete {
575 collection {
576 name: "extracategoryinfo"
577 schema: "mysqlxplugin"
578 }
579 data_model: TABLE
580 criteria {
581 type: OPERATOR
582 operator {
583 name: "&&"
584 param {
585 type: OPERATOR
586 operator {
587 name: "<"
588 param {
589 type: IDENT
590 identifier {
591 name: "CategoryID"
592 }
593 }
594 param {
595 type: LITERAL
596 literal {
597 type: V_SINT
598 v_signed_int: 11
599 }
600 }
601 }
602 }
603 param {
604 type: OPERATOR
605 operator {
606 name: ">"
607 param {
608 type: IDENT
609 identifier {
610 name: "CategoryID"
611 }
612 }
613 param {
614 type: LITERAL
615 literal {
616 type: V_SINT
617 v_signed_int: 9
618 }
619 }
620 }
621 }
622 }
623 }
624 }
625 #-- Mysqlx.Sql.StmtExecuteOk
626 -->recvresult
627
628 -->sql
629 select * from mysqlxplugin.extracategoryinfo;
630 SHOW STATUS like 'Mysqlx_crud_delete';
631 -->endsql
632
633 -->echo Delete with >= and <= operators
634 Mysqlx.Crud.Delete {
635 collection {
636 name: "extracategoryinfo"
637 schema: "mysqlxplugin"
638 }
639 data_model: TABLE
640 criteria {
641 type: OPERATOR
642 operator {
643 name: "&&"
644 param {
645 type: OPERATOR
646 operator {
647 name: "<="
648 param {
649 type: IDENT
650 identifier {
651 name: "CategoryID"
652 }
653 }
654 param {
655 type: LITERAL
656 literal {
657 type: V_SINT
658 v_signed_int: 14
659 }
660 }
661 }
662 }
663 param {
664 type: OPERATOR
665 operator {
666 name: ">="
667 param {
668 type: IDENT
669 identifier {
670 name: "CategoryID"
671 }
672 }
673 param {
674 type: LITERAL
675 literal {
676 type: V_SINT
677 v_signed_int: 13
678 }
679 }
680 }
681 }
682 }
683 }
684 }
685 #-- Mysqlx.Sql.StmtExecuteOk
686 -->recvresult
687
688 -->sql
689 select * from mysqlxplugin.extracategoryinfo;
690 SHOW STATUS like 'Mysqlx_crud_delete';
691 -->endsql
692
693 -->echo Delete with wrong Schema
694 Mysqlx.Crud.Delete {
695 collection {
696 name: "extracategoryinfo"
697 schema: "noavailableschema"
698 }
699 data_model: TABLE
700 criteria {
701 type: OPERATOR
702 operator {
703 name: "&&"
704 param {
705 type: OPERATOR
706 operator {
707 name: "<="
708 param {
709 type: IDENT
710 identifier {
711 name: "CategoryID"
712 }
713 }
714 param {
715 type: LITERAL
716 literal {
717 type: V_SINT
718 v_signed_int: 14
719 }
720 }
721 }
722 }
723 param {
724 type: OPERATOR
725 operator {
726 name: ">="
727 param {
728 type: IDENT
729 identifier {
730 name: "CategoryID"
731 }
732 }
733 param {
734 type: LITERAL
735 literal {
736 type: V_SINT
737 v_signed_int: 13
738 }
739 }
740 }
741 }
742 }
743 }
744 }
745 #-- Mysqlx.Error
746 -->recv
747
748 -->echo Delete with wrong Table
749 Mysqlx.Crud.Delete {
750 collection {
751 name: "notavailabletable"
752 schema: "mysqlxplugin"
753 }
754 data_model: TABLE
755 criteria {
756 type: OPERATOR
757 operator {
758 name: "&&"
759 param {
760 type: OPERATOR
761 operator {
762 name: "<="
763 param {
764 type: IDENT
765 identifier {
766 name: "CategoryID"
767 }
768 }
769 param {
770 type: LITERAL
771 literal {
772 type: V_SINT
773 v_signed_int: 14
774 }
775 }
776 }
777 }
778 param {
779 type: OPERATOR
780 operator {
781 name: ">="
782 param {
783 type: IDENT
784 identifier {
785 name: "CategoryID"
786 }
787 }
788 param {
789 type: LITERAL
790 literal {
791 type: V_SINT
792 v_signed_int: 13
793 }
794 }
795 }
796 }
797 }
798 }
799 }
800 #-- Mysqlx.Error
801 -->recv
802
803 -->echo Delete with wrong Column
804 Mysqlx.Crud.Delete {
805 collection {
806 name: "extracategoryinfo"
807 schema: "mysqlxplugin"
808 }
809 data_model: TABLE
810 criteria {
811 type: OPERATOR
812 operator {
813 name: "&&"
814 param {
815 type: OPERATOR
816 operator {
817 name: "<="
818 param {
819 type: IDENT
820 identifier {
821 name: "notavailablecolumn"
822 }
823 }
824 param {
825 type: LITERAL
826 literal {
827 type: V_SINT
828 v_signed_int: 14
829 }
830 }
831 }
832 }
833 param {
834 type: OPERATOR
835 operator {
836 name: ">="
837 param {
838 type: IDENT
839 identifier {
840 name: "notavailablecolumn"
841 }
842 }
843 param {
844 type: LITERAL
845 literal {
846 type: V_SINT
847 v_signed_int: 13
848 }
849 }
850 }
851 }
852 }
853 }
854 }
855 #-- Mysqlx.Error
856 -->recv
857
858 EOF
859
860 --exec $MYSQLXTEST -u deletecruduser --password='deletecruduser' --file=$MYSQL_TMP_DIR/mysqlx-delete_sql_safemode_0.xpl 2>&1
861 --remove_file $MYSQL_TMP_DIR/mysqlx-delete_sql_safemode_0.xpl
862
863
864 ## ******************************************
865 ## 3. Delete Collection Statements |
866 ## |
867 ## ******************************************
868
869 --echo .
870 --echo #---------- START COLLECTION TESTING----------#
871 --echo .
872
873 CREATE SCHEMA mysqlxplugin_coll;
874
875 --write_file $MYSQL_TMP_DIR/mysqlx-delete_collection_CRUD.xpl
876 -->stmtadmin create_collection {"schema":"mysqlxplugin_coll","name":"main_collection"}
877 -->recvresult
878
879 -->sql
880 insert into mysqlxplugin_coll.main_collection (doc) values ('{"_id": "1", "name": "Omar", "Last_Name":"Andrei"}');
881 insert into mysqlxplugin_coll.main_collection (doc) values ('{"_id": "2", "name": "Alfonso", "Last_Name":"Pavluchenko"}');
882 insert into mysqlxplugin_coll.main_collection (doc) values ('{"_id": "3", "name": "Rodrigo", "Last_Name":"Kernel"}');
883 insert into mysqlxplugin_coll.main_collection (doc) values ('{"_id": "4", "name": "Omar", "Last_Name":"Kerball"}');
884 insert into mysqlxplugin_coll.main_collection (doc) values ('{"_id": "5", "name": "Omar", "Last_Name":"Lopez"}');
885 insert into mysqlxplugin_coll.main_collection (doc) values ('{"_id": "6", "name": "Javier", "Last_Name":"Torres"}');
886 select doc from mysqlxplugin_coll.main_collection;
887 -->endsql
888
889 -->echo Delete collection rows with in Operator and based in ID
890 Mysqlx.Crud.Delete {
891 collection {
892 name: "main_collection"
893 schema: "mysqlxplugin_coll"
894 }
895 data_model: DOCUMENT
896 criteria {
897 type: OPERATOR
898 operator {
899 name: "in"
900 param {
901 type: IDENT identifier { name: "_id" }
902 }
903 param {
904 type: LITERAL
905 literal {
906 type: V_OCTETS
907 v_octets {value:"1"}
908 }
909 }
910 param {
911 type: LITERAL
912 literal {
913 type: V_OCTETS
914 v_octets {value:"3"}
915 }
916 }
917 }
918 }
919 }
920
921 #-- Mysqlx.Sql.StmtExecuteOk
922 -->recvresult
923
924 -->sql
925 select doc from mysqlxplugin_coll.main_collection;
926 -->endsql
927
928 -->echo Delete collection row with == Operator
929 Mysqlx.Crud.Delete {
930 collection {
931 name: "main_collection"
932 schema: "mysqlxplugin_coll"
933 }
934 data_model: DOCUMENT
935 criteria {
936 type: OPERATOR
937 operator {
938 name: "=="
939 param {
940 type: IDENT
941 identifier {
942 document_path {
943 type: MEMBER
944 value: "Last_Name"
945 }
946 }
947 }
948 param {
949 type: LITERAL
950 literal {
951 type: V_OCTETS
952 v_octets {value:"Pavluchenko"}
953 }
954 }
955 }
956 }
957 }
958
959 #-- Mysqlx.Sql.StmtExecuteOk
960 -->recvresult
961
962 -->sql
963 select doc from mysqlxplugin_coll.main_collection;
964 -->endsql
965
966 -->echo Delete collection row with != Operator
967 Mysqlx.Crud.Delete {
968 collection {
969 name: "main_collection"
970 schema: "mysqlxplugin_coll"
971 }
972 data_model: DOCUMENT
973 criteria {
974 type: OPERATOR
975 operator {
976 name: "!="
977 param {
978 type: IDENT
979 identifier {
980 document_path {
981 type: MEMBER
982 value: "name"
983 }
984 }
985 }
986 param {
987 type: LITERAL
988 literal {
989 type: V_OCTETS
990 v_octets {value:"Omar"}
991 }
992 }
993 }
994 }
995 }
996
997 #-- Mysqlx.Sql.StmtExecuteOk
998 -->recvresult
999
1000 -->sql
1001 select doc from mysqlxplugin_coll.main_collection;
1002 -->endsql
1003
1004 -->echo Delete collection row with not in Operator
1005 Mysqlx.Crud.Delete {
1006 collection {
1007 name: "main_collection"
1008 schema: "mysqlxplugin_coll"
1009 }
1010 data_model: DOCUMENT
1011 criteria {
1012 type: OPERATOR
1013 operator {
1014 name: "not_in"
1015 param {
1016 type: IDENT
1017 identifier {
1018 document_path {
1019 type: MEMBER
1020 value: "Last_Name"
1021 }
1022 }
1023 }
1024 param {
1025 type: LITERAL
1026 literal {
1027 type: V_OCTETS
1028 v_octets {value:"Lopez"}
1029 }
1030 }
1031 }
1032 }
1033 }
1034
1035 #-- Mysqlx.Sql.StmtExecuteOk
1036 -->recvresult
1037
1038 -->sql
1039 select doc from mysqlxplugin_coll.main_collection;
1040 -->endsql
1041
1042 -->echo Delete collection wrong schema
1043 Mysqlx.Crud.Delete {
1044 collection {
1045 name: "main_collection"
1046 schema: "not_available_schema"
1047 }
1048 data_model: DOCUMENT
1049 criteria {
1050 type: OPERATOR
1051 operator {
1052 name: "not_in"
1053 param {
1054 type: IDENT
1055 identifier {
1056 document_path {
1057 type: MEMBER
1058 value: "Last_Name"
1059 }
1060 }
1061 }
1062 param {
1063 type: LITERAL
1064 literal {
1065 type: V_OCTETS
1066 v_octets {value:"Lopez"}
1067 }
1068 }
1069 }
1070 }
1071 }
1072
1073 #-- Mysqlx.Error
1074 -->recv
1075
1076 -->echo Delete collection wrong collection
1077 Mysqlx.Crud.Delete {
1078 collection {
1079 name: "not_available_collection"
1080 schema: "mysqlxplugin_coll"
1081 }
1082 data_model: DOCUMENT
1083 criteria {
1084 type: OPERATOR
1085 operator {
1086 name: "not_in"
1087 param {
1088 type: IDENT
1089 identifier {
1090 document_path {
1091 type: MEMBER
1092 value: "Last_Name"
1093 }
1094 }
1095 }
1096 param {
1097 type: LITERAL
1098 literal {
1099 type: V_OCTETS
1100 v_octets {value:"Lopez"}
1101 }
1102 }
1103 }
1104 }
1105 }
1106
1107 #-- Mysqlx.Error
1108 -->recv
1109
1110 -->echo Delete collection wrong member
1111 Mysqlx.Crud.Delete {
1112 collection {
1113 name: "main_collection"
1114 schema: "mysqlxplugin_coll"
1115 }
1116 data_model: DOCUMENT
1117 criteria {
1118 type: OPERATOR
1119 operator {
1120 name: "=="
1121 param {
1122 type: IDENT
1123 identifier {
1124 document_path {
1125 type: MEMBER
1126 value: "notavailablemember"
1127 }
1128 }
1129 }
1130 param {
1131 type: LITERAL
1132 literal {
1133 type: V_OCTETS
1134 v_octets {value:"Lopez"}
1135 }
1136 }
1137 }
1138 }
1139 }
1140
1141 #-- No rows affected
1142 -->recvresult
1143
1144 ## Cleanup
1145 -->echo ================================================================================
1146 -->echo CLEAN UP
1147 -->echo ================================================================================
1148 -->sql
1149 DROP USER deletecruduser@localhost;
1150 SET SQL_SAFE_UPDATES = 1;
1151 -->endsql
1152 EOF
1153
1154 --exec $MYSQLXTEST -u deletecruduser --password='deletecruduser' --file=$MYSQL_TMP_DIR/mysqlx-delete_collection_CRUD.xpl 2>&1
1155
1156 ## Cleanup
1157 --source ../include/xplugin_cleanup.inc
1158 DROP SCHEMA if EXISTS mysqlxplugin;
1159 DROP SCHEMA if EXISTS mysqlxplugin_coll;
1160
1161