From d035cc465ec148e510287d757b5fa26ec0da8bbe Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 20 Jul 2006 12:54:01 -0700 Subject: Bug#19939 AUTHORS and CONTRIBUTORS are not reserved keywords. mysql-test/r/keywords.result: Bug#19939 Test for bug mysql-test/t/keywords.test: Bug#19939 Test for bug --- mysql-test/r/keywords.result | 16 ++++++++++++++++ mysql-test/t/keywords.test | 24 ++++++++++++++++++++++++ 2 files changed, 40 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/keywords.result b/mysql-test/r/keywords.result index 88a0ab8abd5..597983dab7e 100644 --- a/mysql-test/r/keywords.result +++ b/mysql-test/r/keywords.result @@ -16,3 +16,19 @@ select events.binlog from events; binlog 1 drop table events; +create procedure p1() +begin +declare n int default 2; +authors: while n > 0 do +set n = n -1; +end while authors; +end| +create procedure p2() +begin +declare n int default 2; +contributors: while n > 0 do +set n = n -1; +end while contributors; +end| +drop procedure p1; +drop procedure p2; diff --git a/mysql-test/t/keywords.test b/mysql-test/t/keywords.test index de0159a950e..1af4a1354be 100644 --- a/mysql-test/t/keywords.test +++ b/mysql-test/t/keywords.test @@ -19,3 +19,27 @@ select events.binlog from events; drop table events; # End of 4.1 tests + +# +# Bug#19939 "AUTHORS is not a keyword" +# +delimiter |; +create procedure p1() +begin + declare n int default 2; + authors: while n > 0 do + set n = n -1; + end while authors; +end| +create procedure p2() +begin + declare n int default 2; + contributors: while n > 0 do + set n = n -1; + end while contributors; +end| +delimiter ;| +drop procedure p1; +drop procedure p2; + +# End of 5.1 tests -- cgit v1.2.1 From 8c8c6ac003ee4cd014b6c80ee912c36528320369 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Jul 2006 14:02:58 -0400 Subject: BUG #21118 "Federated Transaction test needs to have BDB switched to InnoDB" Changed federated_transactions.test to use InnoDB instead of BDB federated_transactions-slave.opt: BitKeeper file /home/patg/mysql-build/mysql-5.1-engines-bug21118/mysql-test/t/federated_transactions-slave.opt federated_transactions.result: BUG #21118 "Federated Transaction test needs to have BDB switched to InnoDB" New test results for InnoDB being remote transactional table federated_transactions.test: BUG #21118 "Federated Transaction test needs to have BDB switched to InnoDB" Changed remote transactional table from BDB to InnoDB mysql-test/t/federated_transactions.test: BUG #21118 "Federated Transaction test needs to have BDB switched to InnoDB" Changed remote transactional table from BDB to InnoDB mysql-test/r/federated_transactions.result: BUG #21118 "Federated Transaction test needs to have BDB switched to InnoDB" New test results for InnoDB being remote transactional table mysql-test/t/federated_transactions-slave.opt: BitKeeper file /home/patg/mysql-build/mysql-5.1-engines-bug21118/mysql-test/t/federated_transactions-slave.opt --- mysql-test/r/federated_transactions.result | 2 +- mysql-test/t/federated_transactions-slave.opt | 1 + mysql-test/t/federated_transactions.test | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 mysql-test/t/federated_transactions-slave.opt (limited to 'mysql-test') diff --git a/mysql-test/r/federated_transactions.result b/mysql-test/r/federated_transactions.result index 403b65b5484..e6714210ded 100644 --- a/mysql-test/r/federated_transactions.result +++ b/mysql-test/r/federated_transactions.result @@ -16,7 +16,7 @@ CREATE TABLE federated.t1 ( `id` int(20) NOT NULL, `name` varchar(32) NOT NULL default '' ) -DEFAULT CHARSET=latin1 ENGINE=BerkeleyDB; +DEFAULT CHARSET=latin1 ENGINE=InnoDB; DROP TABLE IF EXISTS federated.t1; Warnings: Note 1051 Unknown table 't1' diff --git a/mysql-test/t/federated_transactions-slave.opt b/mysql-test/t/federated_transactions-slave.opt new file mode 100644 index 00000000000..627becdbfb5 --- /dev/null +++ b/mysql-test/t/federated_transactions-slave.opt @@ -0,0 +1 @@ +--innodb diff --git a/mysql-test/t/federated_transactions.test b/mysql-test/t/federated_transactions.test index 5095c8ce9c3..128813ed160 100644 --- a/mysql-test/t/federated_transactions.test +++ b/mysql-test/t/federated_transactions.test @@ -1,6 +1,6 @@ # should work with embedded server after mysqltest is fixed -- source include/not_embedded.inc -source include/have_bdb.inc; +#source include/have_innodb.inc; source include/federated.inc; connection slave; @@ -10,7 +10,7 @@ CREATE TABLE federated.t1 ( `id` int(20) NOT NULL, `name` varchar(32) NOT NULL default '' ) - DEFAULT CHARSET=latin1 ENGINE=BerkeleyDB; + DEFAULT CHARSET=latin1 ENGINE=InnoDB; connection master; DROP TABLE IF EXISTS federated.t1; -- cgit v1.2.1 From c91846ecb8928500206f82257246ec8660e6218a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 27 Jul 2006 14:20:25 -0400 Subject: BUG #21118 "Federated Transaction test needs to have BDB switched to InnoDB" recommented the uncommented have_innodb.inc line federated_transactions.test: BUG #21118 "Federated Transaction test needs to have BDB switched to InnoDB" slight ommission fixed mysql-test/t/federated_transactions.test: BUG #21118 "Federated Transaction test needs to have BDB switched to InnoDB" slight ommission fixed --- mysql-test/t/federated_transactions.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'mysql-test') diff --git a/mysql-test/t/federated_transactions.test b/mysql-test/t/federated_transactions.test index 128813ed160..9f3b030f462 100644 --- a/mysql-test/t/federated_transactions.test +++ b/mysql-test/t/federated_transactions.test @@ -1,6 +1,6 @@ # should work with embedded server after mysqltest is fixed -- source include/not_embedded.inc -#source include/have_innodb.inc; +source include/have_innodb.inc; source include/federated.inc; connection slave; -- cgit v1.2.1 From 4cf97d4a3154b86677097a3eed24698ae12ddbbc Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Aug 2006 17:57:06 +0200 Subject: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) The intermediate (not temporary) files of the new table during ALTER TABLE was visible for SHOW TABLES. These intermediate files are copies of the original table with the changes done by ALTER TABLE. After all the data is copied over from the original table, these files are renamed to the original tables file names. So they are not temporary files. They persist after ALTER TABLE, but just with another name. In 5.0 the intermediate files are invisible for SHOW TABLES because all file names beginning with "#sql" were suppressed. This failed since 5.1.6 because even temporary table names were converted when making file names from them. The prefix became converted to "@0023sql". Converting the prefix during SHOW TABLES would suppress the listing of user tables that start with "#sql". The solution of the problem is to continue the implementation of the table name to file name conversion feature. One requirement is to suppress the conversion for temporary table names. This change is straightforward for real temporary tables as there is a function that creates temporary file names. But the generated path names are located in TMPDIR and have no relation to the internal table name. This cannot be used for ALTER TABLE. Its intermediate files need to be in the same directory as the old table files. And it is necessary to be able to deduce the same path from the same table name repeatedly. Consequently the intermediate table files must be handled like normal tables. Their internal names shall start with tmp_file_prefix (#sql) and they shall not be converted like normal table names. I added a flags parameter to all relevant functions that are called from ALTER TABLE. It is used to suppress the conversion for the intermediate table files. The outcome is that the suppression of #sql in SHOW TABLES works again. It does not suppress user tables as these are converted to @0023sql on file level. This patch does also fix ALTER TABLE ... RENAME, which could not rename a table with non-ASCII characters in its name. It does also fix the problem that a user could create a table like `#sql-xxxx-yyyy`, where xxxx is mysqld's pid and yyyy is the thread ID of some other thread, which prevented this thread from running ALTER TABLE. Some of the above problems are mentioned in Bug 1405, which can be closed with this patch. This patch does also contain some minor fixes for other forgotten conversions. Still known problems are reported as bugs 21370, 21373, and 21387. mysql-test/r/alter_table.result: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added test results. mysql-test/r/backup.result: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added test results. mysql-test/r/repair.result: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added test results. mysql-test/t/alter_table.test: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added test cases. mysql-test/t/backup.test: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added test cases. mysql-test/t/repair.test: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added a test case. sql/ha_myisam.cc: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added missing table name mapping calls to backup() and restore(). sql/ha_myisammrg.cc: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added an zero argument for the new 'flags' parameter. sql/ha_ndbcluster.cc: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added an zero argument for the new 'flags' parameter. sql/ha_ndbcluster_binlog.cc: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added an zero argument for the new 'flags' parameter. sql/ha_ndbcluster_binlog.h: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Removed unnecessary check for wrong temp file prefix. sql/mysql_priv.h: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Extended quick_rm_table(), mysql_rename_table(), and build_table_filename() by an flags argument, which can indicate temporary table names that should not be converted. Added symbolic flag values. sql/sql_acl.cc: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added an zero argument for the new 'flags' parameter. sql/sql_base.cc: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Fixed a comment. Added DBUG calls. sql/sql_db.cc: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added an zero argument for the new 'flags' parameter. sql/sql_delete.cc: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added an zero argument for the new 'flags' parameter. sql/sql_insert.cc: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added an zero argument for the new 'flags' parameter. sql/sql_partition.cc: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added an zero argument for the new 'flags' parameter. sql/sql_rename.cc: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added an zero argument for the new 'flags' parameter. sql/sql_show.cc: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Reverted the former fix for this bug. tmp_file_prefix is now used verbatim in the comparison of file names. sql/sql_table.cc: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added a check for a tmp_file_prefix file name to filename_to_tablename(). These names are now accepted without conversion. Extended quick_rm_table(), mysql_rename_table(), and build_table_filename() by an flags argument, which can indicate temporary table names that should not be converted. Removed the table to file name conversion from build_tmptable_filename(). Disabled REPAIR TABLE ... USE_FRM for temporary tables. Added the forgotten conversion to mysql_alter_table() for the case of ALTER TABLE ... RENAME. Added comments and DBUG calls. sql/sql_trigger.cc: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added an zero argument for the new 'flags' parameter. sql/sql_view.cc: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Added an zero argument for the new 'flags' parameter. sql/table.cc: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Replaced a literal ".frm" by reg_ext. Added DBUG calls. storage/innobase/row/row0mysql.c: Bug#18775 - Temporary table from alter table visible to other threads Continued implementation of WL#1324 (table name to filename encoding) Changed back the encoded temp file prefix to #sql. --- mysql-test/r/alter_table.result | 60 +++++++++++++++++++++++++++++++++++++++ mysql-test/r/backup.result | 20 +++++++++++++ mysql-test/r/repair.result | 6 ++++ mysql-test/t/alter_table.test | 63 +++++++++++++++++++++++++++++++++++++++++ mysql-test/t/backup.test | 19 +++++++++++++ mysql-test/t/repair.test | 13 +++++++++ 6 files changed, 181 insertions(+) (limited to 'mysql-test') diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index f4332ea9888..3095d5337ed 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -657,3 +657,63 @@ SELECT * FROM t1; v b abc 5 DROP TABLE t1; +DROP DATABASE IF EXISTS mysqltest; +CREATE DATABASE mysqltest; +use mysqltest; +DROP TABLE IF EXISTS `t1_nägel`, `t1_blüten`; +CREATE TABLE `t1_nägel` (c1 INT); +ALTER TABLE `t1_nägel` RENAME `t1_blüten`; +CREATE TABLE `t1_nägel` (c1 INT); +ALTER TABLE `t1_nägel` RENAME `t1_blüten`; +ERROR 42S01: Table 't1_blЭten' already exists +DROP TABLE `t1_nägel`, `t1_blüten`; +CREATE TEMPORARY TABLE `tt1_nägel` (c1 INT); +ALTER TABLE `tt1_nägel` RENAME `tt1_blüten`; +CREATE TEMPORARY TABLE `tt1_nägel` (c1 INT); +ALTER TABLE `tt1_nägel` RENAME `tt1_blüten`; +ERROR 42S01: Table 'tt1_blЭten' already exists +SHOW CREATE TABLE `tt1_blüten`; +Table Create Table +tt1_blüten CREATE TEMPORARY TABLE `tt1_blüten` ( + `c1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE `tt1_nägel`, `tt1_blüten`; +CREATE TABLE `#sql1` (c1 INT); +CREATE TABLE `@0023sql2` (c1 INT); +SHOW TABLES; +Tables_in_mysqltest +#sql1 +@0023sql2 +RENAME TABLE `#sql1` TO `@0023sql1`; +RENAME TABLE `@0023sql2` TO `#sql2`; +SHOW TABLES; +Tables_in_mysqltest +#sql2 +@0023sql1 +ALTER TABLE `@0023sql1` RENAME `#sql-1`; +ALTER TABLE `#sql2` RENAME `@0023sql-2`; +SHOW TABLES; +Tables_in_mysqltest +#sql-1 +@0023sql-2 +INSERT INTO `#sql-1` VALUES (1); +INSERT INTO `@0023sql-2` VALUES (2); +DROP TABLE `#sql-1`, `@0023sql-2`; +CREATE TEMPORARY TABLE `#sql1` (c1 INT); +CREATE TEMPORARY TABLE `@0023sql2` (c1 INT); +SHOW TABLES; +Tables_in_mysqltest +ALTER TABLE `#sql1` RENAME `@0023sql1`; +ALTER TABLE `@0023sql2` RENAME `#sql2`; +SHOW TABLES; +Tables_in_mysqltest +INSERT INTO `#sql2` VALUES (1); +INSERT INTO `@0023sql1` VALUES (2); +SHOW CREATE TABLE `@0023sql1`; +Table Create Table +@0023sql1 CREATE TEMPORARY TABLE `@0023sql1` ( + `c1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +DROP TABLE `#sql2`, `@0023sql1`; +use test; +DROP DATABASE mysqltest; diff --git a/mysql-test/r/backup.result b/mysql-test/r/backup.result index a65808bbdd6..05761240ca7 100644 --- a/mysql-test/r/backup.result +++ b/mysql-test/r/backup.result @@ -101,3 +101,23 @@ test.t5 backup status OK Warnings: Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. drop table t5; +DROP TABLE IF EXISTS `t-blüten`; +CREATE TABLE `t-blüten` (c1 INT); +INSERT INTO `t-blüten` VALUES (1), (2), (3); +BACKUP TABLE `t-blüten` TO '../tmp'; +Table Op Msg_type Msg_text +test.t-blüten backup status OK +Warnings: +Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. +DROP TABLE `t-blüten`; +RESTORE TABLE `t-blüten` FROM '../tmp'; +Table Op Msg_type Msg_text +test.t-blüten restore status OK +Warnings: +Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. +SELECT * FROM `t-blüten`; +c1 +1 +2 +3 +DROP TABLE `t-blüten`; diff --git a/mysql-test/r/repair.result b/mysql-test/r/repair.result index d8fa4dbbb72..f08dc6a8a4a 100644 --- a/mysql-test/r/repair.result +++ b/mysql-test/r/repair.result @@ -41,3 +41,9 @@ Table Op Msg_type Msg_text test.t1 repair warning Number of rows changed from 0 to 1 test.t1 repair status OK drop table t1; +DROP TABLE IF EXISTS tt1; +CREATE TEMPORARY TABLE tt1 (c1 INT); +REPAIR TABLE tt1 USE_FRM; +Table Op Msg_type Msg_text +tt1 repair error Cannot repair temporary table from .frm file +DROP TABLE tt1; diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index efe58579785..f6af92e0044 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -482,3 +482,66 @@ SELECT * FROM t1; ALTER TABLE t1 MODIFY COLUMN v VARCHAR(4); SELECT * FROM t1; DROP TABLE t1; + +# End of 5.0 tests + +# +# Bug#18775 - Temporary table from alter table visible to other threads +# +# Use a special database to avoid name clashes with user tables. +--disable_warnings +DROP DATABASE IF EXISTS mysqltest; +--enable_warnings +CREATE DATABASE mysqltest; +use mysqltest; +# +# Check if non-ASCII alphabetic characters work and duplicates are detected. +--disable_warnings +DROP TABLE IF EXISTS `t1_nägel`, `t1_blüten`; +--enable_warnings +CREATE TABLE `t1_nägel` (c1 INT); +ALTER TABLE `t1_nägel` RENAME `t1_blüten`; +CREATE TABLE `t1_nägel` (c1 INT); +--error ER_TABLE_EXISTS_ERROR +ALTER TABLE `t1_nägel` RENAME `t1_blüten`; +DROP TABLE `t1_nägel`, `t1_blüten`; +# +# Same for temporary tables though these names do not become file names. +CREATE TEMPORARY TABLE `tt1_nägel` (c1 INT); +ALTER TABLE `tt1_nägel` RENAME `tt1_blüten`; +CREATE TEMPORARY TABLE `tt1_nägel` (c1 INT); +--error ER_TABLE_EXISTS_ERROR +ALTER TABLE `tt1_nägel` RENAME `tt1_blüten`; +SHOW CREATE TABLE `tt1_blüten`; +DROP TABLE `tt1_nägel`, `tt1_blüten`; +# +# Check if special characters as in tmp_file_prefix work. +CREATE TABLE `#sql1` (c1 INT); +CREATE TABLE `@0023sql2` (c1 INT); +SHOW TABLES; +RENAME TABLE `#sql1` TO `@0023sql1`; +RENAME TABLE `@0023sql2` TO `#sql2`; +SHOW TABLES; +ALTER TABLE `@0023sql1` RENAME `#sql-1`; +ALTER TABLE `#sql2` RENAME `@0023sql-2`; +SHOW TABLES; +INSERT INTO `#sql-1` VALUES (1); +INSERT INTO `@0023sql-2` VALUES (2); +DROP TABLE `#sql-1`, `@0023sql-2`; +# +# Same for temporary tables though these names do not become file names. +CREATE TEMPORARY TABLE `#sql1` (c1 INT); +CREATE TEMPORARY TABLE `@0023sql2` (c1 INT); +SHOW TABLES; +ALTER TABLE `#sql1` RENAME `@0023sql1`; +ALTER TABLE `@0023sql2` RENAME `#sql2`; +SHOW TABLES; +INSERT INTO `#sql2` VALUES (1); +INSERT INTO `@0023sql1` VALUES (2); +SHOW CREATE TABLE `@0023sql1`; +DROP TABLE `#sql2`, `@0023sql1`; +# +# Cleanup +use test; +DROP DATABASE mysqltest; + diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test index 917c3f98ebb..fa6bbc21813 100644 --- a/mysql-test/t/backup.test +++ b/mysql-test/t/backup.test @@ -58,3 +58,22 @@ drop table t5; --system rm $MYSQLTEST_VARDIR/tmp/t?.* # End of 4.1 tests +# End of 5.0 tests + +# +# Bug#18775 - Temporary table from alter table visible to other threads +# +# Backup did not encode table names. +--disable_warnings +DROP TABLE IF EXISTS `t-blüten`; +--enable_warnings +CREATE TABLE `t-blüten` (c1 INT); +INSERT INTO `t-blüten` VALUES (1), (2), (3); +BACKUP TABLE `t-blüten` TO '../tmp'; +DROP TABLE `t-blüten`; +# +# Same for restore. +RESTORE TABLE `t-blüten` FROM '../tmp'; +SELECT * FROM `t-blüten`; +DROP TABLE `t-blüten`; + diff --git a/mysql-test/t/repair.test b/mysql-test/t/repair.test index 16e1d76d460..c79768dbb46 100644 --- a/mysql-test/t/repair.test +++ b/mysql-test/t/repair.test @@ -35,3 +35,16 @@ repair table t1 use_frm; drop table t1; # End of 4.1 tests +# End of 5.0 tests + +# +# Bug#18775 - Temporary table from alter table visible to other threads +# +# REPAIR TABLE ... USE_FRM on temporary table crashed the table or server. +--disable_warnings +DROP TABLE IF EXISTS tt1; +--enable_warnings +CREATE TEMPORARY TABLE tt1 (c1 INT); +REPAIR TABLE tt1 USE_FRM; +DROP TABLE tt1; + -- cgit v1.2.1 From 375692973df6b71826a11f470cb6d521bfa16cc9 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 3 Aug 2006 08:12:56 +0200 Subject: Bug#18775 - Temporary table from alter table visible to other threads New test cases. Names with umlauts don't compare well on Windows. mysql-test/r/alter_table.result: Bug#18775 - Temporary table from alter table visible to other threads New test results mysql-test/r/backup.result: Bug#18775 - Temporary table from alter table visible to other threads New test results mysql-test/t/alter_table.test: Bug#18775 - Temporary table from alter table visible to other threads New test case. Names with umlauts don't compare well on Windows. mysql-test/t/backup.test: Bug#18775 - Temporary table from alter table visible to other threads New test case. Names with umlauts don't compare well on Windows. --- mysql-test/r/alter_table.result | 55 ++++++++++++++++++++++------------------- mysql-test/r/backup.result | 20 +++++++-------- mysql-test/t/alter_table.test | 39 +++++++++++------------------ mysql-test/t/backup.test | 16 ++++++------ 4 files changed, 63 insertions(+), 67 deletions(-) (limited to 'mysql-test') diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index 3095d5337ed..d3657d84678 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -657,43 +657,45 @@ SELECT * FROM t1; v b abc 5 DROP TABLE t1; -DROP DATABASE IF EXISTS mysqltest; -CREATE DATABASE mysqltest; -use mysqltest; -DROP TABLE IF EXISTS `t1_nägel`, `t1_blüten`; -CREATE TABLE `t1_nägel` (c1 INT); -ALTER TABLE `t1_nägel` RENAME `t1_blüten`; -CREATE TABLE `t1_nägel` (c1 INT); -ALTER TABLE `t1_nägel` RENAME `t1_blüten`; -ERROR 42S01: Table 't1_blЭten' already exists -DROP TABLE `t1_nägel`, `t1_blüten`; -CREATE TEMPORARY TABLE `tt1_nägel` (c1 INT); -ALTER TABLE `tt1_nägel` RENAME `tt1_blüten`; -CREATE TEMPORARY TABLE `tt1_nägel` (c1 INT); -ALTER TABLE `tt1_nägel` RENAME `tt1_blüten`; -ERROR 42S01: Table 'tt1_blЭten' already exists -SHOW CREATE TABLE `tt1_blüten`; +DROP TABLE IF EXISTS `t+1`, `t+2`; +CREATE TABLE `t+1` (c1 INT); +ALTER TABLE `t+1` RENAME `t+2`; +CREATE TABLE `t+1` (c1 INT); +ALTER TABLE `t+1` RENAME `t+2`; +ERROR 42S01: Table 't+2' already exists +DROP TABLE `t+1`, `t+2`; +CREATE TEMPORARY TABLE `tt+1` (c1 INT); +ALTER TABLE `tt+1` RENAME `tt+2`; +CREATE TEMPORARY TABLE `tt+1` (c1 INT); +ALTER TABLE `tt+1` RENAME `tt+2`; +ERROR 42S01: Table 'tt+2' already exists +SHOW CREATE TABLE `tt+1`; +Table Create Table +tt+1 CREATE TEMPORARY TABLE `tt+1` ( + `c1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +SHOW CREATE TABLE `tt+2`; Table Create Table -tt1_blüten CREATE TEMPORARY TABLE `tt1_blüten` ( +tt+2 CREATE TEMPORARY TABLE `tt+2` ( `c1` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 -DROP TABLE `tt1_nägel`, `tt1_blüten`; +DROP TABLE `tt+1`, `tt+2`; CREATE TABLE `#sql1` (c1 INT); CREATE TABLE `@0023sql2` (c1 INT); SHOW TABLES; -Tables_in_mysqltest +Tables_in_test #sql1 @0023sql2 RENAME TABLE `#sql1` TO `@0023sql1`; RENAME TABLE `@0023sql2` TO `#sql2`; SHOW TABLES; -Tables_in_mysqltest +Tables_in_test #sql2 @0023sql1 ALTER TABLE `@0023sql1` RENAME `#sql-1`; ALTER TABLE `#sql2` RENAME `@0023sql-2`; SHOW TABLES; -Tables_in_mysqltest +Tables_in_test #sql-1 @0023sql-2 INSERT INTO `#sql-1` VALUES (1); @@ -702,18 +704,21 @@ DROP TABLE `#sql-1`, `@0023sql-2`; CREATE TEMPORARY TABLE `#sql1` (c1 INT); CREATE TEMPORARY TABLE `@0023sql2` (c1 INT); SHOW TABLES; -Tables_in_mysqltest +Tables_in_test ALTER TABLE `#sql1` RENAME `@0023sql1`; ALTER TABLE `@0023sql2` RENAME `#sql2`; SHOW TABLES; -Tables_in_mysqltest +Tables_in_test INSERT INTO `#sql2` VALUES (1); INSERT INTO `@0023sql1` VALUES (2); +SHOW CREATE TABLE `#sql2`; +Table Create Table +#sql2 CREATE TEMPORARY TABLE `#sql2` ( + `c1` int(11) DEFAULT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 SHOW CREATE TABLE `@0023sql1`; Table Create Table @0023sql1 CREATE TEMPORARY TABLE `@0023sql1` ( `c1` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE `#sql2`, `@0023sql1`; -use test; -DROP DATABASE mysqltest; diff --git a/mysql-test/r/backup.result b/mysql-test/r/backup.result index 05761240ca7..a4d1b18fe61 100644 --- a/mysql-test/r/backup.result +++ b/mysql-test/r/backup.result @@ -101,23 +101,23 @@ test.t5 backup status OK Warnings: Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. drop table t5; -DROP TABLE IF EXISTS `t-blüten`; -CREATE TABLE `t-blüten` (c1 INT); -INSERT INTO `t-blüten` VALUES (1), (2), (3); -BACKUP TABLE `t-blüten` TO '../tmp'; +DROP TABLE IF EXISTS `t+1`; +CREATE TABLE `t+1` (c1 INT); +INSERT INTO `t+1` VALUES (1), (2), (3); +BACKUP TABLE `t+1` TO '../tmp'; Table Op Msg_type Msg_text -test.t-blüten backup status OK +test.t+1 backup status OK Warnings: Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. -DROP TABLE `t-blüten`; -RESTORE TABLE `t-blüten` FROM '../tmp'; +DROP TABLE `t+1`; +RESTORE TABLE `t+1` FROM '../tmp'; Table Op Msg_type Msg_text -test.t-blüten restore status OK +test.t+1 restore status OK Warnings: Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead. -SELECT * FROM `t-blüten`; +SELECT * FROM `t+1`; c1 1 2 3 -DROP TABLE `t-blüten`; +DROP TABLE `t+1`; diff --git a/mysql-test/t/alter_table.test b/mysql-test/t/alter_table.test index f6af92e0044..168d011a2ac 100644 --- a/mysql-test/t/alter_table.test +++ b/mysql-test/t/alter_table.test @@ -488,32 +488,26 @@ DROP TABLE t1; # # Bug#18775 - Temporary table from alter table visible to other threads # -# Use a special database to avoid name clashes with user tables. +# Check if special characters work and duplicates are detected. --disable_warnings -DROP DATABASE IF EXISTS mysqltest; +DROP TABLE IF EXISTS `t+1`, `t+2`; --enable_warnings -CREATE DATABASE mysqltest; -use mysqltest; -# -# Check if non-ASCII alphabetic characters work and duplicates are detected. ---disable_warnings -DROP TABLE IF EXISTS `t1_nägel`, `t1_blüten`; ---enable_warnings -CREATE TABLE `t1_nägel` (c1 INT); -ALTER TABLE `t1_nägel` RENAME `t1_blüten`; -CREATE TABLE `t1_nägel` (c1 INT); +CREATE TABLE `t+1` (c1 INT); +ALTER TABLE `t+1` RENAME `t+2`; +CREATE TABLE `t+1` (c1 INT); --error ER_TABLE_EXISTS_ERROR -ALTER TABLE `t1_nägel` RENAME `t1_blüten`; -DROP TABLE `t1_nägel`, `t1_blüten`; +ALTER TABLE `t+1` RENAME `t+2`; +DROP TABLE `t+1`, `t+2`; # # Same for temporary tables though these names do not become file names. -CREATE TEMPORARY TABLE `tt1_nägel` (c1 INT); -ALTER TABLE `tt1_nägel` RENAME `tt1_blüten`; -CREATE TEMPORARY TABLE `tt1_nägel` (c1 INT); +CREATE TEMPORARY TABLE `tt+1` (c1 INT); +ALTER TABLE `tt+1` RENAME `tt+2`; +CREATE TEMPORARY TABLE `tt+1` (c1 INT); --error ER_TABLE_EXISTS_ERROR -ALTER TABLE `tt1_nägel` RENAME `tt1_blüten`; -SHOW CREATE TABLE `tt1_blüten`; -DROP TABLE `tt1_nägel`, `tt1_blüten`; +ALTER TABLE `tt+1` RENAME `tt+2`; +SHOW CREATE TABLE `tt+1`; +SHOW CREATE TABLE `tt+2`; +DROP TABLE `tt+1`, `tt+2`; # # Check if special characters as in tmp_file_prefix work. CREATE TABLE `#sql1` (c1 INT); @@ -538,10 +532,7 @@ ALTER TABLE `@0023sql2` RENAME `#sql2`; SHOW TABLES; INSERT INTO `#sql2` VALUES (1); INSERT INTO `@0023sql1` VALUES (2); +SHOW CREATE TABLE `#sql2`; SHOW CREATE TABLE `@0023sql1`; DROP TABLE `#sql2`, `@0023sql1`; -# -# Cleanup -use test; -DROP DATABASE mysqltest; diff --git a/mysql-test/t/backup.test b/mysql-test/t/backup.test index fa6bbc21813..61bde0cecb0 100644 --- a/mysql-test/t/backup.test +++ b/mysql-test/t/backup.test @@ -65,15 +65,15 @@ drop table t5; # # Backup did not encode table names. --disable_warnings -DROP TABLE IF EXISTS `t-blüten`; +DROP TABLE IF EXISTS `t+1`; --enable_warnings -CREATE TABLE `t-blüten` (c1 INT); -INSERT INTO `t-blüten` VALUES (1), (2), (3); -BACKUP TABLE `t-blüten` TO '../tmp'; -DROP TABLE `t-blüten`; +CREATE TABLE `t+1` (c1 INT); +INSERT INTO `t+1` VALUES (1), (2), (3); +BACKUP TABLE `t+1` TO '../tmp'; +DROP TABLE `t+1`; # # Same for restore. -RESTORE TABLE `t-blüten` FROM '../tmp'; -SELECT * FROM `t-blüten`; -DROP TABLE `t-blüten`; +RESTORE TABLE `t+1` FROM '../tmp'; +SELECT * FROM `t+1`; +DROP TABLE `t+1`; -- cgit v1.2.1