87 lines
2.0 KiB
Plaintext
87 lines
2.0 KiB
Plaintext
## generated
|
|
## Rel: Delete non-existing row
|
|
|
|
--source include/xplugin_preamble.inc
|
|
--source include/xplugin_create_user.inc
|
|
|
|
create schema xtest;
|
|
|
|
## Test starts here
|
|
--write_file $MYSQL_TMP_DIR/delete_del_none_table.tmp
|
|
## Test data
|
|
-->sql
|
|
use xtest;
|
|
create table mytable (id int primary key, name varchar(40), price decimal(5,2), info json);
|
|
insert into mytable values (1, 'banana', 1.20, '{"color": "yellow"}');
|
|
insert into mytable values (2, 'apple', 0.25, '{"color":"red"}');
|
|
insert into mytable values (3, 'tomato', 1.80, '{"color":"red"}');
|
|
insert into mytable values (4, 'mango', 3.14, '{"color":"green"}');
|
|
insert into mytable values (5, 'orange', 0.90, '{"color":"orange"}');
|
|
-->endsql
|
|
Mysqlx.Crud.Delete {
|
|
collection {
|
|
name: "mytable"
|
|
schema: "xtest"
|
|
}
|
|
data_model: TABLE
|
|
criteria {
|
|
type: OPERATOR
|
|
operator {
|
|
name: "&&"
|
|
param {
|
|
type: OPERATOR
|
|
operator {
|
|
name: ">"
|
|
param {
|
|
type: IDENT
|
|
identifier {
|
|
name: "price"
|
|
}
|
|
}
|
|
param {
|
|
type: LITERAL
|
|
literal {
|
|
type: V_DOUBLE
|
|
v_double: 100.0
|
|
}
|
|
}
|
|
}
|
|
}
|
|
param {
|
|
type: OPERATOR
|
|
operator {
|
|
name: "=="
|
|
param {
|
|
type: IDENT
|
|
identifier {
|
|
document_path {
|
|
type: MEMBER
|
|
value: "color"
|
|
}
|
|
name: "info"
|
|
}
|
|
}
|
|
param {
|
|
type: LITERAL
|
|
literal {
|
|
type: V_OCTETS
|
|
v_octets {value:"red"}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
## expect Mysqlx.Sql.StmtExecuteOk
|
|
-->recvresult
|
|
EOF
|
|
|
|
--exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/delete_del_none_table.tmp 2>&1
|
|
|
|
## Cleanup
|
|
drop schema if exists xtest;
|
|
--remove_file $MYSQL_TMP_DIR/delete_del_none_table.tmp
|
|
--source include/xplugin_drop_user.inc
|