| 1 |
## generated |
| 2 |
## Rel: Delete a valid 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_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 |
|
| 22 |
Mysqlx.Crud.Delete { |
| 23 |
collection { |
| 24 |
name: "mytable" |
| 25 |
schema: "xtest" |
| 26 |
} |
| 27 |
data_model: TABLE |
| 28 |
criteria { |
| 29 |
type: OPERATOR |
| 30 |
operator { |
| 31 |
name: "==" |
| 32 |
param { |
| 33 |
type: IDENT |
| 34 |
identifier { |
| 35 |
name: "name" |
| 36 |
} |
| 37 |
} |
| 38 |
param { |
| 39 |
type: LITERAL |
| 40 |
literal { |
| 41 |
type: V_OCTETS |
| 42 |
v_octets {value:"banana"} |
| 43 |
} |
| 44 |
} |
| 45 |
} |
| 46 |
} |
| 47 |
} |
| 48 |
|
| 49 |
## expect Mysqlx.Sql.StmtExecuteOk |
| 50 |
-->recvresult |
| 51 |
EOF |
| 52 |
|
| 53 |
--exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/delete_del_table.xpl 2>&1 |
| 54 |
|
| 55 |
## Cleanup |
| 56 |
--source ../include/xplugin_cleanup.inc |