| 1 |
CREATE SCHEMA xtest DEFAULT CHARSET 'utf8mb4'; |
| 2 |
|
| 3 |
command ok |
| 4 |
1 |
| 5 |
|
| 6 |
command ok |
| 7 |
Got expected error (code 0) |
| 8 |
|
| 9 |
1 rows affected |
| 10 |
Got expected error (code 0) |
| 11 |
|
| 12 |
1 rows affected |
| 13 |
Got expected error (code 0) |
| 14 |
|
| 15 |
1 rows affected |
| 16 |
Got expected error (code 0) |
| 17 |
Verify ["EXPLAIN SELECT * FROM xtest.books1 USE INDEX(`isbn`) WHERE doc->'$.isbn' = '9780262527804'" returns in "possible_keys" column, following value isbn] |
| 18 |
Got expected error: Collection contains document missing required field (code 5117) |
| 19 |
|
| 20 |
command ok |
| 21 |
Got expected error (code 0) |
| 22 |
Verify ["EXPLAIN SELECT * FROM xtest.books1 USE INDEX(`pages`) WHERE doc->'$.pages' > 1" returns in "possible_keys" column, following value pages] |
| 23 |
|
| 24 |
command ok |
| 25 |
Got expected error (code 0) |
| 26 |
Verify ["EXPLAIN SELECT * FROM xtest.books1 USE INDEX(`name`) WHERE doc->'$.name' = 'The Bla'" returns in "possible_keys" column, following value name] |
| 27 |
|
| 28 |
command ok |
| 29 |
Got expected error (code 0) |
| 30 |
Verify ["EXPLAIN SELECT * FROM xtest.books1 USE INDEX(`another name`) WHERE doc->'$.name' = 'The Bla'" returns in "possible_keys" column, following value another name] |
| 31 |
|
| 32 |
command ok |
| 33 |
Got expected error (code 0) |
| 34 |
Verify ["EXPLAIN SELECT * FROM xtest.books1 USE INDEX(`name_char`) WHERE doc->'$.name' = 'The Bla'" returns in "possible_keys" column, following value name_char] |
| 35 |
Got expected error: Data too long for column '$ix_c_r_27B323C313AA758D7F01480F94271D0B13D88CE7' at row 1 (code 1406) |
| 36 |
Got expected error: Document is missing a required field (code 5115) |
| 37 |
|
| 38 |
command ok |
| 39 |
Got expected error (code 0) |
| 40 |
|
| 41 |
command ok |
| 42 |
Got expected error (code 0) |
| 43 |
Got expected error: Invalid value for argument 'fields.field' (code 5017) |
| 44 |
Got expected error: Argument value '' for index name is invalid (code 5017) |
| 45 |
Got expected error: Invalid or unsupported type specification 'text(20);drop table' (code 5017) |
| 46 |
Got expected error: Invalid or unsupported type specification 'varchar(20)' (code 5017) |
| 47 |
Got expected error: Invalid value for argument 'fields.field' (code 5017) |
| 48 |
Got expected error: Invalid value for argument 'fields.field' (code 5017) |
| 49 |
Got expected error: Invalid value for argument 'fields.field' (code 5017) |
| 50 |
|
| 51 |
command ok |
| 52 |
|
| 53 |
1 rows affected |
| 54 |
Got expected error (code 0) |
| 55 |
|
| 56 |
1 rows affected |
| 57 |
Got expected error (code 0) |
| 58 |
|
| 59 |
command ok |
| 60 |
Verify ["EXPLAIN SELECT * FROM xtest.books0 USE INDEX(`mix`) WHERE doc->'$.isbn' = '9780262527804' and doc->'$.pages' > 1" returns in "possible_keys" column, following value mix] |
| 61 |
|
| 62 |
command ok |
| 63 |
Got expected error (code 0) |
| 64 |
Verify ["EXPLAIN SELECT * FROM xtest.books0 USE INDEX(`name_charset`) WHERE doc->'$.name' = 'The Bla'" returns in "possible_keys" column, following value name_charset] |
| 65 |
|
| 66 |
command ok |
| 67 |
Got expected error (code 0) |
| 68 |
Verify ["EXPLAIN SELECT * FROM xtest.books0 USE INDEX(`isbn_text_charset`) WHERE doc->'$.isbn' = '9780262527804'" returns in "possible_keys" column, following value isbn_text_charset] |
| 69 |
Table Create Table |
| 70 |
books0 CREATE TABLE `books0` ( |
| 71 |
`doc` json DEFAULT NULL, |
| 72 |
`_id` varbinary(32) GENERATED ALWAYS AS (json_unquote(json_extract(`doc`,_utf8mb4'$._id'))) STORED NOT NULL, |
| 73 |
`_json_schema` json GENERATED ALWAYS AS (_utf8mb4'{"type":"object"}') VIRTUAL, |
| 74 |
`$ix_t80_27B323C313AA758D7F01480F94271D0B13D88CE7` text GENERATED ALWAYS AS (json_unquote(json_extract(`doc`,_utf8mb4'$.isbn'))) VIRTUAL, |
| 75 |
`$ix_i_94F8A4D3704392CE73A5A69F07681271C98C8CB2` int GENERATED ALWAYS AS (json_extract(`doc`,_utf8mb4'$.pages')) VIRTUAL, |
| 76 |
`$ix_c64_r_2BAA686C5604372BA51E965E6346198F5072C3D7` char(64) CHARACTER SET latin1 COLLATE latin1_bin GENERATED ALWAYS AS (json_unquote(json_extract(`doc`,_utf8mb4'$.name'))) VIRTUAL NOT NULL, |
| 77 |
`$ix_t64_r_27B323C313AA758D7F01480F94271D0B13D88CE7` text CHARACTER SET latin1 COLLATE latin1_bin GENERATED ALWAYS AS (json_unquote(json_extract(`doc`,_utf8mb4'$.isbn'))) VIRTUAL NOT NULL, |
| 78 |
PRIMARY KEY (`_id`), |
| 79 |
UNIQUE KEY `name_charset` (`$ix_c64_r_2BAA686C5604372BA51E965E6346198F5072C3D7`), |
| 80 |
UNIQUE KEY `isbn_text_charset` (`$ix_t64_r_27B323C313AA758D7F01480F94271D0B13D88CE7`(64)), |
| 81 |
UNIQUE KEY `mix` (`$ix_t80_27B323C313AA758D7F01480F94271D0B13D88CE7`(80),`$ix_i_94F8A4D3704392CE73A5A69F07681271C98C8CB2`), |
| 82 |
CONSTRAINT `$val_strict_66FE29BD959E94BA4075737F67D513C0C2105309` CHECK (json_schema_valid(`_json_schema`,`doc`)) /*!80016 NOT ENFORCED */ |
| 83 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
| 84 |
0 rows affected |
| 85 |
Mysqlx.Ok { |
| 86 |
msg: "bye!" |
| 87 |
} |
| 88 |
ok |