| 1 |
## generated |
| 2 |
## Rel: Delete non-existing row |
| 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_table.xpl |
| 11 |
## Test data |
| 12 |
-->sql |
| 13 |
use xtest; |
| 14 |
create table mytable (id int primary key, name varchar(40), price decimal(5,2), info json); |
| 15 |
insert into mytable values (1, 'banana', 1.20, '{"color": "yellow"}'); |
| 16 |
insert into mytable values (2, 'apple', 0.25, '{"color":"red"}'); |
| 17 |
insert into mytable values (3, 'tomato', 1.80, '{"color":"red"}'); |
| 18 |
insert into mytable values (4, 'mango', 3.14, '{"color":"green"}'); |
| 19 |
insert into mytable values (5, 'orange', 0.90, '{"color":"orange"}'); |
| 20 |
-->endsql |
| 21 |
Mysqlx.Crud.Delete { |
| 22 |
collection { |
| 23 |
name: "mytable" |
| 24 |
schema: "xtest" |
| 25 |
} |
| 26 |
data_model: TABLE |
| 27 |
criteria { |
| 28 |
type: OPERATOR |
| 29 |
operator { |
| 30 |
name: "&&" |
| 31 |
param { |
| 32 |
type: OPERATOR |
| 33 |
operator { |
| 34 |
name: ">" |
| 35 |
param { |
| 36 |
type: IDENT |
| 37 |
identifier { |
| 38 |
name: "price" |
| 39 |
} |
| 40 |
} |
| 41 |
param { |
| 42 |
type: LITERAL |
| 43 |
literal { |
| 44 |
type: V_DOUBLE |
| 45 |
v_double: 100.0 |
| 46 |
} |
| 47 |
} |
| 48 |
} |
| 49 |
} |
| 50 |
param { |
| 51 |
type: OPERATOR |
| 52 |
operator { |
| 53 |
name: "==" |
| 54 |
param { |
| 55 |
type: IDENT |
| 56 |
identifier { |
| 57 |
document_path { |
| 58 |
type: MEMBER |
| 59 |
value: "color" |
| 60 |
} |
| 61 |
name: "info" |
| 62 |
} |
| 63 |
} |
| 64 |
param { |
| 65 |
type: LITERAL |
| 66 |
literal { |
| 67 |
type: V_OCTETS |
| 68 |
v_octets {value:"red"} |
| 69 |
} |
| 70 |
} |
| 71 |
} |
| 72 |
} |
| 73 |
} |
| 74 |
} |
| 75 |
} |
| 76 |
|
| 77 |
## expect Mysqlx.Sql.StmtExecuteOk |
| 78 |
-->recvresult |
| 79 |
EOF |
| 80 |
|
| 81 |
--exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/delete_del_none_table.xpl 2>&1 |
| 82 |
|
| 83 |
## Cleanup |
| 84 |
--source ../include/xplugin_cleanup.inc |