From: Date: October 9 2008 11:13am Subject: bzr commit into mysql-6.0 branch (Sergey.Glukhov:2861) List-Archive: http://lists.mysql.com/commits/55889 Message-Id: <0K8G008LASB3HY10@fe-emea-10.sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7BIT #At file:///home/gluh/MySQL/mysql-6.0-bugteam/ 2861 Sergey Glukhov 2008-10-09 [merge] 5.1->6.0 bugteam tree merge modified: mysql-test/r/merge.result mysql-test/t/merge.test sql/sql_base.cc per-file messages: mysql-test/r/merge.result 5.1->6.0 bugteam tree merge mysql-test/t/merge.test 5.1->6.0 bugteam tree merge sql/sql_base.cc 5.1->6.0 bugteam tree merge === modified file 'mysql-test/r/merge.result' --- a/mysql-test/r/merge.result 2008-07-24 10:00:56 +0000 +++ b/mysql-test/r/merge.result 2008-10-09 09:13:02 +0000 @@ -832,7 +832,7 @@ ERROR HY000: Unable to open underlying t DROP TABLE t1, t2; CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3); SELECT * FROM t2; -ERROR 42S02: Table 'test.t3' doesn't exist +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist DROP TABLE t2; CREATE TABLE t1(a INT, b TEXT); CREATE TABLE tm1(a TEXT, b INT) ENGINE=MERGE UNION=(t1); @@ -897,17 +897,19 @@ drop table t2; drop table t1; CREATE TABLE tm1(a INT) ENGINE=MERGE UNION=(t1, t2); SELECT * FROM tm1; -ERROR 42S02: Table 'test.t1' doesn't exist +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist CHECK TABLE tm1; Table Op Msg_type Msg_text test.tm1 check Error Table 'test.t1' doesn't exist +test.tm1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist test.tm1 check error Corrupt CREATE TABLE t1(a INT); SELECT * FROM tm1; -ERROR 42S02: Table 'test.t2' doesn't exist +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist CHECK TABLE tm1; Table Op Msg_type Msg_text test.tm1 check Error Table 'test.t2' doesn't exist +test.tm1 check Error Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist test.tm1 check error Corrupt CREATE TABLE t2(a BLOB); SELECT * FROM tm1; @@ -1181,7 +1183,7 @@ c1 3 RENAME TABLE t2 TO t5; SELECT * FROM t3 ORDER BY c1; -ERROR 42S02: Table 'test.t2' doesn't exist +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist RENAME TABLE t5 TO t2; SELECT * FROM t3 ORDER BY c1; c1 @@ -1215,7 +1217,7 @@ UNLOCK TABLES; # 4. Alter table rename. ALTER TABLE t2 RENAME TO t5; SELECT * FROM t3 ORDER BY c1; -ERROR 42S02: Table 'test.t2' doesn't exist +ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist ALTER TABLE t5 RENAME TO t2; SELECT * FROM t3 ORDER BY c1; c1 === modified file 'mysql-test/t/merge.test' --- a/mysql-test/t/merge.test 2008-07-09 07:12:43 +0000 +++ b/mysql-test/t/merge.test 2008-10-09 09:13:02 +0000 @@ -461,7 +461,7 @@ CREATE TABLE t2(a INT) ENGINE=MERGE UNIO SELECT * FROM t2; DROP TABLE t1, t2; CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3); ---error ER_NO_SUCH_TABLE +--error ER_WRONG_MRG_TABLE SELECT * FROM t2; DROP TABLE t2; @@ -553,11 +553,11 @@ drop table t1; # CREATE TABLE fails # CREATE TABLE tm1(a INT) ENGINE=MERGE UNION=(t1, t2); ---error ER_NO_SUCH_TABLE +--error ER_WRONG_MRG_TABLE SELECT * FROM tm1; CHECK TABLE tm1; CREATE TABLE t1(a INT); ---error ER_NO_SUCH_TABLE +--error ER_WRONG_MRG_TABLE SELECT * FROM tm1; CHECK TABLE tm1; CREATE TABLE t2(a BLOB); @@ -784,7 +784,7 @@ DROP TABLE t4; --echo # 2. Normal rename. SELECT * FROM t3 ORDER BY c1; RENAME TABLE t2 TO t5; ---error ER_NO_SUCH_TABLE +--error ER_WRONG_MRG_TABLE SELECT * FROM t3 ORDER BY c1; RENAME TABLE t5 TO t2; SELECT * FROM t3 ORDER BY c1; @@ -802,7 +802,7 @@ UNLOCK TABLES; --echo # --echo # 4. Alter table rename. ALTER TABLE t2 RENAME TO t5; ---error ER_NO_SUCH_TABLE +--error ER_WRONG_MRG_TABLE SELECT * FROM t3 ORDER BY c1; ALTER TABLE t5 RENAME TO t2; SELECT * FROM t3 ORDER BY c1; === modified file 'sql/sql_base.cc' --- a/sql/sql_base.cc 2008-10-03 12:44:52 +0000 +++ b/sql/sql_base.cc 2008-10-09 09:13:02 +0000 @@ -572,12 +572,20 @@ static TABLE_SHARE "no such table" errors. @todo Rework the alternative ways to deal with ER_NO_SUCH TABLE. */ - if (thd->is_error() && table_list->belong_to_view) + if (thd->is_error()) { - TABLE_LIST *view= table_list->belong_to_view; - thd->clear_error(); - my_error(ER_VIEW_INVALID, MYF(0), - view->view_db.str, view->view_name.str); + if (table_list->parent_l) + { + thd->clear_error(); + my_error(ER_WRONG_MRG_TABLE, MYF(0)); + } + else if (table_list->belong_to_view) + { + TABLE_LIST *view= table_list->belong_to_view; + thd->clear_error(); + my_error(ER_VIEW_INVALID, MYF(0), + view->view_db.str, view->view_name.str); + } } DBUG_RETURN(0); }