From: Date: May 22 2007 10:00am Subject: bk commit into 5.0 tree (svoj:1.2443) BUG#26976 List-Archive: http://lists.mysql.com/commits/27114 X-Bug: 26976 Message-Id: <20070522080054.694C041CEC3@june.myoffice.izhnet.ru> Below is the list of changes that have just been committed into a local 5.0 repository of svoj. When svoj does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2007-05-22 13:00:50+05:00, svoj@stripped +6 -0 BUG#26976 - Missing table in merge not noted in related error msg + SHOW CREATE TABLE fails Improved error message in case we fail to open underlying table. Now we report table name. No test case needed - error message covered by current tests. myisammrg/myrg_open.c@stripped, 2007-05-22 13:00:49+05:00, svoj@stripped +2 -0 In case we fail to open underlying table, report table name. mysql-test/r/merge.result@stripped, 2007-05-22 13:00:49+05:00, svoj@stripped +9 -9 Fixed a test case according to fix for BUG#26976. mysql-test/t/merge.test@stripped, 2007-05-22 13:00:49+05:00, svoj@stripped +9 -9 Fixed a test case according to fix for BUG#26976. sql/ha_myisammrg.cc@stripped, 2007-05-22 13:00:49+05:00, svoj@stripped +3 -1 In case we fail to open underlying table, report table name. sql/handler.cc@stripped, 2007-05-22 13:00:49+05:00, svoj@stripped +2 -1 HA_ERR_WRONG_MRG_TABLE_DEF is now reported by the handler. sql/share/errmsg.txt@stripped, 2007-05-22 13:00:49+05:00, svoj@stripped +3 -2 In case we fail to open underlying table, report table name. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: svoj # Host: june.mysql.com # Root: /home/svoj/devel/mysql/BUG26976/mysql-5.0-engines --- 1.35/myisammrg/myrg_open.c 2006-12-31 00:02:05 +04:00 +++ 1.36/myisammrg/myrg_open.c 2007-05-22 13:00:49 +05:00 @@ -90,6 +90,7 @@ MYRG_INFO *myrg_open(const char *name, i if (!(isam=mi_open(buff,mode,(handle_locking?HA_OPEN_WAIT_IF_LOCKED:0)))) { my_errno= HA_ERR_WRONG_MRG_TABLE_DEF; + my_error(my_errno, MYF(0), buff); goto err; } if (!m_info) /* First file */ @@ -118,6 +119,7 @@ MYRG_INFO *myrg_open(const char *name, i if (m_info->reclength != isam->s->base.reclength) { my_errno=HA_ERR_WRONG_MRG_TABLE_DEF; + my_error(my_errno, MYF(0), buff); goto err; } m_info->options|= isam->s->options; --- 1.89/sql/ha_myisammrg.cc 2007-02-21 15:04:59 +04:00 +++ 1.90/sql/ha_myisammrg.cc 2007-05-22 13:00:49 +05:00 @@ -122,6 +122,7 @@ int ha_myisammrg::open(const char *name, DBUG_PRINT("error",("reclength: %lu mean_rec_length: %lu", table->s->reclength, mean_rec_length)); error= HA_ERR_WRONG_MRG_TABLE_DEF; + my_error(error, MYF(0), file->open_tables->table->filename); goto err; } if ((error= table2myisam(table, &keyinfo, &recinfo, &recs))) @@ -141,6 +142,7 @@ int ha_myisammrg::open(const char *name, { my_free((gptr) recinfo, MYF(0)); error= HA_ERR_WRONG_MRG_TABLE_DEF; + my_error(error, MYF(0), u_table->table->filename); goto err; } } @@ -149,7 +151,7 @@ int ha_myisammrg::open(const char *name, /* Merge table has more than 2G rows */ if (table->s->crashed) { - error= HA_ERR_WRONG_MRG_TABLE_DEF; + error= HA_ERR_RECORD_FILE_FULL; goto err; } #endif --- 1.231/sql/handler.cc 2007-04-05 08:30:15 +05:00 +++ 1.232/sql/handler.cc 2007-05-22 13:00:49 +05:00 @@ -1753,7 +1753,8 @@ void handler::print_error(int error, myf textno=ER_KEY_NOT_FOUND; break; case HA_ERR_WRONG_MRG_TABLE_DEF: - textno=ER_WRONG_MRG_TABLE; + /* Error is reported by the handler. */ + DBUG_VOID_RETURN; break; case HA_ERR_FOUND_DUPP_KEY: { --- 1.78/sql/share/errmsg.txt 2007-02-23 20:36:00 +04:00 +++ 1.79/sql/share/errmsg.txt 2007-05-22 13:00:49 +05:00 @@ -3809,7 +3809,7 @@ ER_WRONG_KEY_COLUMN 42000 spa "El manipulador de tabla usado no puede indexar columna '%-.64s'" swe "Den använda tabelltypen kan inte indexera kolumn '%-.64s'" ukr "÷ÉËÏÒÉÓÔÁÎÉÊ ×ËÁÚ¦×ÎÉË ÔÁÂÌÉæ ÎÅ ÍÏÖÅ ¦ÎÄÅËÓÕ×ÁÔÉ ÓÔÏ×ÂÅÃØ '%-.64s'" -ER_WRONG_MRG_TABLE +ER_WRONG_MRG_TABLE_UNUSED cze "V-B¹echny tabulky v MERGE tabulce nejsou definovány stejnì" dan "Tabellerne i MERGE er ikke defineret ens" nla "Niet alle tabellen in de MERGE tabel hebben identieke gedefinities" @@ -5633,4 +5633,5 @@ ER_WRONG_STRING_LENGTH eng "String '%-.70s' is too long for %s (should be no longer than %d)" ER_NON_INSERTABLE_TABLE eng "The target table %-.100s of the %s is not insertable-into" - +ER_WRONG_MRG_TABLE + eng "Table '%-.64s' is differently defined or of non-MyISAM type or doesn't exist" --- 1.60/mysql-test/r/merge.result 2007-04-18 16:22:21 +05:00 +++ 1.61/mysql-test/r/merge.result 2007-05-22 13:00:49 +05:00 @@ -178,9 +178,9 @@ t3 CREATE TABLE `t3` ( ) ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 UNION=(`t1`,`t2`) create table t4 (a int not null, b char(10), key(a)) engine=MERGE UNION=(t1,t2); select * from t4; -ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +ERROR HY000: Table './test/t1' is differently defined or of non-MyISAM type or doesn't exist alter table t4 add column c int; -ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +ERROR HY000: Table './test/t1' is differently defined or of non-MyISAM type or doesn't exist create database mysqltest; create table mysqltest.t6 (a int not null primary key auto_increment, message char(20)); create table t5 (a int not null, b char(20), key(a)) engine=MERGE UNION=(test.t1,mysqltest.t6); @@ -772,36 +772,36 @@ CREATE TABLE t1(a INT); INSERT INTO t1 VALUES(2),(1); CREATE TABLE t2(a INT, KEY(a)) ENGINE=MERGE UNION=(t1); SELECT * FROM t2 WHERE a=2; -ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +ERROR HY000: Table './test/t1' is differently defined or of non-MyISAM type or doesn't exist DROP TABLE t1, t2; CREATE TABLE t1(a INT) ENGINE=MEMORY; CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t1); SELECT * FROM t2; -ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +ERROR HY000: Table './test/t1' is differently defined or of non-MyISAM type or doesn't exist DROP TABLE t1, t2; CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3); SELECT * FROM t2; -ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +ERROR HY000: Table './test/t3' 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); SELECT * FROM tm1; -ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +ERROR HY000: Table './test/t1' is differently defined or of non-MyISAM type or doesn't exist DROP TABLE t1, tm1; CREATE TABLE t1(a SMALLINT, b SMALLINT); CREATE TABLE tm1(a INT) ENGINE=MERGE UNION=(t1); SELECT * FROM tm1; -ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +ERROR HY000: Table './test/t1' is differently defined or of non-MyISAM type or doesn't exist DROP TABLE t1, tm1; CREATE TABLE t1(a SMALLINT, b SMALLINT, KEY(a, b)); CREATE TABLE tm1(a SMALLINT, b SMALLINT, KEY(a)) ENGINE=MERGE UNION=(t1); SELECT * FROM tm1; -ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +ERROR HY000: Table './test/t1' is differently defined or of non-MyISAM type or doesn't exist DROP TABLE t1, tm1; CREATE TABLE t1(a SMALLINT, b SMALLINT, KEY(b)); CREATE TABLE tm1(a SMALLINT, b SMALLINT, KEY(a)) ENGINE=MERGE UNION=(t1); SELECT * FROM tm1; -ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist +ERROR HY000: Table './test/t1' is differently defined or of non-MyISAM type or doesn't exist DROP TABLE t1, tm1; CREATE TABLE t1(c1 VARCHAR(1)); CREATE TABLE m1 LIKE t1; --- 1.50/mysql-test/t/merge.test 2007-04-18 16:20:04 +05:00 +++ 1.51/mysql-test/t/merge.test 2007-05-22 13:00:49 +05:00 @@ -47,9 +47,9 @@ show create table t3; # The following should give errors create table t4 (a int not null, b char(10), key(a)) engine=MERGE UNION=(t1,t2); ---error 1168 +--error 143 select * from t4; ---error 1168 +--error 143 alter table t4 add column c int; # @@ -385,7 +385,7 @@ drop table t1, t2, t3; CREATE TABLE t1(a INT); INSERT INTO t1 VALUES(2),(1); CREATE TABLE t2(a INT, KEY(a)) ENGINE=MERGE UNION=(t1); ---error 1168 +--error 143 SELECT * FROM t2 WHERE a=2; DROP TABLE t1, t2; @@ -395,11 +395,11 @@ DROP TABLE t1, t2; # CREATE TABLE t1(a INT) ENGINE=MEMORY; CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t1); ---error 1168 +--error 143 SELECT * FROM t2; DROP TABLE t1, t2; CREATE TABLE t2(a INT) ENGINE=MERGE UNION=(t3); ---error 1168 +--error 143 SELECT * FROM t2; DROP TABLE t2; @@ -408,25 +408,25 @@ DROP TABLE t2; # CREATE TABLE t1(a INT, b TEXT); CREATE TABLE tm1(a TEXT, b INT) ENGINE=MERGE UNION=(t1); ---error 1168 +--error 143 SELECT * FROM tm1; DROP TABLE t1, tm1; CREATE TABLE t1(a SMALLINT, b SMALLINT); CREATE TABLE tm1(a INT) ENGINE=MERGE UNION=(t1); ---error 1168 +--error 143 SELECT * FROM tm1; DROP TABLE t1, tm1; CREATE TABLE t1(a SMALLINT, b SMALLINT, KEY(a, b)); CREATE TABLE tm1(a SMALLINT, b SMALLINT, KEY(a)) ENGINE=MERGE UNION=(t1); ---error 1168 +--error 143 SELECT * FROM tm1; DROP TABLE t1, tm1; CREATE TABLE t1(a SMALLINT, b SMALLINT, KEY(b)); CREATE TABLE tm1(a SMALLINT, b SMALLINT, KEY(a)) ENGINE=MERGE UNION=(t1); ---error 1168 +--error 143 SELECT * FROM tm1; DROP TABLE t1, tm1;