| 1 |
## Tests related to overlaps operator |
| 2 |
|
| 3 |
## Preamble |
| 4 |
--source include/xplugin_preamble.inc |
| 5 |
--source include/xplugin_create_user.inc |
| 6 |
|
| 7 |
|
| 8 |
## Test starts here |
| 9 |
--let $xtest_file= $MYSQL_TMP_DIR/crud_overlaps_expr_tab.xpl |
| 10 |
--write_file $xtest_file |
| 11 |
-->quiet |
| 12 |
|
| 13 |
-->title =1. Looking up for some overlaps |
| 14 |
CREATE TABLE xtest.xtable (`overlaps` JSON, `list` JSON, `Name` varchar(50)); |
| 15 |
INSERT INTO xtest.xtable (overlaps, list, Name) VALUES |
| 16 |
('{"one":1, "two":2, "three":3}', '{"one":1,"two":2, "three":3}', 'one'), |
| 17 |
('{"one":1, "two":2, "three":3}', '{"four":4, "five":5, "six":6}', 'two'), |
| 18 |
('{"one":1, "three":3, "five":5}', '{"two":2, "four":4, "six":6}', 'three'), |
| 19 |
('{"one":1, "three":3, "five":5}', '{"three":3, "six":9, "nine":9}', 'four'), |
| 20 |
('{"one":1, "three":3, "five":5}', '{"three":6, "six":12, "nine":18}', 'five'), |
| 21 |
('{"one":[1,2,3]}', '{"one":[3,4,5]}', 'six'), |
| 22 |
('{"one":[1,2,3]}', '{"one":[1,2,3]}', 'seven'), |
| 23 |
('[1,2,3]', '[2,3,4]', 'eight'); |
| 24 |
|
| 25 |
Mysqlx.Crud.Find { |
| 26 |
collection { |
| 27 |
name: "xtable" |
| 28 |
schema: "xtest" |
| 29 |
} |
| 30 |
data_model: TABLE |
| 31 |
criteria { |
| 32 |
type: OPERATOR |
| 33 |
operator { |
| 34 |
name: "overlaps" |
| 35 |
param { |
| 36 |
type: IDENT |
| 37 |
identifier { |
| 38 |
name: "overlaps" |
| 39 |
} |
| 40 |
} |
| 41 |
param { |
| 42 |
type: IDENT |
| 43 |
identifier { |
| 44 |
name: "list" |
| 45 |
} |
| 46 |
} |
| 47 |
} |
| 48 |
} |
| 49 |
} |
| 50 |
-->recvresult |
| 51 |
EOF |
| 52 |
|
| 53 |
CREATE SCHEMA xtest; |
| 54 |
|
| 55 |
--exec $MYSQLXTEST -ux_root --password='' --file=$xtest_file 2>&1 |
| 56 |
|
| 57 |
## Cleanup |
| 58 |
--source ../include/xplugin_cleanup.inc |