MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:antony Date:May 31 2006 11:59pm
Subject:bk commit into 4.1 tree (acurtis:1.2487) BUG#8710
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of antony. When antony 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
  1.2487 06/05/31 16:59:16 acurtis@stripped +5 -0
  Bug#8710
    "some strange erraneous cache of merge tables"
    Don't cache MERGE tables in open table cache

  sql/sql_base.cc
    1.272 06/05/31 16:59:12 acurtis@stripped +2 -1
    Don't cache MERGE tables in open table cache

  mysql-test/t/myisam.test
    1.46 06/05/31 16:59:12 acurtis@stripped +8 -0
    use lock tables to keep merge open

  mysql-test/t/merge.test
    1.39 06/05/31 16:59:12 acurtis@stripped +13 -0
    Test for Bug#8710

  mysql-test/r/myisam.result
    1.60 06/05/31 16:59:12 acurtis@stripped +2 -0
    use lock tables to keep merge open

  mysql-test/r/merge.result
    1.41 06/05/31 16:59:12 acurtis@stripped +11 -0
    Test for Bug#8710

# 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:	acurtis
# Host:	localhost.(none)
# Root:	/home/antony/work2/p2-bug8710.1

--- 1.271/sql/sql_base.cc	2006-05-30 00:08:51 -07:00
+++ 1.272/sql/sql_base.cc	2006-05-31 16:59:12 -07:00
@@ -436,7 +436,8 @@ bool close_thread_table(THD *thd, TABLE 
 
   *table_ptr=table->next;
   if (table->version != refresh_version ||
-      thd->version != refresh_version || !table->db_stat)
+      thd->version != refresh_version || !table->db_stat ||
+      table->db_type == DB_TYPE_MRG_MYISAM /* use handlerton flags in 5.x */)
   {
     VOID(hash_delete(&open_cache,(byte*) table));
     found_old_table=1;

--- 1.40/mysql-test/r/merge.result	2005-12-07 10:54:06 -08:00
+++ 1.41/mysql-test/r/merge.result	2006-05-31 16:59:12 -07:00
@@ -766,3 +766,14 @@ Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 test.t2	check	status	OK
 drop table t1, t2, t3;
+create table t1 (a int) select 1 a;
+create table t2 (a int) select 2 a;
+create table tm (a int) ENGINE='MERGE' UNION (t1, t2);
+select * from tm;
+a
+1
+2
+drop table t1;
+select * from tm;
+ERROR HY000: Can't find file: 'tm.MRG' (errno: 2)
+drop table tm, t2;

--- 1.38/mysql-test/t/merge.test	2005-12-07 10:57:53 -08:00
+++ 1.39/mysql-test/t/merge.test	2006-05-31 16:59:12 -07:00
@@ -376,4 +376,17 @@ select * from t3;
 check table t1, t2;
 drop table t1, t2, t3;
 
+
+#
+# BUG#8710 - erraneous cache of merge tables
+#
+create table t1 (a int) select 1 a;
+create table t2 (a int) select 2 a;
+create table tm (a int) ENGINE='MERGE' UNION (t1, t2);
+select * from tm;
+drop table t1;
+--error 1017
+select * from tm;
+drop table tm, t2;
+
 # End of 4.1 tests

--- 1.59/mysql-test/r/myisam.result	2006-03-10 06:03:00 -08:00
+++ 1.60/mysql-test/r/myisam.result	2006-05-31 16:59:12 -07:00
@@ -576,11 +576,13 @@ flush tables;
 truncate table t1;
 insert into t1 values (1);
 flush tables;
+lock tables t2 read;
 select * from t2;
 c1
 1
 truncate table t1;
 ERROR HY000: MyISAM table 't1' is in use (most likely by a MERGE table). Try FLUSH TABLES.
+unlock tables;
 insert into t1 values (1);
 drop table t1,t2;
 create table t1 (c1 int, c2 varchar(4) not null default '',

--- 1.45/mysql-test/t/myisam.test	2006-03-10 06:03:00 -08:00
+++ 1.46/mysql-test/t/myisam.test	2006-05-31 16:59:12 -07:00
@@ -552,12 +552,20 @@ truncate table t1;
 insert into t1 values (1);
 # Close all tables.
 flush tables;
+connect (con1,localhost,root,,);
+connection con1;
 # Open t2 and (implicitly) t1.
+lock tables t2 read;
 select * from t2;
+connection default;
 # Truncate t1, wich was not recognized as open without the bugfix.
 # Now, it should fail with a table-in-use error message.
 --error 1105
 truncate table t1;
+connection con1;
+unlock tables;
+disconnect con1;
+connection default;
 # The insert used to fail on the crashed table.
 insert into t1 values (1);
 drop table t1,t2;
Thread
bk commit into 4.1 tree (acurtis:1.2487) BUG#8710antony1 Jun