Debian Codegraph @

mysql-test/suite/x/t/admin_create_collection_reuse_existing.test

raw
1 ## Test create_collection command in context use of reuse_existing option
2
3 ## Preamble
4 --source include/xplugin_preamble.inc
5 --source include/xplugin_create_user.inc
6
7 ## Tests start here
8
9 --write_file $MYSQL_TMP_DIR/admin_create_collection_reuse_existing.xpl
10 -->import admin_stmt.macro
11
12 callmacro Admin_stmt
13 create_collection {"schema":"xtest","name":"coll"}
14 ER_SUCCESS;
15
16 callmacro Admin_stmt
17 create_collection {"schema":"xtest","name":"coll"}
18 ER_TABLE_EXISTS_ERROR;
19
20 callmacro Admin_stmt
21 create_collection {"schema":"xtest","name":"coll","options":{"reuse_existing":false}}
22 ER_TABLE_EXISTS_ERROR;
23
24 callmacro Admin_stmt
25 create_collection {"schema":"xtest","name":"coll","options":{"reuse_existing":true}}
26 ER_SUCCESS;
27
28
29
30 CREATE TABLE xtest.fake_coll (field INT);
31
32 callmacro Admin_stmt
33 create_collection {"schema":"xtest","name":"fake_coll"}
34 ER_TABLE_EXISTS_ERROR;
35
36 callmacro Admin_stmt
37 create_collection {"schema":"xtest","name":"fake_coll","options":{"reuse_existing":false}}
38 ER_TABLE_EXISTS_ERROR;
39
40 callmacro Admin_stmt
41 create_collection {"schema":"xtest","name":"fake_coll","options":{"reuse_existing":true}}
42 ER_X_INVALID_COLLECTION;
43
44 EOF
45
46 CREATE SCHEMA xtest DEFAULT CHARSET 'UTF8MB4';
47
48 exec $MYSQLXTEST -ux_root --password=''
49 --file=$MYSQL_TMP_DIR/admin_create_collection_reuse_existing.xpl 2>&1;
50
51 ## Cleanup
52 --source ../include/xplugin_cleanup.inc