| 1 |
## Simple list objects with case sensitive names |
| 2 |
|
| 3 |
## Usage |
| 4 |
# |
| 5 |
#--let $expect_case_sensitive_variant= 0|1|2 |
| 6 |
#--let $expect_table_error= ER_SUCCESS|ER_TABLE_EXISTS_ERROR |
| 7 |
#--let $expect_db_error= ER_SUCCESS|ER_DB_CREATE_EXISTS |
| 8 |
#--source ../include/admin_list_objects_table_names.inc |
| 9 |
--source include/xplugin_create_user.inc |
| 10 |
|
| 11 |
## Test starts here |
| 12 |
--let $xtest_file= $MYSQL_TMP_DIR/admin_list_objects_table_names.xpl |
| 13 |
--write_file $xtest_file |
| 14 |
-->quiet |
| 15 |
## Test data |
| 16 |
|
| 17 |
-->stmtsql SELECT @@lower_case_table_names AS Value; |
| 18 |
-->recvtovar %VALUE% Value |
| 19 |
-->assert_eq %EXPECT_CASE% %VALUE% |
| 20 |
|
| 21 |
-->macro Admin_list_objects_case_sensitive %SCHEMA% %ERROR0% %ERROR1% %ERROR2% %ERROR3% %ERROR4% |
| 22 |
-->title -Creating collection in %SCHEMA% |
| 23 |
-->stmtsql CREATE SCHEMA %SCHEMA% DEFAULT CHARSET 'utf8mb4'; |
| 24 |
-->expecterror %ERROR0% |
| 25 |
-->recvresult |
| 26 |
stmtadmin create_collection {"schema":"%SCHEMA%", "name":"FRUIT", "options": { |
| 27 |
"validation": { |
| 28 |
"schema":{"id":"FRUIT"} |
| 29 |
} |
| 30 |
}}; |
| 31 |
-->expecterror %ERROR1% |
| 32 |
-->recvresult |
| 33 |
stmtadmin create_collection {"schema":"%SCHEMA%", "name":"fruit", "options": { |
| 34 |
"validation": { |
| 35 |
"schema":{"id":"fruit"} |
| 36 |
} |
| 37 |
}}; |
| 38 |
-->expecterror %ERROR2% |
| 39 |
-->recvresult |
| 40 |
stmtadmin create_collection {"schema":"%SCHEMA%", "name":"FrUiT", "options": { |
| 41 |
"validation": { |
| 42 |
"schema":{"id":"FrUiT"} |
| 43 |
} |
| 44 |
}}; |
| 45 |
-->expecterror %ERROR3% |
| 46 |
-->recvresult |
| 47 |
-->stmtadmin create_collection {"schema":"%SCHEMA%", "name":"FRuit"} |
| 48 |
-->expecterror %ERROR4% |
| 49 |
-->recvresult |
| 50 |
-->stmtadmin list_objects {"schema":"%SCHEMA%"} |
| 51 |
-->recvresult |
| 52 |
-->endmacro |
| 53 |
|
| 54 |
-->callmacro Admin_list_objects_case_sensitive XTEST ER_SUCCESS ER_SUCCESS %EXPECT_TABLE_ERROR% %EXPECT_TABLE_ERROR% %EXPECT_TABLE_ERROR% |
| 55 |
-->callmacro Admin_list_objects_case_sensitive xtest %EXPECT_DB_ERROR% %EXPECT_TABLE_ERROR% %EXPECT_TABLE_ERROR% %EXPECT_TABLE_ERROR% %EXPECT_TABLE_ERROR% |
| 56 |
-->callmacro Admin_list_objects_case_sensitive xTeSt %EXPECT_DB_ERROR% %EXPECT_TABLE_ERROR% %EXPECT_TABLE_ERROR% %EXPECT_TABLE_ERROR% %EXPECT_TABLE_ERROR% |
| 57 |
|
| 58 |
-->sql |
| 59 |
DROP SCHEMA IF EXISTS xtest; |
| 60 |
DROP SCHEMA IF EXISTS XTEST; |
| 61 |
DROP SCHEMA IF EXISTS xTeSt; |
| 62 |
-->endsql |
| 63 |
EOF |
| 64 |
|
| 65 |
--replace_regex $result_filter |
| 66 |
exec $MYSQLXTEST |
| 67 |
-v%EXPECT_CASE%=$expect_case_sensitive_variant |
| 68 |
-v%EXPECT_TABLE_ERROR%=$expect_table_error |
| 69 |
-v%EXPECT_DB_ERROR%=$expect_db_error |
| 70 |
-ux_root |
| 71 |
--password='' |
| 72 |
--file=$xtest_file 2>&1; |
| 73 |
|
| 74 |
## Postamble |
| 75 |
--source ../include/xplugin_cleanup.inc |
| 76 |
|