Debian Codegraph @

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

raw
1 ## generated
2 ## Doc: Delete a valid document
3
4 --source include/xplugin_preamble.inc
5 --source include/xplugin_create_user.inc
6
7 create schema xtest;
8
9 ## Test starts here
10 --write_file $MYSQL_TMP_DIR/delete_del_one_by_expr.xpl
11 ## Test data
12
13 -->stmtadmin create_collection {"schema":"xtest","name":"mycoll"}
14 -->recvresult
15
16 -->sql
17 use xtest;
18 insert into mycoll (doc) values ('{"_id": "1", "name": "Joe1"}');
19 insert into mycoll (doc) values ('{"_id": "2", "name": "Joe2", "last_name": "Smith"}');
20 insert into mycoll (doc) values ('{"_id": "3", "name": "Joe2", "last_name": "Shmo"}');
21 -->endsql
22
23 Mysqlx.Crud.Delete {
24 collection {
25 name: "mycoll"
26 schema: "xtest"
27 }
28 data_model: DOCUMENT
29 criteria {
30 type: OPERATOR
31 operator {
32 name: "=="
33 param {
34 type: IDENT
35 identifier {
36 document_path {
37 type: MEMBER
38 value: "_id"
39 }
40 }
41 }
42 param {
43 type: LITERAL
44 literal {
45 type: V_OCTETS
46 v_octets {value:"1"}
47 }
48 }
49 }
50 }
51 }
52
53 ## expect Mysqlx.Sql.StmtExecuteOk
54 -->recvresult
55 Mysqlx.Crud.Delete {
56 collection {
57 name: "mycoll"
58 schema: "xtest"
59 }
60 data_model: DOCUMENT
61 criteria {
62 type: OPERATOR
63 operator {
64 name: "=="
65 param {
66 type: IDENT
67 identifier {
68 document_path {
69 type: MEMBER
70 value: "last_name"
71 }
72 }
73 }
74 param {
75 type: LITERAL
76 literal {
77 type: V_OCTETS
78 v_octets {value:"Smith"}
79 }
80 }
81 }
82 }
83 }
84
85 ## expect Mysqlx.Sql.StmtExecuteOk
86 -->recvresult
87 EOF
88
89 --exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/delete_del_one_by_expr.xpl 2>&1
90
91 ## Cleanup
92 --source ../include/xplugin_cleanup.inc