List:Commits« Previous MessageNext Message »
From:msvensson Date:January 10 2006 9:56am
Subject:bk commit into 5.0 tree (msvensson:1.2014) BUG#13228
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson 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.2014 06/01/10 10:56:43 msvensson@neptunus.(none) +3 -0
  Bug #13228  	open table cache not flushed when table schema changed
   - Close open unused handlers when a schema error occurs.

  mysql-test/t/ndb_alter_table2.test
    1.1 06/01/10 10:56:36 msvensson@neptunus.(none) +83 -0
    New BitKeeper file ``mysql-test/t/ndb_alter_table2.test''

  mysql-test/r/ndb_alter_table2.result
    1.1 06/01/10 10:56:36 msvensson@neptunus.(none) +42 -0
    New BitKeeper file ``mysql-test/r/ndb_alter_table2.result''

  sql/ha_ndbcluster.cc
    1.225 06/01/10 10:56:36 msvensson@neptunus.(none) +7 -0
    When a schema error occurs call close_cached_tables to close any open unused handlers that has opened this table.

  mysql-test/t/ndb_alter_table2.test
    1.0 06/01/10 10:56:36 msvensson@neptunus.(none) +0 -0
    BitKeeper file /home/msvensson/mysql/bug13228/my50-bug13228_minimal/mysql-test/t/ndb_alter_table2.test

  mysql-test/r/ndb_alter_table2.result
    1.0 06/01/10 10:56:36 msvensson@neptunus.(none) +0 -0
    BitKeeper file /home/msvensson/mysql/bug13228/my50-bug13228_minimal/mysql-test/r/ndb_alter_table2.result

# 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:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/bug13228/my50-bug13228_minimal

--- 1.224/sql/ha_ndbcluster.cc	2005-12-18 15:26:30 +01:00
+++ 1.225/sql/ha_ndbcluster.cc	2006-01-10 10:56:36 +01:00
@@ -510,6 +510,13 @@
   case NdbError::SchemaError:
     invalidate_dictionary_cache(TRUE);
 
+    /* Close other open handlers not used by any thread */
+    TABLE_LIST table_list;
+    bzero((char*) &table_list,sizeof(table_list));
+    table_list.db= m_dbname;
+    table_list.alias= table_list.table_name= m_tabname;
+    close_cached_tables(current_thd, 0, (TABLE_LIST*) 0);
+
     if (err.code==284)
     {
       /*
--- New file ---
+++ mysql-test/r/ndb_alter_table2.result	06/01/10 10:56:36
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a INT NOT NULL PRIMARY KEY,
b INT NOT NULL
) ENGINE=ndbcluster;
BEGIN;
INSERT INTO t1 VALUES (9410,9412);
BEGIN;
INSERT INTO t1 VALUES (9411,9412);
BEGIN;
INSERT INTO t1 VALUES (9412,9412);
BEGIN;
INSERT INTO t1 VALUES (9413,9412);
BEGIN;
INSERT INTO t1 VALUES (9414,9412);
BEGIN;
INSERT INTO t1 VALUES (9415,9412);
ROLLBACK;
ROLLBACK;
ROLLBACK;
ROLLBACK;
ROLLBACK;
ROLLBACK;
drop table t1;
CREATE TABLE t1 (
a INT NOT NULL PRIMARY KEY,
b INT NOT NULL,
c INT NOT NULL
) ENGINE=ndbcluster;
select * from t1;
ERROR HY000: Got error 241 'Invalid schema object version' from ndbcluster
select * from t1;
a	b	c
select * from t1;
a	b	c
select * from t1;
a	b	c
select * from t1;
a	b	c
select * from t1;
a	b	c
drop table t1;

--- New file ---
+++ mysql-test/t/ndb_alter_table2.test	06/01/10 10:56:36
-- source include/have_ndb.inc
-- source include/have_multi_ndb.inc
-- source include/not_embedded.inc

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

connect (con1,localhost,root,,test);
connect (con2,localhost,root,,test);
connect (con3,localhost,root,,test);
connect (con4,localhost,root,,test);
connect (con5,localhost,root,,test);
connect (con6,localhost,root,,test);

CREATE TABLE t1 (
  a INT NOT NULL PRIMARY KEY,
  b INT NOT NULL
) ENGINE=ndbcluster;

connection con1;
BEGIN;
INSERT INTO t1 VALUES (9410,9412);
connection con2;
BEGIN;
--send
INSERT INTO t1 VALUES (9411,9412);
connection con3;
BEGIN;
--send
INSERT INTO t1 VALUES (9412,9412);
connection con4;
BEGIN;
--send
INSERT INTO t1 VALUES (9413,9412);
connection con5;
BEGIN;
--send
INSERT INTO t1 VALUES (9414,9412);
connection con6;
BEGIN;
--send
INSERT INTO t1 VALUES (9415,9412);
connection con1;
sleep 1;

ROLLBACK;
connection con2;
reap;
ROLLBACK;
connection con3;
reap;
ROLLBACK;
connection con4;
reap;
ROLLBACK;
connection con5;
reap;
ROLLBACK;
connection con6;
reap;
ROLLBACK;

connection server2;

drop table t1;
CREATE TABLE t1 (
  a INT NOT NULL PRIMARY KEY,
  b INT NOT NULL,
  c INT NOT NULL
) ENGINE=ndbcluster;

connection server1;

--error 1296
select * from t1;
select * from t1;
select * from t1;
select * from t1;
select * from t1;
select * from t1;

drop table t1;

Thread
bk commit into 5.0 tree (msvensson:1.2014) BUG#13228msvensson10 Jan