You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.3 KiB
79 lines
2.3 KiB
--echo # Bug #22477433: TABLE WITH UNKNOWN COLLATION CRASHES MYSQL
|
|
--echo #
|
|
--echo # Create a table with a certain collation. Restart
|
|
--echo # the server with a new --character-sets-dir where
|
|
--echo # the collation is not supported. Verify that we
|
|
--echo # can do DROP and RENAME TABLE, and that CHECK TABLE
|
|
--echo # will report a warning.
|
|
|
|
|
|
--echo #
|
|
--echo # New character sets dir:
|
|
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
|
|
SHOW VARIABLES LIKE 'character_sets_dir%';
|
|
|
|
--echo #
|
|
--echo # Show new collation available in the new character sets dir:
|
|
SHOW COLLATION LIKE 'utf8_phone_ci';
|
|
|
|
--echo #
|
|
--echo # Create two tables using the new collation:
|
|
CREATE TABLE t1 (i INTEGER, a VARCHAR(10) COLLATE utf8_phone_ci) COLLATE utf8_phone_ci;
|
|
CREATE TABLE t2 (i INTEGER, a VARCHAR(10) COLLATE utf8_phone_ci) COLLATE utf8_phone_ci;
|
|
|
|
--echo #
|
|
--echo # Restart server with original character sets dir:
|
|
--let $restart_parameters=restart:--character-sets-dir=$MYSQL_CHARSETSDIR
|
|
--replace_result $MYSQL_CHARSETSDIR MYSQL_CHARSETSDIR
|
|
--source include/restart_mysqld.inc
|
|
|
|
--let $old_log_error_verbosity = `select @@global.log_error_verbosity`
|
|
SET @@global.log_error_verbosity = 1;
|
|
|
|
--echo #
|
|
--echo # Reverted to old character sets dir:
|
|
--replace_result $MYSQL_CHARSETSDIR MYSQL_CHARSETSDIR
|
|
SHOW VARIABLES LIKE 'character_sets_dir%';
|
|
|
|
--echo #
|
|
--echo # The newly added collation has been deleted:
|
|
SHOW COLLATION LIKE 'utf8_phone_ci';
|
|
|
|
--echo #
|
|
--echo # Check behavior of CHECK TABLE (succeed, but report error):
|
|
CHECK TABLE t1;
|
|
|
|
--echo #
|
|
--echo # Check behavior of RENAME TABLE (succeed):
|
|
RENAME TABLE t1 TO t1_new;
|
|
RENAME TABLE t1_new TO t1;
|
|
|
|
--echo #
|
|
--echo # Check behavior of ALTER TABLE w. COPY (fail):
|
|
--error ER_UNKNOWN_COLLATION
|
|
ALTER TABLE t1 ADD COLUMN (j INTEGER);
|
|
|
|
--echo #
|
|
--echo # Check behavior of SELECT (fail):
|
|
--error ER_UNKNOWN_COLLATION
|
|
SELECT * FROM t1;
|
|
|
|
--echo #
|
|
--echo # Check behavior of INSERT (fail):
|
|
--error ER_UNKNOWN_COLLATION
|
|
INSERT INTO t1 VALUES (1);
|
|
|
|
--echo #
|
|
--echo # Check behavior of SHOW CREATE (fail):
|
|
--error ER_UNKNOWN_COLLATION
|
|
SHOW CREATE TABLE t1;
|
|
|
|
--echo #
|
|
--echo # Check behavior of DROP TABLE (succeed):
|
|
# Note that we introduce the table t2 for this purpose since
|
|
# dropping t1 is likely to succeed anyway since the table is
|
|
# cached in innodb after being renamed.
|
|
DROP TABLE t1;
|
|
DROP TABLE t2;
|
|
|
|
--eval SET @@global.log_error_verbosity= $old_log_error_verbosity
|
|
|