polardbxengine/mysql-test/suite/x/t/delete_del_multi_by_expr.test

63 lines
1.3 KiB
Plaintext

## generated
## Doc: Delete multiple documents
--source include/xplugin_preamble.inc
--source include/xplugin_create_user.inc
create schema xtest;
## Test starts here
--write_file $MYSQL_TMP_DIR/delete_del_multi_by_expr.tmp
## Test data
-->stmtadmin create_collection {"schema":"xtest","name":"mycoll"}
-->recvresult
-->sql
use xtest;
insert into mycoll (doc) values ('{"_id": "1", "name": "Joe1"}');
insert into mycoll (doc) values ('{"_id": "2", "name": "Joe2", "last_name": "Smith"}');
insert into mycoll (doc) values ('{"_id": "3", "name": "Joe2", "last_name": "Shmo"}');
-->endsql
Mysqlx.Crud.Delete {
collection {
name: "mycoll"
schema: "xtest"
}
data_model: DOCUMENT
criteria {
type: OPERATOR
operator {
name: "=="
param {
type: IDENT
identifier {
document_path {
type: MEMBER
value: "name"
}
}
}
param {
type: LITERAL
literal {
type: V_OCTETS
v_octets {value:"Joe2"}
}
}
}
}
}
## expect Mysqlx.Sql.StmtExecuteOk
-->recvresult
EOF
--exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/delete_del_multi_by_expr.tmp 2>&1
## Cleanup
drop schema if exists xtest;
--remove_file $MYSQL_TMP_DIR/delete_del_multi_by_expr.tmp
--source include/xplugin_drop_user.inc