summaryrefslogtreecommitdiff
path: root/mysql-test/r/merge.result
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@sun.com>2010-03-03 14:49:03 +0400
committerSergey Vojtovich <svoj@sun.com>2010-03-03 14:49:03 +0400
commit1d2aeb3da2dedc81a294629b50a6f47a3b377949 (patch)
tree609707a35cf570ea3211ac4d61542b99c149670d /mysql-test/r/merge.result
parent6124451d9534b1a03e58724411c492d9de980cb4 (diff)
downloadmariadb-git-1d2aeb3da2dedc81a294629b50a6f47a3b377949.tar.gz
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. mysql-test/r/merge.result: A test case for BUG#48265. mysql-test/std_data/bug48265.frm: MERGE table from 5.0 to test fix for BUG#48265 compatibility. mysql-test/t/merge.test: A test case for BUG#48265. storage/myisammrg/ha_myisammrg.cc: On CREATE always write child table/database name encoded by table name to filename encoding to dot-MRG file. On open decode child table/database name. Compatibilty with previous versions preserved. Fixed ::append_create_info() to return child table/database name instead of path. storage/myisammrg/myrg_open.c: Move if (has_path) branch from myrg_parent_open() to myisammrg_parent_open_callback. The callback function needs to know if child table was written along with database name to dot-MRG file. Needed for compatibility reasons.
Diffstat (limited to 'mysql-test/r/merge.result')
-rw-r--r--mysql-test/r/merge.result67
1 files changed, 67 insertions, 0 deletions
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result
index 893ea5acf88..184cd92e053 100644
--- a/mysql-test/r/merge.result
+++ b/mysql-test/r/merge.result
@@ -2219,4 +2219,71 @@ Trigger sql_mode SQL Original Statement character_set_client collation_connectio
tr1 CREATE DEFINER=`root`@`localhost` TRIGGER tr1 AFTER INSERT ON t3 FOR EACH ROW CALL foo() latin1 latin1_swedish_ci latin1_swedish_ci
DROP TRIGGER tr1;
DROP TABLE t1, t2, t3;
+#
+# BUG#48265 - MRG_MYISAM problem (works in 5.0.85, does't work in 5.1.40)
+#
+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;
+a
+SHOW CREATE TABLE m1;
+Table Create Table
+m1 CREATE TABLE `m1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`test/1`.`t/1`)
+DROP TABLE m1;
+CREATE TABLE `test/1`.m1(a INT) ENGINE=MERGE UNION=(`test/1`.`t/1`);
+SELECT * FROM `test/1`.m1;
+a
+SHOW CREATE TABLE `test/1`.m1;
+Table Create Table
+m1 CREATE TABLE `m1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t/1`)
+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;
+a
+SHOW CREATE TABLE m1;
+Table Create Table
+m1 CREATE TEMPORARY TABLE `m1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`test/1`.`t/1`)
+DROP TABLE m1;
+CREATE TEMPORARY TABLE `test/1`.m1(a INT) ENGINE=MERGE UNION=(`test/1`.`t/1`);
+SELECT * FROM `test/1`.m1;
+a
+SHOW CREATE TABLE `test/1`.m1;
+Table Create Table
+m1 CREATE TEMPORARY TABLE `m1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t/1`)
+DROP TABLE `test/1`.m1;
+DROP TABLE `test/1`.`t/1`;
+DROP DATABASE `test/1`;
+CREATE TABLE `t@1`(a INT);
+SELECT * FROM m1;
+a
+SHOW CREATE TABLE m1;
+Table Create Table
+m1 CREATE TABLE `m1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t@1`)
+DROP TABLE `t@1`;
+CREATE DATABASE `test@1`;
+CREATE TABLE `test@1`.`t@1`(a INT);
+FLUSH TABLE m1;
+SELECT * FROM m1;
+a
+SHOW CREATE TABLE m1;
+Table Create Table
+m1 CREATE TABLE `m1` (
+ `a` int(11) DEFAULT NULL
+) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`test@1`.`t@1`)
+DROP TABLE m1;
+DROP TABLE `test@1`.`t@1`;
+DROP DATABASE `test@1`;
End of 5.1 tests