1--echo # Bug #22284224: REWRITE REPOPULATION OF CHARACTER SETS AND COLLATIONS DURING STARTUP
2--echo #
3--echo # Verify that new collations become available in the server
4--echo # after a restart. Verify that previously existing
5--echo # collations are deleted if they are not present in the
6--echo # character sets dir when restarting.
7
8--echo #
9--echo # New character sets dir:
10--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
11SHOW VARIABLES LIKE 'character_sets_dir%';
12
13--echo #
14--echo # Show new collation available in the new character sets dir:
15SHOW COLLATION LIKE 'utf8_phone_ci';
16
17--echo #
18--echo # Create and drop a table using the new collation:
19CREATE TABLE t1 (pk INTEGER) COLLATE utf8_phone_ci;
20SHOW CREATE TABLE t1;
21DROP TABLE t1;
22
23--echo #
24--echo # Restart server with original character sets dir:
25--let $restart_parameters=restart:--character-sets-dir=$MYSQL_CHARSETSDIR
26--replace_result $MYSQL_CHARSETSDIR MYSQL_CHARSETSDIR
27--source include/restart_mysqld.inc
28
29--echo #
30--echo # Reverted to old character sets dir:
31--replace_result $MYSQL_CHARSETSDIR MYSQL_CHARSETSDIR
32SHOW VARIABLES LIKE 'character_sets_dir%';
33
34--echo #
35--echo # The newly added collation has been deleted:
36SHOW COLLATION LIKE 'utf8_phone_ci';
37
38--echo #
39--echo # Create a table using the deleted collation, expected to fail:
40--error ER_UNKNOWN_COLLATION
41CREATE TABLE t1 (pk INTEGER) COLLATE utf8_phone_ci;
42
43# restore default values
44--let $restart_parameters = restart:
45--source include/restart_mysqld.inc
46