From: magnus.blaudd Date: December 19 2011 6:20pm Subject: bzr push into mysql-5.5-cluster-7.2 branch (magnus.blaudd:3738 to 3739) List-Archive: http://lists.mysql.com/commits/142196 Message-Id: <201112191820.pBJIKl4O016389@acsmt358.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 3739 magnus.blaudd@stripped 2011-12-19 [merge] Merge added: mysql-test/suite/ndb_rpl/r/ndb_rpl_ddl_open_trans.result mysql-test/suite/ndb_rpl/t/ndb_rpl_ddl_open_trans.test modified: mysql-test/suite/ndb/r/ndb_multi.result mysql-test/suite/ndb/t/ndb_multi.test sql/ha_ndbcluster.cc sql/ha_ndbcluster_binlog.cc 3738 Jonas Oreland 2011-12-19 [merge] ndb - merge 71 to 72 renamed: storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/DbugTest.java.not_yet => storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/DbugTest.java modified: sql/ha_ndb_index_stat.cc sql/ha_ndb_index_stat.h sql/ha_ndbcluster.cc storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterConnectionImpl.java storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/ClusterConnectionServiceImpl.java storage/ndb/clusterj/clusterj-tie/src/main/java/com/mysql/clusterj/tie/DbugImpl.java storage/ndb/include/ndbapi/NdbIndexStat.hpp storage/ndb/src/kernel/blocks/LocalProxy.cpp storage/ndb/src/kernel/blocks/LocalProxy.hpp storage/ndb/src/ndbapi/NdbIndexStat.cpp storage/ndb/src/ndbapi/NdbIndexStatImpl.cpp storage/ndb/src/ndbapi/NdbIndexStatImpl.hpp storage/ndb/src/ndbapi/ndberror.c storage/ndb/clusterj/clusterj-test/src/main/java/testsuite/clusterj/DbugTest.java === modified file 'mysql-test/suite/ndb/r/ndb_multi.result' --- a/mysql-test/suite/ndb/r/ndb_multi.result 2011-06-17 10:15:04 +0000 +++ b/mysql-test/suite/ndb/r/ndb_multi.result 2011-12-19 17:37:12 +0000 @@ -212,3 +212,9 @@ show tables; Tables_in_test t1 drop table t1; +SHOW TABLES FROM mysql LIKE 'ndb_schema'; +Tables_in_mysql (ndb_schema) +SELECT count(1) FROM INFORMATION_SCHEMA.TABLES +WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME = 'ndb_schema'; +count(1) +0 === modified file 'mysql-test/suite/ndb/t/ndb_multi.test' --- a/mysql-test/suite/ndb/t/ndb_multi.test 2011-06-17 10:15:04 +0000 +++ b/mysql-test/suite/ndb/t/ndb_multi.test 2011-12-19 17:37:12 +0000 @@ -261,3 +261,10 @@ commit; show tables; drop table t1; +# +# The mysql.ndb_schema table should be not be visible in SHOW TABLES +# or I_S.TABLES +# +SHOW TABLES FROM mysql LIKE 'ndb_schema'; +SELECT count(1) FROM INFORMATION_SCHEMA.TABLES + WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME = 'ndb_schema'; === added file 'mysql-test/suite/ndb_rpl/r/ndb_rpl_ddl_open_trans.result' --- a/mysql-test/suite/ndb_rpl/r/ndb_rpl_ddl_open_trans.result 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/ndb_rpl/r/ndb_rpl_ddl_open_trans.result 2011-12-19 17:39:26 +0000 @@ -0,0 +1,53 @@ +include/master-slave.inc +[connection master] +create table t1 ( a int ) engine = ndb; +begin; +insert into t1 values(1); +alter table t1 rename t2; +commit; +drop table t2; +set global ndb_check_shares=1; +set global ndb_check_shares=1; +create table t1 ( a int primary key) engine = ndb; +begin; +insert into t1 values(1); +alter online table t1 add column b int column_format dynamic; +commit; +drop table t1; +set global ndb_check_shares=1; +set global ndb_check_shares=1; +create table t1 ( a int primary key) engine = ndb; +begin; +insert into t1 values(1); +alter offline table t1 add column b int column_format dynamic; +ERROR HY000: Lock wait timeout exceeded; try restarting transaction +commit; +drop table t1; +set global ndb_check_shares=1; +set global ndb_check_shares=1; +create table t1 ( a int primary key, b int) engine = ndb; +begin; +insert into t1 values(1, 1); +create online index ind_b on t1(b); +commit; +drop table t1; +set global ndb_check_shares=1; +set global ndb_check_shares=1; +create table t1 ( a int primary key, b int, index ind_b (b)) engine = ndb; +begin; +insert into t1 values(1, 1); +drop index ind_b on t1; +commit; +drop table t1; +set global ndb_check_shares=1; +set global ndb_check_shares=1; +create database testdb; +create table testdb.t1 (a int) engine = ndb; +begin; +insert into testdb.t1 values(1); +alter database testdb charset = latin1; +commit; +drop database testdb; +set global ndb_check_shares=1; +set global ndb_check_shares=1; +include/rpl_end.inc === added file 'mysql-test/suite/ndb_rpl/t/ndb_rpl_ddl_open_trans.test' --- a/mysql-test/suite/ndb_rpl/t/ndb_rpl_ddl_open_trans.test 1970-01-01 00:00:00 +0000 +++ b/mysql-test/suite/ndb_rpl/t/ndb_rpl_ddl_open_trans.test 2011-12-19 17:39:26 +0000 @@ -0,0 +1,9 @@ +#let $rpl_debug=1; # Magnus + +--source include/have_ndb.inc +--source include/ndb_have_online_alter.inc +--source suite/ndb_rpl/ndb_master-slave.inc + +--source suite/ndb/t/ndb_ddl_open_trans.test + +--source include/rpl_end.inc === modified file 'sql/ha_ndbcluster.cc' --- a/sql/ha_ndbcluster.cc 2011-12-19 14:23:00 +0000 +++ b/sql/ha_ndbcluster.cc 2011-12-19 18:19:35 +0000 @@ -12354,20 +12354,18 @@ ndbcluster_find_files(handlerton *hton, my_hash_free(&ok_tables); my_hash_free(&ndb_tables); - // Delete schema file from files + /* Hide mysql.ndb_schema table */ if (!strcmp(db, NDB_REP_DB)) { - uint count = 0; - while (count++ < files->elements) + LEX_STRING* file_name; + List_iterator it(*files); + while ((file_name= it++)) { - file_name = (LEX_STRING *)files->pop(); if (!strcmp(file_name->str, NDB_SCHEMA_TABLE)) { - DBUG_PRINT("info", ("skip %s.%s table, it should be hidden to user", - NDB_REP_DB, NDB_SCHEMA_TABLE)); - continue; + DBUG_PRINT("info", ("Hiding table '%s.%s'", db, file_name->str)); + it.remove(); } - files->push_back(file_name); } } } // extra bracket to avoid gcc 2.95.3 warning === modified file 'sql/ha_ndbcluster_binlog.cc' --- a/sql/ha_ndbcluster_binlog.cc 2011-12-14 19:46:17 +0000 +++ b/sql/ha_ndbcluster_binlog.cc 2011-12-19 17:39:26 +0000 @@ -3048,6 +3048,9 @@ class Ndb_schema_event_handler { ndbcluster_rename_share(m_thd, share); free_share(&share); // temporary ref. + ndbapi_invalidate_table(schema->db, schema->name); + mysqld_close_cached_table(schema->db, schema->name); + DBUG_VOID_RETURN; } No bundle (reason: useless for push emails).