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