| 1 |
## Asterisk operator vs. literal |
| 2 |
|
| 3 |
## Preamble |
| 4 |
--source include/xplugin_preamble.inc |
| 5 |
--source include/xplugin_create_user.inc |
| 6 |
|
| 7 |
## Test data |
| 8 |
CREATE SCHEMA xtest; |
| 9 |
USE xtest; |
| 10 |
CREATE TABLE xtable (phrase VARCHAR(30)); |
| 11 |
INSERT INTO xtable (phrase) VALUES ('Alice has a cat'); |
| 12 |
|
| 13 |
## Test starts here |
| 14 |
--write_file $MYSQL_TMP_DIR/crud_asterisk.xpl |
| 15 |
|
| 16 |
Mysqlx.Crud.Find { |
| 17 |
collection { name: "xtable" schema: "xtest" } |
| 18 |
data_model: TABLE |
| 19 |
projection { |
| 20 |
source { |
| 21 |
type: FUNC_CALL |
| 22 |
function_call { |
| 23 |
name { |
| 24 |
name: "count" |
| 25 |
} |
| 26 |
param { |
| 27 |
type: LITERAL |
| 28 |
literal { |
| 29 |
type: V_OCTETS |
| 30 |
v_octets {value: "*"} |
| 31 |
} |
| 32 |
} |
| 33 |
} |
| 34 |
} |
| 35 |
} |
| 36 |
} |
| 37 |
-->recvresult |
| 38 |
|
| 39 |
|
| 40 |
Mysqlx.Crud.Find { |
| 41 |
collection { name: "xtable" schema: "xtest" } |
| 42 |
data_model: TABLE |
| 43 |
projection { |
| 44 |
source { |
| 45 |
type: FUNC_CALL |
| 46 |
function_call { |
| 47 |
name { |
| 48 |
name: "count" |
| 49 |
} |
| 50 |
param { |
| 51 |
type: OPERATOR operator { |
| 52 |
name: "*" |
| 53 |
} |
| 54 |
} |
| 55 |
} |
| 56 |
} |
| 57 |
} |
| 58 |
} |
| 59 |
-->recvresult |
| 60 |
|
| 61 |
Mysqlx.Crud.Find { |
| 62 |
collection { name: "xtable" schema: "xtest" } |
| 63 |
data_model: TABLE |
| 64 |
projection { |
| 65 |
source { |
| 66 |
type: LITERAL literal { |
| 67 |
type: V_OCTETS |
| 68 |
v_octets {value:"*"} |
| 69 |
} |
| 70 |
} |
| 71 |
} |
| 72 |
} |
| 73 |
-->recvresult |
| 74 |
|
| 75 |
Mysqlx.Crud.Find { |
| 76 |
collection { name: "xtable" schema: "xtest" } |
| 77 |
data_model: TABLE |
| 78 |
projection { |
| 79 |
source { |
| 80 |
type: OPERATOR operator { |
| 81 |
name: "*" |
| 82 |
} |
| 83 |
} |
| 84 |
} |
| 85 |
} |
| 86 |
-->recvresult |
| 87 |
EOF |
| 88 |
|
| 89 |
--exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/crud_asterisk.xpl 2>&1 |
| 90 |
|
| 91 |
## Cleanup |
| 92 |
--source ../include/xplugin_cleanup.inc |