| 1 |
## Test of general functionality of get_collection_options admin command. |
| 2 |
|
| 3 |
## Preamble |
| 4 |
--source include/xplugin_preamble.inc |
| 5 |
--source include/xplugin_create_user.inc |
| 6 |
## Test starts here |
| 7 |
|
| 8 |
--write_file $MYSQL_TMP_DIR/resultset.xpl |
| 9 |
-->import assert_messages.macro |
| 10 |
-->import assert_notices.macro |
| 11 |
-->import validation_schema.macro |
| 12 |
|
| 13 |
varlet %SCHEMA% {"type": "object", "properties": |
| 14 |
{"latitude": {"type": "number", "minimum": -90, "maximum": 90}}, |
| 15 |
"required": ["latitude"]}; |
| 16 |
|
| 17 |
-->echo |
| 18 |
-->echo |
| 19 |
-->echo ## I. Check command flow when using a get_collection_options admin |
| 20 |
-->echo ## command. |
| 21 |
-->echo # |
| 22 |
-->echo # 1. Check flow of get_collection_options command when used with |
| 23 |
-->echo # an invalid option. |
| 24 |
-->echo # 2. Check flow of get_collection_options command when used with |
| 25 |
-->echo # a validation option. |
| 26 |
|
| 27 |
-->echo |
| 28 |
-->echo # |
| 29 |
-->echo # I.1 |
| 30 |
stmtadmin get_collection_options { |
| 31 |
"schema": "xtest", |
| 32 |
"name": "test_coll", |
| 33 |
"options": ["foo"] |
| 34 |
}; |
| 35 |
-->callmacro Assert_message Mysqlx.Error |
| 36 |
|
| 37 |
-->echo |
| 38 |
-->echo # |
| 39 |
-->echo # I.2 |
| 40 |
stmtadmin create_collection {"schema": "xtest", "name": "test_coll", "options": { |
| 41 |
"validation": { |
| 42 |
"schema": %SCHEMA% |
| 43 |
} |
| 44 |
}}; |
| 45 |
-->recvresult |
| 46 |
stmtadmin get_collection_options { |
| 47 |
"schema": "xtest", |
| 48 |
"name": "test_coll", |
| 49 |
"options": ["validation"] |
| 50 |
}; |
| 51 |
-->callmacro Assert_metadata BYTES "Result" |
| 52 |
-->callmacro Assert_rows 1 |
| 53 |
-->callmacro Assert_message Mysqlx.Resultset.FetchDone |
| 54 |
-->callmacro Assert_message Mysqlx.Sql.StmtExecuteOk |
| 55 |
|
| 56 |
EOF |
| 57 |
|
| 58 |
|
| 59 |
CREATE SCHEMA IF NOT EXISTS xtest; |
| 60 |
USE xtest; |
| 61 |
|
| 62 |
exec $MYSQLXTEST |
| 63 |
-ux_root --password='' |
| 64 |
--schema=xtest |
| 65 |
--file=$MYSQL_TMP_DIR/resultset.xpl 2>&1; |
| 66 |
|
| 67 |
## Cleanup |
| 68 |
--source ../include/xplugin_cleanup.inc |