| 1 |
## Validate a collection definition by creating collection index |
| 2 |
# with various form of document members |
| 3 |
|
| 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/admin_list_objects_docpath.xpl |
| 10 |
--write_file $xtest_file |
| 11 |
-->quiet |
| 12 |
## Test data |
| 13 |
-->macro Create_index %MEMBER% |
| 14 |
-->title =Member: %MEMBER% |
| 15 |
-->stmtadmin create_collection_index {"schema":"xtest", "collection":"books", "name": "index", "unique": true, "fields":{"field": "%MEMBER%", "type": "text(20)", "required": false}} |
| 16 |
-->recvresult be-quiet |
| 17 |
-->endmacro |
| 18 |
|
| 19 |
-->macro Correct_path_to_member %MEMBER% |
| 20 |
-->callmacro Create_index %MEMBER% |
| 21 |
-->stmtadmin list_objects {"schema":"xtest"} |
| 22 |
-->recvtovar %TYPE% type |
| 23 |
-->assert_eq COLLECTION %TYPE% |
| 24 |
-->stmtsql select generation_expression from information_schema.columns where column_name like '$%' |
| 25 |
-->recvresult |
| 26 |
-->stmtadmin drop_collection_index {"schema":"xtest", "collection":"books", "name": "index"} |
| 27 |
-->recvresult be-quiet |
| 28 |
-->endmacro |
| 29 |
|
| 30 |
-->macro Incorrect_path_to_member %MEMBER% |
| 31 |
-->expecterror ER_X_CMD_ARGUMENT_VALUE |
| 32 |
-->callmacro Create_index %MEMBER% |
| 33 |
-->endmacro |
| 34 |
|
| 35 |
|
| 36 |
-->stmtadmin create_collection {"schema":"xtest", "name":"books"} |
| 37 |
-->recvresult |
| 38 |
|
| 39 |
-->callmacro Correct_path_to_member $ |
| 40 |
-->callmacro Correct_path_to_member $.path |
| 41 |
-->callmacro Correct_path_to_member $.path.to.member |
| 42 |
-->callmacro Correct_path_to_member $.p1ath |
| 43 |
-->callmacro Correct_path_to_member $.path1 |
| 44 |
-->callmacro Correct_path_to_member $.$ |
| 45 |
-->callmacro Correct_path_to_member $.$$ |
| 46 |
-->callmacro Correct_path_to_member $.$$$ |
| 47 |
-->callmacro Correct_path_to_member $.$.path |
| 48 |
-->callmacro Correct_path_to_member $.path.$ |
| 49 |
-->callmacro Correct_path_to_member $.$path |
| 50 |
-->callmacro Correct_path_to_member $.pa$th |
| 51 |
-->callmacro Correct_path_to_member $.path$ |
| 52 |
-->callmacro Correct_path_to_member $.$pa$th$ |
| 53 |
-->callmacro Correct_path_to_member $._ |
| 54 |
-->callmacro Correct_path_to_member $.__ |
| 55 |
-->callmacro Correct_path_to_member $.___ |
| 56 |
-->callmacro Correct_path_to_member $._.path |
| 57 |
-->callmacro Correct_path_to_member $.path._ |
| 58 |
-->callmacro Correct_path_to_member $._path |
| 59 |
-->callmacro Correct_path_to_member $.pa_th |
| 60 |
-->callmacro Correct_path_to_member $.path_ |
| 61 |
-->callmacro Correct_path_to_member $._pa_th_ |
| 62 |
-->callmacro Correct_path_to_member $.* |
| 63 |
-->callmacro Correct_path_to_member $.*.path |
| 64 |
-->callmacro Correct_path_to_member $.path.* |
| 65 |
-->callmacro Correct_path_to_member $.path[1] |
| 66 |
-->callmacro Correct_path_to_member $.path[123] |
| 67 |
-->callmacro Correct_path_to_member $.path[1].path[2] |
| 68 |
-->callmacro Correct_path_to_member $.path[1].path |
| 69 |
-->callmacro Correct_path_to_member $.path[1].* |
| 70 |
-->callmacro Correct_path_to_member $.*.path[1] |
| 71 |
-->callmacro Correct_path_to_member $.path[*] |
| 72 |
-->callmacro Correct_path_to_member $[1] |
| 73 |
-->callmacro Correct_path_to_member $[1][2] |
| 74 |
-->callmacro Correct_path_to_member $[1].path[2] |
| 75 |
-->callmacro Correct_path_to_member $[1][2].path |
| 76 |
-->callmacro Correct_path_to_member $.path[1][2] |
| 77 |
-->callmacro Correct_path_to_member $.\"pa th\" |
| 78 |
-->callmacro Correct_path_to_member $.\"pa\tth\" |
| 79 |
-->callmacro Correct_path_to_member $.\"\"\" |
| 80 |
-->callmacro Correct_path_to_member $.\"\"path\" |
| 81 |
-->callmacro Correct_path_to_member $.\"path\"\" |
| 82 |
-->callmacro Correct_path_to_member $.\"#\" |
| 83 |
-->callmacro Correct_path_to_member $.\"path#\" |
| 84 |
-->callmacro Correct_path_to_member $.\"#path\" |
| 85 |
-->callmacro Correct_path_to_member $.\"#\"[1] |
| 86 |
-->callmacro Correct_path_to_member $.\"\" |
| 87 |
-->callmacro Correct_path_to_member $**.path |
| 88 |
-->callmacro Correct_path_to_member $**[1] |
| 89 |
-->callmacro Correct_path_to_member $.path**.path |
| 90 |
-->callmacro Correct_path_to_member $.path**[1] |
| 91 |
-->callmacro Correct_path_to_member $[1]**.path |
| 92 |
-->callmacro Correct_path_to_member $[1]**[1] |
| 93 |
-->callmacro Correct_path_to_member $.***.path |
| 94 |
-->callmacro Correct_path_to_member $.\"**\" |
| 95 |
-->callmacro Correct_path_to_member $.\"***\" |
| 96 |
-->callmacro Correct_path_to_member $.\"pa.th\" |
| 97 |
|
| 98 |
-->callmacro Incorrect_path_to_member $. |
| 99 |
-->callmacro Incorrect_path_to_member .path |
| 100 |
-->callmacro Incorrect_path_to_member path |
| 101 |
-->callmacro Incorrect_path_to_member $.1 |
| 102 |
-->callmacro Incorrect_path_to_member $.1path |
| 103 |
-->callmacro Incorrect_path_to_member $.** |
| 104 |
-->callmacro Incorrect_path_to_member $.*** |
| 105 |
-->callmacro Incorrect_path_to_member $.*path |
| 106 |
-->callmacro Incorrect_path_to_member $.pa*th |
| 107 |
-->callmacro Incorrect_path_to_member $.path* |
| 108 |
-->callmacro Incorrect_path_to_member $.*pa*th* |
| 109 |
-->callmacro Incorrect_path_to_member $.path[-1] |
| 110 |
-->callmacro Incorrect_path_to_member $.path[a] |
| 111 |
-->callmacro Incorrect_path_to_member $.path[] |
| 112 |
-->callmacro Incorrect_path_to_member $.path[ |
| 113 |
-->callmacro Incorrect_path_to_member $.path] |
| 114 |
-->callmacro Incorrect_path_to_member $.[path] |
| 115 |
-->callmacro Incorrect_path_to_member $.[1] |
| 116 |
-->callmacro Incorrect_path_to_member $.path[**] |
| 117 |
-->callmacro Incorrect_path_to_member $.path[*1] |
| 118 |
-->callmacro Incorrect_path_to_member $.path[1*] |
| 119 |
-->callmacro Incorrect_path_to_member $.path[1*1] |
| 120 |
-->callmacro Incorrect_path_to_member $.pa th |
| 121 |
-->callmacro Incorrect_path_to_member $.pa\th |
| 122 |
-->callmacro Incorrect_path_to_member $.\" |
| 123 |
-->callmacro Incorrect_path_to_member $.\"path |
| 124 |
-->callmacro Incorrect_path_to_member $.path\" |
| 125 |
-->callmacro Incorrect_path_to_member $.# |
| 126 |
-->callmacro Incorrect_path_to_member $.path# |
| 127 |
-->callmacro Incorrect_path_to_member $.#path |
| 128 |
-->callmacro Incorrect_path_to_member $** |
| 129 |
-->callmacro Incorrect_path_to_member $.path** |
| 130 |
-->callmacro Incorrect_path_to_member $[1]** |
| 131 |
-->callmacro Incorrect_path_to_member $*** |
| 132 |
-->callmacro Incorrect_path_to_member $.path*** |
| 133 |
-->callmacro Incorrect_path_to_member $[1]*** |
| 134 |
-->callmacro Incorrect_path_to_member $.**.path |
| 135 |
-->callmacro Incorrect_path_to_member $* |
| 136 |
EOF |
| 137 |
|
| 138 |
|
| 139 |
CREATE SCHEMA xtest DEFAULT CHARSET 'utf8mb4'; |
| 140 |
|
| 141 |
exec $MYSQLXTEST |
| 142 |
-ux_root |
| 143 |
--password='' |
| 144 |
--file=$xtest_file 2>&1; |
| 145 |
|
| 146 |
## Cleanup |
| 147 |
--source ../include/xplugin_cleanup.inc |