From: Jonas Oreland Date: October 17 2011 2:18pm Subject: bzr push into mysql-5.1-telco-7.0 branch (jonas.oreland:4605) List-Archive: http://lists.mysql.com/commits/141478 Message-Id: <20111017141825.965E3A53593@perch.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 4605 Jonas Oreland 2011-10-17 [merge] ndb - merge 70-tip modified: storage/ndb/src/kernel/blocks/qmgr/QmgrMain.cpp storage/ndb/test/ndbapi/testNodeRestart.cpp === added file 'mysql-test/include/not_ndb_is.inc' --- a/mysql-test/include/not_ndb_is.inc 1970-01-01 00:00:00 +0000 +++ b/mysql-test/include/not_ndb_is.inc 2011-10-17 14:16:56 +0000 @@ -0,0 +1,27 @@ +# +# Check if cluster is available by selecting from is.engines +# if an error about no such table occurs bail out +# + +disable_result_log; +disable_query_log; + +--error 0, 1109 +select @have_ndb_is:= count(*) from information_schema.plugins +where plugin_name like '%ndb%' + and PLUGIN_TYPE = 'INFORMATION SCHEMA'; + + +if ($mysql_errno){ + # For backward compatibility, implement old fashioned way + # to check here ie. use SHOW VARIABLES LIKE "have_ndb" + die Can not determine if server supports ndb without is.engines table; +} + + +if (`select @have_ndb_is`){ + skip NDB information schema table installed; +} + +enable_query_log; +enable_result_log; === modified file 'mysql-test/r/information_schema.result' --- a/mysql-test/r/information_schema.result 2011-03-29 14:09:05 +0000 +++ b/mysql-test/r/information_schema.result 2011-10-17 14:16:56 +0000 @@ -39,8 +39,7 @@ insert into t5 values (10); create view v1 (c) as SELECT table_name FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND -table_name<>'ndb_binlog_index' AND -table_name<>'ndb_apply_status'; +table_name not like 'ndb%'; select * from v1; c CHARACTER_SETS @@ -850,7 +849,7 @@ VIEWS TABLE_NAME select delete from mysql.user where user='mysqltest_4'; delete from mysql.db where user='mysqltest_4'; flush privileges; -SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA; +SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name not like 'ndb%' GROUP BY TABLE_SCHEMA; table_schema count(*) information_schema 28 mysql 22 @@ -1230,7 +1229,8 @@ INNER JOIN information_schema.columns c1 ON t.table_schema = c1.table_schema AND t.table_name = c1.table_name -WHERE t.table_schema = 'information_schema' AND +WHERE t.table_name not like 'ndb%' AND +t.table_schema = 'information_schema' AND c1.ordinal_position = ( SELECT COALESCE(MIN(c2.ordinal_position),1) FROM information_schema.columns c2 @@ -1273,7 +1273,8 @@ INNER JOIN information_schema.columns c1 ON t.table_schema = c1.table_schema AND t.table_name = c1.table_name -WHERE t.table_schema = 'information_schema' AND +WHERE t.table_name not like 'ndb%' AND +t.table_schema = 'information_schema' AND c1.ordinal_position = ( SELECT COALESCE(MIN(c2.ordinal_position),1) FROM information_schema.columns c2 @@ -1365,7 +1366,8 @@ count(*) as num1 from information_schema.tables t inner join information_schema.columns c1 on t.table_schema = c1.table_schema AND t.table_name = c1.table_name -where t.table_schema = 'information_schema' and +where t.table_name not like 'ndb%' and +t.table_schema = 'information_schema' and c1.ordinal_position = (select isnull(c2.column_type) - isnull(group_concat(c2.table_schema, '.', c2.table_name)) + === modified file 'mysql-test/r/information_schema_db.result' --- a/mysql-test/r/information_schema_db.result 2010-11-30 17:51:25 +0000 +++ b/mysql-test/r/information_schema_db.result 2011-10-17 14:16:56 +0000 @@ -3,7 +3,7 @@ drop view if exists v1,v2; drop function if exists f1; drop function if exists f2; use INFORMATION_SCHEMA; -show tables; +show tables where Tables_in_information_schema NOT LIKE 'ndb%'; Tables_in_information_schema CHARACTER_SETS COLLATIONS === modified file 'mysql-test/t/information_schema.test' --- a/mysql-test/t/information_schema.test 2010-06-23 16:25:31 +0000 +++ b/mysql-test/t/information_schema.test 2011-10-17 14:16:56 +0000 @@ -44,8 +44,7 @@ insert into t5 values (10); create view v1 (c) as SELECT table_name FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND - table_name<>'ndb_binlog_index' AND - table_name<>'ndb_apply_status'; + table_name not like 'ndb%'; select * from v1; select c,table_name from v1 @@ -539,7 +538,7 @@ flush privileges; # Bug#9404 information_schema: Weird error messages # with SELECT SUM() ... GROUP BY queries # -SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name<>'ndb_binlog_index' AND table_name<>'ndb_apply_status' GROUP BY TABLE_SCHEMA; +SELECT table_schema, count(*) FROM information_schema.TABLES WHERE table_schema IN ('mysql', 'INFORMATION_SCHEMA', 'test', 'mysqltest') AND table_name not like 'ndb%' GROUP BY TABLE_SCHEMA; # @@ -921,7 +920,8 @@ SELECT t.table_name, c1.column_name information_schema.columns c1 ON t.table_schema = c1.table_schema AND t.table_name = c1.table_name - WHERE t.table_schema = 'information_schema' AND + WHERE t.table_name not like 'ndb%' AND + t.table_schema = 'information_schema' AND c1.ordinal_position = ( SELECT COALESCE(MIN(c2.ordinal_position),1) FROM information_schema.columns c2 @@ -935,7 +935,8 @@ SELECT t.table_name, c1.column_name information_schema.columns c1 ON t.table_schema = c1.table_schema AND t.table_name = c1.table_name - WHERE t.table_schema = 'information_schema' AND + WHERE t.table_name not like 'ndb%' AND + t.table_schema = 'information_schema' AND c1.ordinal_position = ( SELECT COALESCE(MIN(c2.ordinal_position),1) FROM information_schema.columns c2 @@ -1032,7 +1033,8 @@ select t.table_name, group_concat(t.tabl from information_schema.tables t inner join information_schema.columns c1 on t.table_schema = c1.table_schema AND t.table_name = c1.table_name -where t.table_schema = 'information_schema' and +where t.table_name not like 'ndb%' and + t.table_schema = 'information_schema' and c1.ordinal_position = (select isnull(c2.column_type) - isnull(group_concat(c2.table_schema, '.', c2.table_name)) + === modified file 'mysql-test/t/information_schema_db.test' --- a/mysql-test/t/information_schema_db.test 2009-09-28 11:25:47 +0000 +++ b/mysql-test/t/information_schema_db.test 2011-10-17 14:16:56 +0000 @@ -13,7 +13,7 @@ drop function if exists f2; use INFORMATION_SCHEMA; --replace_result Tables_in_INFORMATION_SCHEMA Tables_in_information_schema -show tables; +show tables where Tables_in_INFORMATION_SCHEMA NOT LIKE 'ndb%'; --replace_result 'Tables_in_INFORMATION_SCHEMA (T%)' 'Tables_in_information_schema (T%)' show tables from INFORMATION_SCHEMA like 'T%'; create database `inf%`; === modified file 'mysql-test/t/mysqlshow.test' --- a/mysql-test/t/mysqlshow.test 2006-07-22 03:29:25 +0000 +++ b/mysql-test/t/mysqlshow.test 2011-10-17 14:16:56 +0000 @@ -1,6 +1,9 @@ # Can't run test of external client with embedded server -- source include/not_embedded.inc +# Test lists tables in Information_schema, and ndb adds some +-- source include/not_ndb_is.inc + --disable_warnings DROP TABLE IF EXISTS t1,t2,test1,test2; --enable_warnings === modified file 'storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp' --- a/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2011-10-13 09:51:01 +0000 +++ b/storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp 2011-10-17 13:32:49 +0000 @@ -23447,12 +23447,8 @@ Dblqh::ndbinfo_write_op(Ndbinfo::Row & r row.write_uint32(tcPtr.p->tcBlockref); // tcref row.write_uint32(tcPtr.p->applRef); // apiref - char transid[64]; - BaseString::snprintf(transid, sizeof(transid), - "%.8x.%.8x", - tcPtr.p->transid[0], - tcPtr.p->transid[1]); - row.write_string(transid); + row.write_uint32(tcPtr.p->transid[0]); + row.write_uint32(tcPtr.p->transid[1]); row.write_uint32(tcPtr.p->tableref); row.write_uint32(tcPtr.p->fragmentid); === modified file 'storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp' --- a/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2011-10-13 09:51:01 +0000 +++ b/storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp 2011-10-17 13:32:49 +0000 @@ -13343,17 +13343,12 @@ Dbtc::ndbinfo_write_trans(Ndbinfo::Row & return false; } - char transid[64]; - BaseString::snprintf(transid, sizeof(transid), - "%.8x.%.8x", - transPtr.p->transid[0], - transPtr.p->transid[1]); - row.write_uint32(getOwnNodeId()); row.write_uint32(instance()); // block instance row.write_uint32(transPtr.i); row.write_uint32(transPtr.p->ndbapiBlockref); - row.write_string(transid); + row.write_uint32(transPtr.p->transid[0]); + row.write_uint32(transPtr.p->transid[1]); row.write_uint32(conState); row.write_uint32(transPtr.p->m_flags); row.write_uint32(transPtr.p->lqhkeyreqrec); === modified file 'storage/ndb/src/kernel/vm/NdbinfoTables.cpp' --- a/storage/ndb/src/kernel/vm/NdbinfoTables.cpp 2011-10-13 09:13:33 +0000 +++ b/storage/ndb/src/kernel/vm/NdbinfoTables.cpp 2011-10-17 13:32:49 +0000 @@ -204,14 +204,15 @@ DECLARE_NDBINFO_TABLE(THREADSTAT, 18) = } }; -DECLARE_NDBINFO_TABLE(TRANSACTIONS, 10) = -{ { "transactions", 10, 0, "transactions" }, +DECLARE_NDBINFO_TABLE(TRANSACTIONS, 11) = +{ { "transactions", 11, 0, "transactions" }, { {"node_id", Ndbinfo::Number, "node id"}, {"block_instance", Ndbinfo::Number, "TC instance no"}, {"objid", Ndbinfo::Number, "Object id of transaction object"}, {"apiref", Ndbinfo::Number, "API reference"}, - {"transid", Ndbinfo::String, "Transaction id"}, + {"transid0", Ndbinfo::Number, "Transaction id"}, + {"transid1", Ndbinfo::Number, "Transaction id"}, {"state", Ndbinfo::Number, "Transaction state"}, {"flags", Ndbinfo::Number, "Transaction flags"}, {"c_ops", Ndbinfo::Number, "No of operations in transaction" }, @@ -220,15 +221,16 @@ DECLARE_NDBINFO_TABLE(TRANSACTIONS, 10) } }; -DECLARE_NDBINFO_TABLE(OPERATIONS, 11) = -{ { "operations", 11, 0, "operations" }, +DECLARE_NDBINFO_TABLE(OPERATIONS, 12) = +{ { "operations", 12, 0, "operations" }, { {"node_id", Ndbinfo::Number, "node id"}, {"block_instance", Ndbinfo::Number, "LQH instance no"}, {"objid", Ndbinfo::Number, "Object id of operation object"}, {"tcref", Ndbinfo::Number, "TC reference"}, {"apiref", Ndbinfo::Number, "API reference"}, - {"transid", Ndbinfo::String, "Transaction id"}, + {"transid0", Ndbinfo::Number, "Transaction id"}, + {"transid1", Ndbinfo::Number, "Transaction id"}, {"tableid", Ndbinfo::Number, "Table id"}, {"fragmentid", Ndbinfo::Number, "Fragment id"}, {"op", Ndbinfo::Number, "Operation type"}, No bundle (reason: useless for push emails).