mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Bug#18775 - Temporary table from alter table visible to other threads
New test cases. Names with umlauts don't compare well on Windows.
This commit is contained in:
@ -657,43 +657,45 @@ SELECT * FROM t1;
|
|||||||
v b
|
v b
|
||||||
abc 5
|
abc 5
|
||||||
DROP TABLE t1;
|
DROP TABLE t1;
|
||||||
DROP DATABASE IF EXISTS mysqltest;
|
DROP TABLE IF EXISTS `t+1`, `t+2`;
|
||||||
CREATE DATABASE mysqltest;
|
CREATE TABLE `t+1` (c1 INT);
|
||||||
use mysqltest;
|
ALTER TABLE `t+1` RENAME `t+2`;
|
||||||
DROP TABLE IF EXISTS `t1_n<5F>gel`, `t1_bl<62>ten`;
|
CREATE TABLE `t+1` (c1 INT);
|
||||||
CREATE TABLE `t1_n<EFBFBD>gel` (c1 INT);
|
ALTER TABLE `t+1` RENAME `t+2`;
|
||||||
ALTER TABLE `t1_n<5F>gel` RENAME `t1_bl<62>ten`;
|
ERROR 42S01: Table 't+2' already exists
|
||||||
CREATE TABLE `t1_n<5F>gel` (c1 INT);
|
DROP TABLE `t+1`, `t+2`;
|
||||||
ALTER TABLE `t1_n<EFBFBD>gel` RENAME `t1_bl<62>ten`;
|
CREATE TEMPORARY TABLE `tt+1` (c1 INT);
|
||||||
ERROR 42S01: Table 't1_blЭten' already exists
|
ALTER TABLE `tt+1` RENAME `tt+2`;
|
||||||
DROP TABLE `t1_n<5F>gel`, `t1_bl<62>ten`;
|
CREATE TEMPORARY TABLE `tt+1` (c1 INT);
|
||||||
CREATE TEMPORARY TABLE `tt1_n<EFBFBD>gel` (c1 INT);
|
ALTER TABLE `tt+1` RENAME `tt+2`;
|
||||||
ALTER TABLE `tt1_n<5F>gel` RENAME `tt1_bl<62>ten`;
|
ERROR 42S01: Table 'tt+2' already exists
|
||||||
CREATE TEMPORARY TABLE `tt1_n<5F>gel` (c1 INT);
|
SHOW CREATE TABLE `tt+1`;
|
||||||
ALTER TABLE `tt1_n<5F>gel` RENAME `tt1_bl<62>ten`;
|
|
||||||
ERROR 42S01: Table 'tt1_blЭten' already exists
|
|
||||||
SHOW CREATE TABLE `tt1_bl<62>ten`;
|
|
||||||
Table Create Table
|
Table Create Table
|
||||||
tt1_bl<EFBFBD>ten CREATE TEMPORARY TABLE `tt1_bl<EFBFBD>ten` (
|
tt+1 CREATE TEMPORARY TABLE `tt+1` (
|
||||||
`c1` int(11) DEFAULT NULL
|
`c1` int(11) DEFAULT NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
DROP TABLE `tt1_n<EFBFBD>gel`, `tt1_bl<62>ten`;
|
SHOW CREATE TABLE `tt+2`;
|
||||||
|
Table Create Table
|
||||||
|
tt+2 CREATE TEMPORARY TABLE `tt+2` (
|
||||||
|
`c1` int(11) DEFAULT NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
|
DROP TABLE `tt+1`, `tt+2`;
|
||||||
CREATE TABLE `#sql1` (c1 INT);
|
CREATE TABLE `#sql1` (c1 INT);
|
||||||
CREATE TABLE `@0023sql2` (c1 INT);
|
CREATE TABLE `@0023sql2` (c1 INT);
|
||||||
SHOW TABLES;
|
SHOW TABLES;
|
||||||
Tables_in_mysqltest
|
Tables_in_test
|
||||||
#sql1
|
#sql1
|
||||||
@0023sql2
|
@0023sql2
|
||||||
RENAME TABLE `#sql1` TO `@0023sql1`;
|
RENAME TABLE `#sql1` TO `@0023sql1`;
|
||||||
RENAME TABLE `@0023sql2` TO `#sql2`;
|
RENAME TABLE `@0023sql2` TO `#sql2`;
|
||||||
SHOW TABLES;
|
SHOW TABLES;
|
||||||
Tables_in_mysqltest
|
Tables_in_test
|
||||||
#sql2
|
#sql2
|
||||||
@0023sql1
|
@0023sql1
|
||||||
ALTER TABLE `@0023sql1` RENAME `#sql-1`;
|
ALTER TABLE `@0023sql1` RENAME `#sql-1`;
|
||||||
ALTER TABLE `#sql2` RENAME `@0023sql-2`;
|
ALTER TABLE `#sql2` RENAME `@0023sql-2`;
|
||||||
SHOW TABLES;
|
SHOW TABLES;
|
||||||
Tables_in_mysqltest
|
Tables_in_test
|
||||||
#sql-1
|
#sql-1
|
||||||
@0023sql-2
|
@0023sql-2
|
||||||
INSERT INTO `#sql-1` VALUES (1);
|
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 `#sql1` (c1 INT);
|
||||||
CREATE TEMPORARY TABLE `@0023sql2` (c1 INT);
|
CREATE TEMPORARY TABLE `@0023sql2` (c1 INT);
|
||||||
SHOW TABLES;
|
SHOW TABLES;
|
||||||
Tables_in_mysqltest
|
Tables_in_test
|
||||||
ALTER TABLE `#sql1` RENAME `@0023sql1`;
|
ALTER TABLE `#sql1` RENAME `@0023sql1`;
|
||||||
ALTER TABLE `@0023sql2` RENAME `#sql2`;
|
ALTER TABLE `@0023sql2` RENAME `#sql2`;
|
||||||
SHOW TABLES;
|
SHOW TABLES;
|
||||||
Tables_in_mysqltest
|
Tables_in_test
|
||||||
INSERT INTO `#sql2` VALUES (1);
|
INSERT INTO `#sql2` VALUES (1);
|
||||||
INSERT INTO `@0023sql1` VALUES (2);
|
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`;
|
SHOW CREATE TABLE `@0023sql1`;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
@0023sql1 CREATE TEMPORARY TABLE `@0023sql1` (
|
@0023sql1 CREATE TEMPORARY TABLE `@0023sql1` (
|
||||||
`c1` int(11) DEFAULT NULL
|
`c1` int(11) DEFAULT NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||||
DROP TABLE `#sql2`, `@0023sql1`;
|
DROP TABLE `#sql2`, `@0023sql1`;
|
||||||
use test;
|
|
||||||
DROP DATABASE mysqltest;
|
|
||||||
|
@ -101,23 +101,23 @@ test.t5 backup status OK
|
|||||||
Warnings:
|
Warnings:
|
||||||
Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
|
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 t5;
|
||||||
DROP TABLE IF EXISTS `t-bl<62>ten`;
|
DROP TABLE IF EXISTS `t+1`;
|
||||||
CREATE TABLE `t-bl<62>ten` (c1 INT);
|
CREATE TABLE `t+1` (c1 INT);
|
||||||
INSERT INTO `t-bl<62>ten` VALUES (1), (2), (3);
|
INSERT INTO `t+1` VALUES (1), (2), (3);
|
||||||
BACKUP TABLE `t-bl<62>ten` TO '../tmp';
|
BACKUP TABLE `t+1` TO '../tmp';
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t-bl<62>ten backup status OK
|
test.t+1 backup status OK
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1541 The syntax 'BACKUP TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
|
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<62>ten`;
|
DROP TABLE `t+1`;
|
||||||
RESTORE TABLE `t-bl<62>ten` FROM '../tmp';
|
RESTORE TABLE `t+1` FROM '../tmp';
|
||||||
Table Op Msg_type Msg_text
|
Table Op Msg_type Msg_text
|
||||||
test.t-bl<62>ten restore status OK
|
test.t+1 restore status OK
|
||||||
Warnings:
|
Warnings:
|
||||||
Warning 1541 The syntax 'RESTORE TABLE' is deprecated and will be removed in MySQL 5.2. Please use MySQL Administrator (mysqldump, mysql) instead.
|
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<62>ten`;
|
SELECT * FROM `t+1`;
|
||||||
c1
|
c1
|
||||||
1
|
1
|
||||||
2
|
2
|
||||||
3
|
3
|
||||||
DROP TABLE `t-bl<62>ten`;
|
DROP TABLE `t+1`;
|
||||||
|
@ -488,32 +488,26 @@ DROP TABLE t1;
|
|||||||
#
|
#
|
||||||
# Bug#18775 - Temporary table from alter table visible to other threads
|
# 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
|
--disable_warnings
|
||||||
DROP DATABASE IF EXISTS mysqltest;
|
DROP TABLE IF EXISTS `t+1`, `t+2`;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
CREATE DATABASE mysqltest;
|
CREATE TABLE `t+1` (c1 INT);
|
||||||
use mysqltest;
|
ALTER TABLE `t+1` RENAME `t+2`;
|
||||||
#
|
CREATE TABLE `t+1` (c1 INT);
|
||||||
# Check if non-ASCII alphabetic characters work and duplicates are detected.
|
|
||||||
--disable_warnings
|
|
||||||
DROP TABLE IF EXISTS `t1_n<5F>gel`, `t1_bl<62>ten`;
|
|
||||||
--enable_warnings
|
|
||||||
CREATE TABLE `t1_n<5F>gel` (c1 INT);
|
|
||||||
ALTER TABLE `t1_n<5F>gel` RENAME `t1_bl<62>ten`;
|
|
||||||
CREATE TABLE `t1_n<5F>gel` (c1 INT);
|
|
||||||
--error ER_TABLE_EXISTS_ERROR
|
--error ER_TABLE_EXISTS_ERROR
|
||||||
ALTER TABLE `t1_n<EFBFBD>gel` RENAME `t1_bl<EFBFBD>ten`;
|
ALTER TABLE `t+1` RENAME `t+2`;
|
||||||
DROP TABLE `t1_n<EFBFBD>gel`, `t1_bl<62>ten`;
|
DROP TABLE `t+1`, `t+2`;
|
||||||
#
|
#
|
||||||
# Same for temporary tables though these names do not become file names.
|
# Same for temporary tables though these names do not become file names.
|
||||||
CREATE TEMPORARY TABLE `tt1_n<EFBFBD>gel` (c1 INT);
|
CREATE TEMPORARY TABLE `tt+1` (c1 INT);
|
||||||
ALTER TABLE `tt1_n<EFBFBD>gel` RENAME `tt1_bl<EFBFBD>ten`;
|
ALTER TABLE `tt+1` RENAME `tt+2`;
|
||||||
CREATE TEMPORARY TABLE `tt1_n<EFBFBD>gel` (c1 INT);
|
CREATE TEMPORARY TABLE `tt+1` (c1 INT);
|
||||||
--error ER_TABLE_EXISTS_ERROR
|
--error ER_TABLE_EXISTS_ERROR
|
||||||
ALTER TABLE `tt1_n<EFBFBD>gel` RENAME `tt1_bl<EFBFBD>ten`;
|
ALTER TABLE `tt+1` RENAME `tt+2`;
|
||||||
SHOW CREATE TABLE `tt1_bl<EFBFBD>ten`;
|
SHOW CREATE TABLE `tt+1`;
|
||||||
DROP TABLE `tt1_n<EFBFBD>gel`, `tt1_bl<62>ten`;
|
SHOW CREATE TABLE `tt+2`;
|
||||||
|
DROP TABLE `tt+1`, `tt+2`;
|
||||||
#
|
#
|
||||||
# Check if special characters as in tmp_file_prefix work.
|
# Check if special characters as in tmp_file_prefix work.
|
||||||
CREATE TABLE `#sql1` (c1 INT);
|
CREATE TABLE `#sql1` (c1 INT);
|
||||||
@ -538,10 +532,7 @@ ALTER TABLE `@0023sql2` RENAME `#sql2`;
|
|||||||
SHOW TABLES;
|
SHOW TABLES;
|
||||||
INSERT INTO `#sql2` VALUES (1);
|
INSERT INTO `#sql2` VALUES (1);
|
||||||
INSERT INTO `@0023sql1` VALUES (2);
|
INSERT INTO `@0023sql1` VALUES (2);
|
||||||
|
SHOW CREATE TABLE `#sql2`;
|
||||||
SHOW CREATE TABLE `@0023sql1`;
|
SHOW CREATE TABLE `@0023sql1`;
|
||||||
DROP TABLE `#sql2`, `@0023sql1`;
|
DROP TABLE `#sql2`, `@0023sql1`;
|
||||||
#
|
|
||||||
# Cleanup
|
|
||||||
use test;
|
|
||||||
DROP DATABASE mysqltest;
|
|
||||||
|
|
||||||
|
@ -65,15 +65,15 @@ drop table t5;
|
|||||||
#
|
#
|
||||||
# Backup did not encode table names.
|
# Backup did not encode table names.
|
||||||
--disable_warnings
|
--disable_warnings
|
||||||
DROP TABLE IF EXISTS `t-bl<62>ten`;
|
DROP TABLE IF EXISTS `t+1`;
|
||||||
--enable_warnings
|
--enable_warnings
|
||||||
CREATE TABLE `t-bl<62>ten` (c1 INT);
|
CREATE TABLE `t+1` (c1 INT);
|
||||||
INSERT INTO `t-bl<62>ten` VALUES (1), (2), (3);
|
INSERT INTO `t+1` VALUES (1), (2), (3);
|
||||||
BACKUP TABLE `t-bl<62>ten` TO '../tmp';
|
BACKUP TABLE `t+1` TO '../tmp';
|
||||||
DROP TABLE `t-bl<62>ten`;
|
DROP TABLE `t+1`;
|
||||||
#
|
#
|
||||||
# Same for restore.
|
# Same for restore.
|
||||||
RESTORE TABLE `t-bl<62>ten` FROM '../tmp';
|
RESTORE TABLE `t+1` FROM '../tmp';
|
||||||
SELECT * FROM `t-bl<62>ten`;
|
SELECT * FROM `t+1`;
|
||||||
DROP TABLE `t-bl<62>ten`;
|
DROP TABLE `t+1`;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user