mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
BUG#48265 - MRG_MYISAM problem (works in 5.0.85, does't
work in 5.1.40) MERGE engine fails to open child table from a different database if child table/database name contains characters that are subject for table name to filename encoding (WL1324). Another problem is that MERGE engine didn't properly open child table from the same database if child table name contains characters like '/', '#'. The problem was that table name to file name encoding was applied inconsistently: * On CREATE: encode table name + database name if child table is in different database; do not encode table name if child table is in the same database; * No decoding on open. With this fix child table/database names are always encoded on CREATE and decoded on open. Compatibility with older tables preserved. Along with this patch comes fix for SHOW CREATE TABLE, which used to show child table/database path instead of child table/database names.
This commit is contained in:
@@ -7,6 +7,8 @@ drop table if exists t1,t2,t3,t4,t5,t6;
|
||||
drop database if exists mysqltest;
|
||||
--enable_warnings
|
||||
|
||||
let $MYSQLD_DATADIR= `select @@datadir`;
|
||||
|
||||
create table t1 (a int not null primary key auto_increment, message char(20));
|
||||
create table t2 (a int not null primary key auto_increment, message char(20));
|
||||
INSERT INTO t1 (message) VALUES ("Testing"),("table"),("t1");
|
||||
@@ -1633,4 +1635,59 @@ SHOW CREATE TRIGGER tr1;
|
||||
DROP TRIGGER tr1;
|
||||
DROP TABLE t1, t2, t3;
|
||||
|
||||
--echo #
|
||||
--echo # BUG#48265 - MRG_MYISAM problem (works in 5.0.85, does't work in 5.1.40)
|
||||
--echo #
|
||||
CREATE DATABASE `test/1`;
|
||||
|
||||
CREATE TABLE `test/1`.`t/1`(a INT);
|
||||
CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(`test/1`.`t/1`);
|
||||
SELECT * FROM m1;
|
||||
SHOW CREATE TABLE m1;
|
||||
DROP TABLE m1;
|
||||
|
||||
CREATE TABLE `test/1`.m1(a INT) ENGINE=MERGE UNION=(`test/1`.`t/1`);
|
||||
SELECT * FROM `test/1`.m1;
|
||||
SHOW CREATE TABLE `test/1`.m1;
|
||||
DROP TABLE `test/1`.m1;
|
||||
DROP TABLE `test/1`.`t/1`;
|
||||
|
||||
CREATE TEMPORARY TABLE `test/1`.`t/1`(a INT);
|
||||
CREATE TEMPORARY TABLE m1(a INT) ENGINE=MERGE UNION=(`test/1`.`t/1`);
|
||||
SELECT * FROM m1;
|
||||
SHOW CREATE TABLE m1;
|
||||
DROP TABLE m1;
|
||||
|
||||
CREATE TEMPORARY TABLE `test/1`.m1(a INT) ENGINE=MERGE UNION=(`test/1`.`t/1`);
|
||||
SELECT * FROM `test/1`.m1;
|
||||
SHOW CREATE TABLE `test/1`.m1;
|
||||
DROP TABLE `test/1`.m1;
|
||||
DROP TABLE `test/1`.`t/1`;
|
||||
|
||||
DROP DATABASE `test/1`;
|
||||
|
||||
# Test compatibility. Use '@' instead of '/' (was not allowed in 5.0)
|
||||
|
||||
CREATE TABLE `t@1`(a INT);
|
||||
copy_file std_data/bug48265.frm $MYSQLD_DATADIR/test/m1.frm;
|
||||
write_file $MYSQLD_DATADIR/test/m1.MRG;
|
||||
t@1
|
||||
EOF
|
||||
SELECT * FROM m1;
|
||||
SHOW CREATE TABLE m1;
|
||||
DROP TABLE `t@1`;
|
||||
|
||||
CREATE DATABASE `test@1`;
|
||||
CREATE TABLE `test@1`.`t@1`(a INT);
|
||||
FLUSH TABLE m1;
|
||||
remove_file $MYSQLD_DATADIR/test/m1.MRG;
|
||||
write_file $MYSQLD_DATADIR/test/m1.MRG;
|
||||
./test@1/t@1
|
||||
EOF
|
||||
SELECT * FROM m1;
|
||||
SHOW CREATE TABLE m1;
|
||||
DROP TABLE m1;
|
||||
DROP TABLE `test@1`.`t@1`;
|
||||
DROP DATABASE `test@1`;
|
||||
|
||||
--echo End of 5.1 tests
|
||||
|
||||
Reference in New Issue
Block a user