| 1 |
## generated |
| 2 |
## Rel: Delete on a table with expression on invalid columns |
| 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_doc.xpl |
| 11 |
## Test data |
| 12 |
|
| 13 |
-->sql |
| 14 |
use xtest; |
| 15 |
create table mytable (id int primary key, name varchar(40), price decimal(5,2), info json); |
| 16 |
insert into mytable values (1, 'banana', 1.20, '{"color": "yellow"}'); |
| 17 |
insert into mytable values (2, 'apple', 0.25, '{"color":"red"}'); |
| 18 |
insert into mytable values (3, 'tomato', 1.80, '{"color":"red"}'); |
| 19 |
insert into mytable values (4, 'mango', 3.14, '{"color":"green"}'); |
| 20 |
insert into mytable values (5, 'orange', 0.90, '{"color":"orange"}'); |
| 21 |
-->endsql |
| 22 |
|
| 23 |
Mysqlx.Crud.Delete { |
| 24 |
collection { |
| 25 |
name: "mytable" |
| 26 |
schema: "xtest" |
| 27 |
} |
| 28 |
data_model: TABLE |
| 29 |
criteria { |
| 30 |
type: OPERATOR |
| 31 |
operator { |
| 32 |
name: "&&" |
| 33 |
param { |
| 34 |
type: OPERATOR |
| 35 |
operator { |
| 36 |
name: ">" |
| 37 |
param { |
| 38 |
type: IDENT |
| 39 |
identifier { |
| 40 |
name: "bla" |
| 41 |
} |
| 42 |
} |
| 43 |
param { |
| 44 |
type: LITERAL |
| 45 |
literal { |
| 46 |
type: V_DOUBLE |
| 47 |
v_double: 100.0 |
| 48 |
} |
| 49 |
} |
| 50 |
} |
| 51 |
} |
| 52 |
param { |
| 53 |
type: OPERATOR |
| 54 |
operator { |
| 55 |
name: "==" |
| 56 |
param { |
| 57 |
type: IDENT |
| 58 |
identifier { |
| 59 |
document_path { |
| 60 |
type: MEMBER |
| 61 |
value: "color" |
| 62 |
} |
| 63 |
name: "info" |
| 64 |
} |
| 65 |
} |
| 66 |
param { |
| 67 |
type: LITERAL |
| 68 |
literal { |
| 69 |
type: V_OCTETS |
| 70 |
v_octets {value:"red"} |
| 71 |
} |
| 72 |
} |
| 73 |
} |
| 74 |
} |
| 75 |
} |
| 76 |
} |
| 77 |
} |
| 78 |
|
| 79 |
## expect Mysqlx.Error |
| 80 |
-->recv |
| 81 |
Mysqlx.Crud.Delete { |
| 82 |
collection { |
| 83 |
name: "mytable" |
| 84 |
schema: "xtest" |
| 85 |
} |
| 86 |
data_model: TABLE |
| 87 |
criteria { |
| 88 |
type: OPERATOR |
| 89 |
operator { |
| 90 |
name: "==" |
| 91 |
param { |
| 92 |
type: IDENT |
| 93 |
identifier { |
| 94 |
document_path { |
| 95 |
type: MEMBER |
| 96 |
value: "bogus" |
| 97 |
} |
| 98 |
name: "info" |
| 99 |
} |
| 100 |
} |
| 101 |
param { |
| 102 |
type: LITERAL |
| 103 |
literal { |
| 104 |
type: V_OCTETS |
| 105 |
v_octets {value:"red"} |
| 106 |
} |
| 107 |
} |
| 108 |
} |
| 109 |
} |
| 110 |
} |
| 111 |
|
| 112 |
## expect Mysqlx.Sql.StmtExecuteOk |
| 113 |
-->recvresult |
| 114 |
EOF |
| 115 |
|
| 116 |
--exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/delete_del_table_doc.xpl 2>&1 |
| 117 |
|
| 118 |
## Cleanup |
| 119 |
--source ../include/xplugin_cleanup.inc |