mariadb/mysql-test/t/renamedb.test
Gleb Shchepa d72a4710aa Bug #53804: serious flaws in the alter database .. upgrade
data directory name command

The check_db_name function has been modified to validate tails of
#mysql50#-prefixed database names for compliance with MySQL 5.0
database name encoding rules (the check_table_name function call
has been reused).


mysql-test/r/renamedb.result:
  Updated test case.
mysql-test/r/upgrade.result:
  Test case for bug #53804.
mysql-test/t/renamedb.test:
  Updated test case.
mysql-test/t/upgrade.test:
  Test case for bug #53804.
sql/mysql_priv.h:
  Bug #53804: serious flaws in the alter database .. upgrade
              data directory name command
  
  The check_mysql50_prefix has been added.
sql/sql_table.cc:
  Bug #53804: serious flaws in the alter database .. upgrade
              data directory name command
  
  - The check_mysql50_prefix has been added.
  - The check_n_cut_mysql50_prefix function has been refactored
  to share code with new check_mysql50_prefix function.
sql/table.cc:
  Bug #53804: serious flaws in the alter database .. upgrade
              data directory name command
  
  The check_db_name function has been modified to validate tails of
  #mysql50#-prefixed database names for compliance with MySQL 5.0
  database name encoding rules.
2010-05-21 22:47:32 +04:00

53 lines
1.2 KiB
Text

# TODO: enable these tests when RENAME DATABASE is implemented.
#
# --disable_warnings
# drop database if exists testdb1;
# --enable_warnings
#
# create database testdb1 default character set latin2;
# use testdb1;
# create table t1 (a int);
# insert into t1 values (1),(2),(3);
# show create database testdb1;
# show tables;
# rename database testdb1 to testdb2;
# --error 1049
# show create database testdb1;
# show create database testdb2;
# select database();
# show tables;
# select a from t1 order by a;
# drop database testdb2;
#
#
# Bug#19392 Rename Database: Crash if case change
#
# create database testdb1;
# --error 1007
# rename database testdb1 to testdb1;
# drop database testdb1;
#
# WL#4030 (Deprecate RENAME DATABASE: replace with ALTER DATABASE <name> UPGRADE)
#
--error ER_PARSE_ERROR
rename database testdb1 to testdb2;
--error ER_WRONG_USAGE
ALTER DATABASE wrong UPGRADE DATA DIRECTORY NAME;
--error ER_WRONG_USAGE
ALTER DATABASE `#mysql41#not-supported` UPGRADE DATA DIRECTORY NAME;
--error ER_WRONG_USAGE
ALTER DATABASE `#mysql51#not-yet` UPGRADE DATA DIRECTORY NAME;
--error ER_WRONG_DB_NAME
ALTER DATABASE `#mysql50#` UPGRADE DATA DIRECTORY NAME;
--error ER_BAD_DB_ERROR
ALTER DATABASE `#mysql50#upgrade-me` UPGRADE DATA DIRECTORY NAME;