| 1 |
## check some admin comands with --sql-mode=NO_BACKSLASH_ESCAPES |
| 2 |
|
| 3 |
--source include/xplugin_preamble.inc |
| 4 |
--source include/xplugin_create_user.inc |
| 5 |
|
| 6 |
## Test starts here |
| 7 |
--let $xtest_file= $MYSQL_TMP_DIR/admin_list_objects_no_backslash_escapes.xpl |
| 8 |
--write_file $xtest_file |
| 9 |
-->import assert_select.macro |
| 10 |
-->quiet |
| 11 |
## Test data |
| 12 |
|
| 13 |
-->stmtadmin create_collection {"schema":"xtest", "name":"bar"} |
| 14 |
-->recvresult |
| 15 |
|
| 16 |
-->stmtadmin create_collection_index {"schema":"xtest", "collection":"bar", "name": "foo", "unique": true, "constraint":{"member": "$.foo", "type": "int","required": false}} |
| 17 |
-->recvresult |
| 18 |
|
| 19 |
callmacro Assert_select |
| 20 |
Key_name |
| 21 |
foo |
| 22 |
SHOW INDEX FROM xtest.bar WHERE Key_name='foo'; |
| 23 |
|
| 24 |
-->stmtsql SELECT CONCAT_WS(',', @@SQL_MODE, 'NO_BACKSLASH_ESCAPES') |
| 25 |
-->recvtovar %MODES% |
| 26 |
SET SQL_MODE='%MODES%'; |
| 27 |
|
| 28 |
-->stmtadmin list_objects {"schema":"xtest"} |
| 29 |
-->recvtovar %RESULT% type |
| 30 |
-->echo Verify ["list_objects" returns "bar" as a COLLECTION] |
| 31 |
-->assert_eq COLLECTION %RESULT% |
| 32 |
|
| 33 |
-->stmtadmin drop_collection_index {"schema":"xtest", "collection":"bar", "name": "foo"} |
| 34 |
-->recvresult |
| 35 |
|
| 36 |
callmacro Assert_select |
| 37 |
Key_name |
| 38 |
null |
| 39 |
SHOW INDEX FROM xtest.bar WHERE Key_name='foo'; |
| 40 |
|
| 41 |
EOF |
| 42 |
|
| 43 |
CREATE SCHEMA xtest DEFAULT CHARSET 'utf8mb4'; |
| 44 |
|
| 45 |
--exec $MYSQLXTEST -ux_root --password='' --file=$xtest_file 2>&1 |
| 46 |
|
| 47 |
## Cleanup |
| 48 |
--source ../include/xplugin_cleanup.inc |