From 07908a45448f5eeaa536f7798a0ed4b548c5e1c7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Jan 2006 14:38:38 +0100 Subject: [PATCH 1/3] bug#16125 - ndb bitfield of exact 32 bits, incorrect assertion (i.e. only noticable in debug compiled) mysql-test/r/ndb_bitfield.result: bug#16125 mysql-test/t/ndb_bitfield.test: bug#16125 ndb/include/util/Bitmask.hpp: bug#16125 --- mysql-test/r/ndb_bitfield.result | 6 ++++++ mysql-test/t/ndb_bitfield.test | 8 ++++++++ ndb/include/util/Bitmask.hpp | 4 ++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/ndb_bitfield.result b/mysql-test/r/ndb_bitfield.result index bf5a9b1ade1..9a941862854 100644 --- a/mysql-test/r/ndb_bitfield.result +++ b/mysql-test/r/ndb_bitfield.result @@ -208,3 +208,9 @@ b bit(9), key(b) ) engine=ndbcluster; ERROR HY000: Can't create table './test/t1.frm' (errno: 743) +create table t1 ( +pk1 int primary key, +b bit(32) not null +) engine=ndbcluster; +insert into t1 values (1,1); +drop table t1; diff --git a/mysql-test/t/ndb_bitfield.test b/mysql-test/t/ndb_bitfield.test index 0256ecf89ed..59d6e56577e 100644 --- a/mysql-test/t/ndb_bitfield.test +++ b/mysql-test/t/ndb_bitfield.test @@ -112,3 +112,11 @@ create table t1 ( key(b) ) engine=ndbcluster; +# bug#16125 +create table t1 ( + pk1 int primary key, + b bit(32) not null +) engine=ndbcluster; + +insert into t1 values (1,1); +drop table t1; diff --git a/ndb/include/util/Bitmask.hpp b/ndb/include/util/Bitmask.hpp index ade57a5ee57..7957bf7a48d 100644 --- a/ndb/include/util/Bitmask.hpp +++ b/ndb/include/util/Bitmask.hpp @@ -814,7 +814,7 @@ inline void BitmaskImpl::getField(unsigned size, const Uint32 src[], unsigned pos, unsigned len, Uint32 dst[]) { - assert(pos + len < (size << 5)); + assert(pos + len <= (size << 5)); src += (pos >> 5); Uint32 offset = pos & 31; @@ -833,7 +833,7 @@ inline void BitmaskImpl::setField(unsigned size, Uint32 dst[], unsigned pos, unsigned len, const Uint32 src[]) { - assert(pos + len < (size << 5)); + assert(pos + len <= (size << 5)); dst += (pos >> 5); Uint32 offset = pos & 31; From 522bbb83046e746a524caba646eba7f7e0b3f3d1 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 4 Jan 2006 11:38:58 +0100 Subject: [PATCH 2/3] ndb - Make testDatabuffer clean up tables ndb/test/ndbapi/testDataBuffers.cpp: Make testDatabuffer clean up tables --- ndb/test/ndbapi/testDataBuffers.cpp | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/ndb/test/ndbapi/testDataBuffers.cpp b/ndb/test/ndbapi/testDataBuffers.cpp index 03d52252334..27e241fa87a 100644 --- a/ndb/test/ndbapi/testDataBuffers.cpp +++ b/ndb/test/ndbapi/testDataBuffers.cpp @@ -254,12 +254,6 @@ testcase(int flag) ndbout << "tab=" << tab << " cols=" << attrcnt << " size max=" << smax << " tot=" << stot << endl; - ndb = new Ndb("TEST_DB"); - if (ndb->init() != 0) - return ndberror("init"); - if (ndb->waitUntilReady(30) < 0) - return ndberror("waitUntilReady"); - if ((tcon = NdbSchemaCon::startSchemaTrans(ndb)) == 0) return ndberror("startSchemaTransaction"); if ((top = tcon->getNdbSchemaOp()) == 0) @@ -541,7 +535,6 @@ testcase(int flag) return ndberror("key %d not found", k); ndbout << "scanned " << key << endl; - ndb = 0; ndbout << "done" << endl; return 0; } @@ -605,7 +598,23 @@ NDB_COMMAND(testDataBuffers, "testDataBuffers", "testDataBuffers", "testDataBuff return NDBT_ProgramExit(NDBT_WRONGARGS); } } + unsigned ok = true; + + ndb = new Ndb("TEST_DB"); + if (ndb->init() != 0) + { + ndberror("init"); + ok = false; + goto out; + } + if (ndb->waitUntilReady(30) < 0) + { + ndberror("waitUntilReady"); + ok = false; + goto out; + } + for (i = 1; 0 == loopcnt || i <= loopcnt; i++) { ndbout << "=== loop " << i << " ===" << endl; for (int flag = 0; flag < (1<getDictionary(); + dict->dropTable(tab); } } + out: + delete ndb; return NDBT_ProgramExit(ok ? NDBT_OK : NDBT_FAILED); } From b9e1c443b8876ff1ca7e27f57687f2523f212b83 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 13 Jan 2006 07:40:15 +0100 Subject: [PATCH 3/3] bug#15619 - ndb_autodiscover sometimes fails ndb/src/mgmsrv/MgmtSrvr.cpp: Make sure that node allocating id is allowed to transporter connect --- ndb/src/mgmsrv/MgmtSrvr.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ndb/src/mgmsrv/MgmtSrvr.cpp b/ndb/src/mgmsrv/MgmtSrvr.cpp index 34a0adf46b9..816b71bd816 100644 --- a/ndb/src/mgmsrv/MgmtSrvr.cpp +++ b/ndb/src/mgmsrv/MgmtSrvr.cpp @@ -1868,6 +1868,16 @@ MgmtSrvr::alloc_node_id(NodeId * nodeId, m_connect_address[id_found].s_addr= 0; } m_reserved_nodes.set(id_found); + if (theFacade && id_found != theFacade->ownId()) + { + /** + * Make sure we're ready to accept connections from this node + */ + theFacade->lock_mutex(); + theFacade->doConnect(id_found); + theFacade->unlock_mutex(); + } + char tmp_str[128]; m_reserved_nodes.getText(tmp_str); g_eventLogger.info("Mgmt server state: nodeid %d reserved for ip %s, m_reserved_nodes %s.",