| 1 |
## generated |
| 2 |
## Doc: Delete non-existing 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_none_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: "last_name" |
| 39 |
} |
| 40 |
} |
| 41 |
} |
| 42 |
param { |
| 43 |
type: LITERAL |
| 44 |
literal { |
| 45 |
type: V_OCTETS |
| 46 |
v_octets {value:"xxx"} |
| 47 |
} |
| 48 |
} |
| 49 |
} |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
## expect Mysqlx.Sql.StmtExecuteOk |
| 54 |
-->recvresult |
| 55 |
EOF |
| 56 |
|
| 57 |
--exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/delete_del_none_by_expr.xpl 2>&1 |
| 58 |
|
| 59 |
## Cleanup |
| 60 |
--source ../include/xplugin_cleanup.inc |