Loading mysql-test/r/merge.result +22 −0 Original line number Diff line number Diff line Loading @@ -918,4 +918,26 @@ id ref 3 2 4 5 DROP TABLE t1, t2, t3; CREATE TABLE t1(a INT); CREATE TABLE m1(a INT) ENGINE=MERGE; SHOW CREATE TABLE m1; Table Create Table m1 CREATE TABLE `m1` ( `a` int(11) default NULL ) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 DROP TABLE m1; CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(); SHOW CREATE TABLE m1; Table Create Table m1 CREATE TABLE `m1` ( `a` int(11) default NULL ) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 ALTER TABLE m1 UNION=(t1); ALTER TABLE m1 UNION=(); SHOW CREATE TABLE m1; Table Create Table m1 CREATE TABLE `m1` ( `a` int(11) default NULL ) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1, m1; End of 5.0 tests mysql-test/t/merge.test +13 −0 Original line number Diff line number Diff line Loading @@ -542,5 +542,18 @@ SELECT * FROM t3; DROP TABLE t1, t2, t3; # # BUG#28248 - mysqldump results with MERGE ... UNION=() cannot be executed # CREATE TABLE t1(a INT); CREATE TABLE m1(a INT) ENGINE=MERGE; SHOW CREATE TABLE m1; DROP TABLE m1; CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(); SHOW CREATE TABLE m1; ALTER TABLE m1 UNION=(t1); ALTER TABLE m1 UNION=(); SHOW CREATE TABLE m1; DROP TABLE t1, m1; --echo End of 5.0 tests sql/ha_myisammrg.cc +6 −0 Original line number Diff line number Diff line Loading @@ -602,6 +602,12 @@ void ha_myisammrg::append_create_info(String *packet) packet->append(STRING_WITH_LEN(" INSERT_METHOD=")); packet->append(get_type(&merge_insert_method,file->merge_insert_method-1)); } /* There is no sence adding UNION clause in case there is no underlying tables specified. */ if (file->open_tables == file->end_table) return; packet->append(STRING_WITH_LEN(" UNION=(")); MYRG_TABLE *open_table,*first; Loading sql/sql_yacc.yy +1 −1 Original line number Diff line number Diff line Loading @@ -2932,7 +2932,7 @@ create_table_option: my_error(ER_WARN_DEPRECATED_SYNTAX, MYF(0), "RAID_CHUNKSIZE", "PARTITION"); MYSQL_YYABORT; } | UNION_SYM opt_equal '(' table_list ')' | UNION_SYM opt_equal '(' opt_table_list ')' { /* Move the union list to the merge_list */ LEX *lex=Lex; Loading Loading
mysql-test/r/merge.result +22 −0 Original line number Diff line number Diff line Loading @@ -918,4 +918,26 @@ id ref 3 2 4 5 DROP TABLE t1, t2, t3; CREATE TABLE t1(a INT); CREATE TABLE m1(a INT) ENGINE=MERGE; SHOW CREATE TABLE m1; Table Create Table m1 CREATE TABLE `m1` ( `a` int(11) default NULL ) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 DROP TABLE m1; CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(); SHOW CREATE TABLE m1; Table Create Table m1 CREATE TABLE `m1` ( `a` int(11) default NULL ) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 ALTER TABLE m1 UNION=(t1); ALTER TABLE m1 UNION=(); SHOW CREATE TABLE m1; Table Create Table m1 CREATE TABLE `m1` ( `a` int(11) default NULL ) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 DROP TABLE t1, m1; End of 5.0 tests
mysql-test/t/merge.test +13 −0 Original line number Diff line number Diff line Loading @@ -542,5 +542,18 @@ SELECT * FROM t3; DROP TABLE t1, t2, t3; # # BUG#28248 - mysqldump results with MERGE ... UNION=() cannot be executed # CREATE TABLE t1(a INT); CREATE TABLE m1(a INT) ENGINE=MERGE; SHOW CREATE TABLE m1; DROP TABLE m1; CREATE TABLE m1(a INT) ENGINE=MERGE UNION=(); SHOW CREATE TABLE m1; ALTER TABLE m1 UNION=(t1); ALTER TABLE m1 UNION=(); SHOW CREATE TABLE m1; DROP TABLE t1, m1; --echo End of 5.0 tests
sql/ha_myisammrg.cc +6 −0 Original line number Diff line number Diff line Loading @@ -602,6 +602,12 @@ void ha_myisammrg::append_create_info(String *packet) packet->append(STRING_WITH_LEN(" INSERT_METHOD=")); packet->append(get_type(&merge_insert_method,file->merge_insert_method-1)); } /* There is no sence adding UNION clause in case there is no underlying tables specified. */ if (file->open_tables == file->end_table) return; packet->append(STRING_WITH_LEN(" UNION=(")); MYRG_TABLE *open_table,*first; Loading
sql/sql_yacc.yy +1 −1 Original line number Diff line number Diff line Loading @@ -2932,7 +2932,7 @@ create_table_option: my_error(ER_WARN_DEPRECATED_SYNTAX, MYF(0), "RAID_CHUNKSIZE", "PARTITION"); MYSQL_YYABORT; } | UNION_SYM opt_equal '(' table_list ')' | UNION_SYM opt_equal '(' opt_table_list ')' { /* Move the union list to the merge_list */ LEX *lex=Lex; Loading