From b94217491afb463bc16df484f17b0a6e87a780d0 Mon Sep 17 00:00:00 2001 From: "svoj@mysql.com/june.mysql.com" <> Date: Wed, 18 Jul 2007 13:55:50 +0500 Subject: [PATCH 1/6] BUG#29839 - lowercase_table3.test: Cannot find table test/T1 from the internal data dictiona - re-enabled lowercase_table3 test; - added a rule to throw away expected warning to mtr_report.pl; - fixed a test case to produce unique warning. --- mysql-test/lib/mtr_report.pl | 6 +++++- mysql-test/r/lowercase_table3.result | 8 ++++---- mysql-test/t/disabled.def | 1 - mysql-test/t/lowercase_table3.test | 6 +++--- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 306a0fe5d9d..fa38e8507f8 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -362,7 +362,11 @@ sub mtr_report_stats ($) { # BUG#29807 - innodb_mysql.test: Cannot find table test/t2 # from the internal data dictionary - /Cannot find table test\/bug29807 from the internal data dictionary/ + /Cannot find table test\/bug29807 from the internal data dictionary/ or + + # BUG#29839 - lowercase_table3.test: Cannot find table test/T1 + # from the internal data dictiona + /Cannot find table test\/BUG29839 from the internal data dictionary/ ) { next; # Skip these lines diff --git a/mysql-test/r/lowercase_table3.result b/mysql-test/r/lowercase_table3.result index 995a2c0d08a..14cff4f98c9 100644 --- a/mysql-test/r/lowercase_table3.result +++ b/mysql-test/r/lowercase_table3.result @@ -4,7 +4,7 @@ SELECT * from T1; a drop table t1; flush tables; -CREATE TABLE t1 (a int) ENGINE=INNODB; -SELECT * from T1; -ERROR 42S02: Table 'test.T1' doesn't exist -drop table t1; +CREATE TABLE bug29839 (a int) ENGINE=INNODB; +SELECT * from BUG29839; +ERROR 42S02: Table 'test.BUG29839' doesn't exist +drop table bug29839; diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 07c5b4d56a3..9d2b4abc929 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -25,4 +25,3 @@ ctype_big5 : BUG#26711 2007-06-21 Lars Test has never worked on Do mysql_upgrade : Bug#28560 test links to /usr/local/mysql/lib libraries, causes non-determinism and failures on ABI breakage federated_innodb : Bug#29522 failed assertion in binlog_close_connection() -lowercase_table3 : Bug#29839 2007-07-17 ingo Cannot find table test/T1 from the internal data dictionary diff --git a/mysql-test/t/lowercase_table3.test b/mysql-test/t/lowercase_table3.test index 75f6e5188c5..51385b4b178 100644 --- a/mysql-test/t/lowercase_table3.test +++ b/mysql-test/t/lowercase_table3.test @@ -27,9 +27,9 @@ flush tables; # storing things in lower case. # -CREATE TABLE t1 (a int) ENGINE=INNODB; +CREATE TABLE bug29839 (a int) ENGINE=INNODB; --error 1146 -SELECT * from T1; -drop table t1; +SELECT * from BUG29839; +drop table bug29839; # End of 4.1 tests From 17d5af9922999912a323bdfcde9dc7460cedf253 Mon Sep 17 00:00:00 2001 From: "svoj@mysql.com/june.mysql.com" <> Date: Wed, 18 Jul 2007 15:39:13 +0500 Subject: [PATCH 2/6] BUG#28838 - duplicate external_lock in mysql_alter_table Removed duplicate call to handler::external_lock() when ALTER TABLE that doesn't need to copy a table (quick ALTER TABLE) was executed. Also quick ALTER TABLE doesn't hold LOCK_open anymore when it enables/disables indexes. --- sql/sql_table.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 87f23097a66..277d6d76ead 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3789,11 +3789,9 @@ view_err: { VOID(pthread_mutex_lock(&LOCK_open)); wait_while_table_is_used(thd, table, HA_EXTRA_FORCE_REOPEN); - table->file->external_lock(thd, F_WRLCK); + VOID(pthread_mutex_unlock(&LOCK_open)); alter_table_manage_keys(table, table->file->indexes_are_disabled(), alter_info->keys_onoff); - table->file->external_lock(thd, F_UNLCK); - VOID(pthread_mutex_unlock(&LOCK_open)); error= ha_commit_stmt(thd); if (ha_commit(thd)) error= 1; From 5d4a134f8f66edcfed5042e8f9f374ffb359f233 Mon Sep 17 00:00:00 2001 From: "svoj@mysql.com/june.mysql.com" <> Date: Thu, 19 Jul 2007 13:51:31 +0500 Subject: [PATCH 3/6] BUG#26325 - TEMPORARY TABLE "corrupt" after first read, according to CHECK TABLE CHECK/REPAIR TABLE reports "File not found" error when issued against temporary table. Fixed by disabling a brunch of code (in case it gets temporary table) that is responsible for updating frm version as it is not needed for temporary tables. --- mysql-test/r/check.result | 8 ++++++++ mysql-test/t/check.test | 9 +++++++++ sql/handler.cc | 8 +++++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/check.result b/mysql-test/r/check.result index 60806e7393e..03219d0977e 100644 --- a/mysql-test/r/check.result +++ b/mysql-test/r/check.result @@ -14,3 +14,11 @@ test.v1 check status OK test.t2 check status OK drop view v1; drop table t1, t2; +CREATE TEMPORARY TABLE t1(a INT); +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +REPAIR TABLE t1; +Table Op Msg_type Msg_text +test.t1 repair status OK +DROP TABLE t1; diff --git a/mysql-test/t/check.test b/mysql-test/t/check.test index 8d9d70bd29a..698f6538529 100644 --- a/mysql-test/t/check.test +++ b/mysql-test/t/check.test @@ -36,3 +36,12 @@ Create view v1 as Select * from t1; Check Table v1,t2; drop view v1; drop table t1, t2; + +# +# BUG#26325 - TEMPORARY TABLE "corrupt" after first read, according to CHECK +# TABLE +# +CREATE TEMPORARY TABLE t1(a INT); +CHECK TABLE t1; +REPAIR TABLE t1; +DROP TABLE t1; diff --git a/sql/handler.cc b/sql/handler.cc index f8aec72ec90..dcc9fde8b76 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -1997,7 +1997,13 @@ static bool update_frm_version(TABLE *table, bool needs_lock) int result= 1; DBUG_ENTER("update_frm_version"); - if (table->s->mysql_version != MYSQL_VERSION_ID) + /* + No need to update frm version in case table was created or checked + by server with the same version. This also ensures that we do not + update frm version for temporary tables as this code doesn't support + temporary tables. + */ + if (table->s->mysql_version == MYSQL_VERSION_ID) DBUG_RETURN(0); strxnmov(path, sizeof(path)-1, mysql_data_home, "/", table->s->db, "/", From 2edad3d4ba27cc930d2628d0772e82d3b1c3ae9a Mon Sep 17 00:00:00 2001 From: "svoj@mysql.com/june.mysql.com" <> Date: Fri, 20 Jul 2007 13:27:12 +0500 Subject: [PATCH 4/6] BUG#28838 - duplicate external_lock in mysql_alter_table Fixed wrong test case. Added lost row that appeared after fix for this bug. --- mysql-test/r/alter_table.result | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysql-test/r/alter_table.result b/mysql-test/r/alter_table.result index a9c01f308f7..cc93eab0cd5 100644 --- a/mysql-test/r/alter_table.result +++ b/mysql-test/r/alter_table.result @@ -1030,6 +1030,7 @@ select * from t2; c NULL 1 +Two Three lock table t2 write, t3 read; alter table t2 change c vc varchar(100) default "Four", rename to t1; @@ -1046,6 +1047,7 @@ select * from t1; vc NULL 1 +Two Three Four drop tables t1, t3; From 395233b4f78d061584ec1246264ad49eebf6b798 Mon Sep 17 00:00:00 2001 From: "acurtis/antony@xiphis.org/ltamd64.xiphis.org" <> Date: Fri, 20 Jul 2007 11:35:19 -0700 Subject: [PATCH 5/6] Bug#29875 "Disable transaction support in Federated storage engine" Minimal patch to disable Federated's transactions until they can be fixed. --- mysql-test/r/federated.result | 22 ++++++++++++++++++++++ mysql-test/t/disabled.def | 1 + mysql-test/t/federated.test | 26 ++++++++++++++++++++++++++ storage/federated/ha_federated.cc | 12 ++++++++++++ storage/federated/ha_federated.h | 1 + 5 files changed, 62 insertions(+) diff --git a/mysql-test/r/federated.result b/mysql-test/r/federated.result index 42228fac2c9..690cc803608 100644 --- a/mysql-test/r/federated.result +++ b/mysql-test/r/federated.result @@ -1882,6 +1882,28 @@ a b 2 Curly drop table federated.t1; drop table federated.t1; +CREATE TABLE federated.t1 (a INT PRIMARY KEY) DEFAULT CHARSET=utf8; +CREATE TABLE federated.t1 (a INT PRIMARY KEY) +ENGINE=FEDERATED +CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1' + DEFAULT CHARSET=utf8; +SELECT transactions FROM information_schema.engines WHERE engine="FEDERATED"; +transactions +NO +INSERT INTO federated.t1 VALUES (1); +SET autocommit=0; +INSERT INTO federated.t1 VALUES (2); +ROLLBACK; +Warnings: +Warning 1196 Some non-transactional changed tables couldn't be rolled back +SET autocommit=1; +SELECT * FROM federated.t1; +a +1 +2 +DROP TABLE federated.t1; +DROP TABLE federated.t1; +End of 5.1 tests DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 07c5b4d56a3..14b6979dd19 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -25,4 +25,5 @@ ctype_big5 : BUG#26711 2007-06-21 Lars Test has never worked on Do mysql_upgrade : Bug#28560 test links to /usr/local/mysql/lib libraries, causes non-determinism and failures on ABI breakage federated_innodb : Bug#29522 failed assertion in binlog_close_connection() +federated_transactions : Bug#29523 Transactions do not work lowercase_table3 : Bug#29839 2007-07-17 ingo Cannot find table test/T1 from the internal data dictionary diff --git a/mysql-test/t/federated.test b/mysql-test/t/federated.test index fa65568e9cc..d54934a2e73 100644 --- a/mysql-test/t/federated.test +++ b/mysql-test/t/federated.test @@ -1683,4 +1683,30 @@ connection slave; drop table federated.t1; +# +# BUG#29875 Disable support for transactions +# +connection slave; +CREATE TABLE federated.t1 (a INT PRIMARY KEY) DEFAULT CHARSET=utf8; +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval CREATE TABLE federated.t1 (a INT PRIMARY KEY) + ENGINE=FEDERATED + CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/federated/t1' + DEFAULT CHARSET=utf8; + +SELECT transactions FROM information_schema.engines WHERE engine="FEDERATED"; +INSERT INTO federated.t1 VALUES (1); +SET autocommit=0; +INSERT INTO federated.t1 VALUES (2); +ROLLBACK; +SET autocommit=1; +SELECT * FROM federated.t1; + +DROP TABLE federated.t1; +connection slave; +DROP TABLE federated.t1; + +--echo End of 5.1 tests + source include/federated_cleanup.inc; diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index 635a6fa79e0..2c9d692bb5b 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -449,6 +449,13 @@ int federated_db_init(void *p) federated_hton->create= federated_create_handler; federated_hton->flags= HTON_ALTER_NOT_SUPPORTED | HTON_NO_PARTITION; + /* + Support for transactions disabled until WL#2952 fixes it. + We do it like this to avoid "defined but not used" compiler warnings. + */ + federated_hton->commit= 0; + federated_hton->rollback= 0; + if (pthread_mutex_init(&federated_mutex, MY_MUTEX_INIT_FAST)) goto error; if (!hash_init(&federated_open_tables, &my_charset_bin, 32, 0, 0, @@ -3163,6 +3170,10 @@ int ha_federated::external_lock(THD *thd, int lock_type) ha_federated *trx= (ha_federated *)thd->ha_data[ht->slot]; DBUG_ENTER("ha_federated::external_lock"); + /* + Support for transactions disabled until WL#2952 fixes it. + */ +#ifdef XXX_SUPERCEDED_BY_WL2952 if (lock_type != F_UNLCK) { DBUG_PRINT("info",("federated not lock F_UNLCK")); @@ -3216,6 +3227,7 @@ int ha_federated::external_lock(THD *thd, int lock_type) } } } +#endif /* XXX_SUPERCEDED_BY_WL2952 */ DBUG_RETURN(0); } diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h index 3443194817b..b6c99f4d3aa 100644 --- a/storage/federated/ha_federated.h +++ b/storage/federated/ha_federated.h @@ -141,6 +141,7 @@ public: | HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_CAN_INDEX_BLOBS | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_NO_PREFIX_CHAR_KEYS | HA_PRIMARY_KEY_REQUIRED_FOR_DELETE | + HA_NO_TRANSACTIONS /* until fixed by WL#2952 */ | HA_PARTIAL_COLUMN_READ | HA_NULL_IN_KEY); } /* From c1ca591f09b36ebe28d4c32b6f8d556901bd1d3d Mon Sep 17 00:00:00 2001 From: "acurtis/antony@xiphis.org/ltamd64.xiphis.org" <> Date: Fri, 20 Jul 2007 14:01:37 -0700 Subject: [PATCH 6/6] silence two 'unused variable' warnings --- storage/federated/ha_federated.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index 2c9d692bb5b..67dc37a8ff2 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -3167,7 +3167,6 @@ bool ha_federated::get_error_message(int error, String* buf) int ha_federated::external_lock(THD *thd, int lock_type) { int error= 0; - ha_federated *trx= (ha_federated *)thd->ha_data[ht->slot]; DBUG_ENTER("ha_federated::external_lock"); /* @@ -3176,6 +3175,8 @@ int ha_federated::external_lock(THD *thd, int lock_type) #ifdef XXX_SUPERCEDED_BY_WL2952 if (lock_type != F_UNLCK) { + ha_federated *trx= (ha_federated *)thd->ha_data[ht->slot]; + DBUG_PRINT("info",("federated not lock F_UNLCK")); if (!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN))) { @@ -3228,7 +3229,7 @@ int ha_federated::external_lock(THD *thd, int lock_type) } } #endif /* XXX_SUPERCEDED_BY_WL2952 */ - DBUG_RETURN(0); + DBUG_RETURN(error); }