1
0
mirror of https://github.com/MariaDB/server.git synced 2025-11-12 10:22:39 +03:00

Merge istruewing@bk-internal.mysql.com:/home/bk/mysql-5.1-engines

into  chilla.local:/home/mydev/mysql-5.1-bug18775
This commit is contained in:
ingo/istruewing@chilla.local
2006-08-02 18:10:51 +02:00
25 changed files with 503 additions and 160 deletions

View File

@@ -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<5F>gel`, `t1_bl<62>ten`;
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);
ALTER TABLE `t1_n<5F>gel` RENAME `t1_bl<62>ten`;
ERROR 42S01: Table 't1_blЭten' already exists
DROP TABLE `t1_n<5F>gel`, `t1_bl<62>ten`;
CREATE TEMPORARY TABLE `tt1_n<5F>gel` (c1 INT);
ALTER TABLE `tt1_n<5F>gel` RENAME `tt1_bl<62>ten`;
CREATE TEMPORARY TABLE `tt1_n<5F>gel` (c1 INT);
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
tt1_bl<EFBFBD>ten CREATE TEMPORARY TABLE `tt1_bl<62>ten` (
`c1` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP TABLE `tt1_n<5F>gel`, `tt1_bl<62>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;

View File

@@ -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<62>ten`;
CREATE TABLE `t-bl<62>ten` (c1 INT);
INSERT INTO `t-bl<62>ten` VALUES (1), (2), (3);
BACKUP TABLE `t-bl<62>ten` TO '../tmp';
Table Op Msg_type Msg_text
test.t-bl<62>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<62>ten`;
RESTORE TABLE `t-bl<62>ten` FROM '../tmp';
Table Op Msg_type Msg_text
test.t-bl<62>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<62>ten`;
c1
1
2
3
DROP TABLE `t-bl<62>ten`;

View File

@@ -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;

View File

@@ -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<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
ALTER TABLE `t1_n<5F>gel` RENAME `t1_bl<62>ten`;
DROP TABLE `t1_n<5F>gel`, `t1_bl<62>ten`;
#
# Same for temporary tables though these names do not become file names.
CREATE TEMPORARY TABLE `tt1_n<5F>gel` (c1 INT);
ALTER TABLE `tt1_n<5F>gel` RENAME `tt1_bl<62>ten`;
CREATE TEMPORARY TABLE `tt1_n<5F>gel` (c1 INT);
--error ER_TABLE_EXISTS_ERROR
ALTER TABLE `tt1_n<5F>gel` RENAME `tt1_bl<62>ten`;
SHOW CREATE TABLE `tt1_bl<62>ten`;
DROP TABLE `tt1_n<5F>gel`, `tt1_bl<62>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;

View File

@@ -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<62>ten`;
--enable_warnings
CREATE TABLE `t-bl<62>ten` (c1 INT);
INSERT INTO `t-bl<62>ten` VALUES (1), (2), (3);
BACKUP TABLE `t-bl<62>ten` TO '../tmp';
DROP TABLE `t-bl<62>ten`;
#
# Same for restore.
RESTORE TABLE `t-bl<62>ten` FROM '../tmp';
SELECT * FROM `t-bl<62>ten`;
DROP TABLE `t-bl<62>ten`;

View File

@@ -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;