| 1 |
CREATE SCHEMA xtest; |
| 2 |
CREATE USER test_user@localhost; |
| 3 |
|
| 4 |
|
| 5 |
## I. Check invalid option setting for get_collection_options command. |
| 6 |
# |
| 7 |
# 1. Check just an invalid option. |
| 8 |
# 2. Check both valid and invalid options. |
| 9 |
|
| 10 |
## II. Check get_collection_options when used for not existing schema. |
| 11 |
|
| 12 |
## III. Check get_collection_options that returns a validation. |
| 13 |
# |
| 14 |
# 1. Get default validation schema. |
| 15 |
# 2. Get custom validation schema. |
| 16 |
# 3. Get custom validation schema and non-default validation level. |
| 17 |
# 4. Check command that returns string with special characters. |
| 18 |
|
| 19 |
## IV. Get option for a collection user has no access to. |
| 20 |
# |
| 21 |
# 1. Collection does not exist. |
| 22 |
# 2. Collection exists. |
| 23 |
|
| 24 |
## V. Check Mysqlx_stmt_get_collection_options variable. |
| 25 |
|
| 26 |
# |
| 27 |
# I.1 |
| 28 |
Got expected error: Requested collection option 'foo' doesn't exist. (code 5181) |
| 29 |
|
| 30 |
# |
| 31 |
# I.2 |
| 32 |
Got expected error: Requested collection option 'foo' doesn't exist. (code 5181) |
| 33 |
# I.3 |
| 34 |
Got expected error: Invalid value for argument 'options' (code 5017) |
| 35 |
# I.4 |
| 36 |
Got expected error: Invalid value for argument 'options[0]' (code 5017) |
| 37 |
# I.5 |
| 38 |
Got expected error: Invalid value for argument 'options[0]' (code 5017) |
| 39 |
|
| 40 |
# |
| 41 |
# II |
| 42 |
Got expected error: Table 'xtest.test_coll' doesn't exist (code 1146) |
| 43 |
|
| 44 |
# |
| 45 |
# III.1 |
| 46 |
|
| 47 |
command ok |
| 48 |
Result |
| 49 |
{ "validation": { "level": "off", "schema": {"type":"object"} } } |
| 50 |
command ok |
| 51 |
RUN DROP TABLE IF EXISTS xtest.test_coll |
| 52 |
|
| 53 |
0 rows affected |
| 54 |
|
| 55 |
# |
| 56 |
# III.2 |
| 57 |
|
| 58 |
command ok |
| 59 |
Result |
| 60 |
{ "validation": { "level": "strict", "schema": {"description":"test"} } } |
| 61 |
command ok |
| 62 |
RUN DROP TABLE IF EXISTS xtest.test_coll |
| 63 |
|
| 64 |
0 rows affected |
| 65 |
|
| 66 |
# |
| 67 |
# III.3 |
| 68 |
|
| 69 |
command ok |
| 70 |
Result |
| 71 |
{ "validation": { "level": "off", "schema": {"description":"test"} } } |
| 72 |
command ok |
| 73 |
RUN DROP TABLE IF EXISTS xtest.test_coll |
| 74 |
|
| 75 |
0 rows affected |
| 76 |
|
| 77 |
# |
| 78 |
# III.4 |
| 79 |
|
| 80 |
command ok |
| 81 |
Result |
| 82 |
{ "validation": { "level": "strict", "schema": {"description":"t`y\\\\p"e o`b`\\\\\\\\c""t"} } } |
| 83 |
command ok |
| 84 |
RUN DROP TABLE IF EXISTS xtest.test_coll |
| 85 |
|
| 86 |
0 rows affected |
| 87 |
|
| 88 |
# |
| 89 |
# IV.1 |
| 90 |
connecting... |
| 91 |
active session is now 'temp' |
| 92 |
Got expected error: SELECT command denied to user 'test_user'@'localhost' for table 'test_coll' (code 1142) |
| 93 |
closing session temp |
| 94 |
Mysqlx.Ok { |
| 95 |
msg: "bye!" |
| 96 |
} |
| 97 |
switched to session default |
| 98 |
|
| 99 |
# |
| 100 |
# IV.2 |
| 101 |
|
| 102 |
command ok |
| 103 |
connecting... |
| 104 |
active session is now 'temp' |
| 105 |
Got expected error: SELECT command denied to user 'test_user'@'localhost' for table 'test_coll' (code 1142) |
| 106 |
closing session temp |
| 107 |
Mysqlx.Ok { |
| 108 |
msg: "bye!" |
| 109 |
} |
| 110 |
switched to session default |
| 111 |
RUN DROP TABLE IF EXISTS xtest.test_coll |
| 112 |
|
| 113 |
0 rows affected |
| 114 |
|
| 115 |
# |
| 116 |
# V |
| 117 |
connecting... |
| 118 |
active session is now 'temp' |
| 119 |
|
| 120 |
command ok |
| 121 |
Verify [Status variable "Mysqlx_stmt_get_collection_options" needs to have a value of 0] |
| 122 |
Result |
| 123 |
{ "validation": { "level": "off", "schema": {"type":"object"} } } |
| 124 |
command ok |
| 125 |
Verify [Status variable "Mysqlx_stmt_get_collection_options" needs to have a value of 1] |
| 126 |
Got expected error: |
| 127 |
Mysqlx.Error { |
| 128 |
severity: ERROR |
| 129 |
code: 5181 |
| 130 |
msg: "Requested collection option \'foo\' doesn\'t exist." |
| 131 |
sql_state: "HY000" |
| 132 |
} |
| 133 |
|
| 134 |
Verify [Status variable "Mysqlx_stmt_get_collection_options" needs to have a value of 2] |
| 135 |
Result |
| 136 |
{ "validation": { "level": "off", "schema": {"type":"object"} } } |
| 137 |
command ok |
| 138 |
Verify [Status variable "Mysqlx_stmt_get_collection_options" needs to have a value of 3] |
| 139 |
|
| 140 |
0 rows affected |
| 141 |
closing session temp |
| 142 |
Mysqlx.Ok { |
| 143 |
msg: "bye!" |
| 144 |
} |
| 145 |
switched to session default |
| 146 |
Mysqlx.Ok { |
| 147 |
msg: "bye!" |
| 148 |
} |
| 149 |
ok |
| 150 |
DROP USER test_user@localhost; |