summaryrefslogtreecommitdiff
path: root/storage/ndb
diff options
context:
space:
mode:
authorunknown <tomas@poseidon.ndb.mysql.com>2006-03-11 07:26:58 +0100
committerunknown <tomas@poseidon.ndb.mysql.com>2006-03-11 07:26:58 +0100
commitc2db8a7ffc9eb971708db03a8c1c5f9645ea5ac6 (patch)
tree45ede758be8668f99f147a3cda9ba47d9190eae6 /storage/ndb
parenta264a79eb769bb156e9fa9f96025272ef48f6395 (diff)
parent9376ec63366fac379c9c9fc90dd1dc1a43872134 (diff)
downloadmariadb-git-c2db8a7ffc9eb971708db03a8c1c5f9645ea5ac6.tar.gz
Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into poseidon.ndb.mysql.com:/home/tomas/mysql-5.1-new mysql-test/t/disabled.def: Auto merged mysql-test/t/ndb_binlog_ddl_multi.test: Auto merged sql/rpl_injector.cc: Auto merged storage/ndb/src/kernel/blocks/suma/Suma.cpp: Auto merged sql/ha_ndbcluster_binlog.cc: manual merge
Diffstat (limited to 'storage/ndb')
-rw-r--r--storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp2
-rw-r--r--storage/ndb/src/kernel/blocks/suma/Suma.cpp9
-rw-r--r--storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp22
-rw-r--r--storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp6
4 files changed, 32 insertions, 7 deletions
diff --git a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
index ba5920415e9..25eea0087b4 100644
--- a/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+++ b/storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp
@@ -348,7 +348,7 @@ void Dbdict::packTableIntoPages(Signal* signal)
memset(&pagePtr.p->word[0], 0, 4 * ZPAGE_HEADER_SIZE);
LinearWriter w(&pagePtr.p->word[ZPAGE_HEADER_SIZE],
- 8 * ZSIZE_OF_PAGES_IN_WORDS);
+ ZMAX_PAGES_OF_TABLE_DEFINITION * ZSIZE_OF_PAGES_IN_WORDS);
w.first();
switch((DictTabInfo::TableType)type) {
case DictTabInfo::SystemTable:
diff --git a/storage/ndb/src/kernel/blocks/suma/Suma.cpp b/storage/ndb/src/kernel/blocks/suma/Suma.cpp
index f68d36c6c0e..1ad78034eae 100644
--- a/storage/ndb/src/kernel/blocks/suma/Suma.cpp
+++ b/storage/ndb/src/kernel/blocks/suma/Suma.cpp
@@ -2565,6 +2565,9 @@ Suma::reportAllSubscribers(Signal *signal,
return;
}
+#ifdef VM_TRACE
+ ndbout_c("reportAllSubscribers");
+#endif
SubTableData * data = (SubTableData*)signal->getDataPtrSend();
data->gci = m_last_complete_gci + 1;
data->tableId = subPtr.p->m_tableId;
@@ -2591,6 +2594,12 @@ Suma::reportAllSubscribers(Signal *signal,
data->senderData = subbPtr.p->m_senderData;
sendSignal(subbPtr.p->m_senderRef, GSN_SUB_TABLE_DATA, signal,
SubTableData::SignalLength, JBB);
+#ifdef VM_TRACE
+ ndbout_c("sent %s(%d) to node %d",
+ table_event == NdbDictionary::Event::_TE_SUBSCRIBE ?
+ "SUBSCRIBE" : "UNSUBSCRIBE", (int) table_event,
+ refToNode(subbPtr.p->m_senderRef));
+#endif
}
}
}
diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
index b491e00ba65..f282ab825f0 100644
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp
@@ -1173,15 +1173,17 @@ NdbEventBuffer::nextEvent()
NdbEventOperationImpl*
NdbEventBuffer::getGCIEventOperations(Uint32* iter, Uint32* event_types)
{
+ DBUG_ENTER("NdbEventBuffer::getGCIEventOperations");
EventBufData_list::Gci_ops *gci_ops = m_available_data.first_gci_ops();
if (*iter < gci_ops->m_gci_op_count)
{
EventBufData_list::Gci_op g = gci_ops->m_gci_op_list[(*iter)++];
if (event_types != NULL)
*event_types = g.event_types;
- return g.op;
+ DBUG_PRINT("info", ("gci: %d", (unsigned)gci_ops->m_gci));
+ DBUG_RETURN(g.op);
}
- return NULL;
+ DBUG_RETURN(NULL);
}
void
@@ -1647,11 +1649,19 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
else
{
// event with same op, PK found, merge into old buffer
+ Uint32 old_op = data->sdata->operation;
if (unlikely(merge_data(sdata, ptr, data)))
{
op->m_has_error = 3;
DBUG_RETURN_EVENT(-1);
}
+ Uint32 new_op = data->sdata->operation;
+
+ // make Gci_ops reflect the merge by delete old and add new
+ EventBufData_list::Gci_op g = { op, (1 << old_op) };
+ // bucket->m_data.del_gci_op(g); // XXX whats wrong? fix later
+ g.event_types = (1 << new_op);
+ bucket->m_data.add_gci_op(g);
}
DBUG_RETURN_EVENT(0);
}
@@ -2184,7 +2194,7 @@ void EventBufData_list::append_list(EventBufData_list *list, Uint64 gci)
}
void
-EventBufData_list::add_gci_op(Gci_op g)
+EventBufData_list::add_gci_op(Gci_op g, bool del)
{
assert(g.op != NULL);
Uint32 i;
@@ -2193,7 +2203,10 @@ EventBufData_list::add_gci_op(Gci_op g)
break;
}
if (i < m_gci_op_count) {
- m_gci_op_list[i].event_types |= g.event_types;
+ if (! del)
+ m_gci_op_list[i].event_types |= g.event_types;
+ else
+ m_gci_op_list[i].event_types &= ~ g.event_types;
} else {
if (m_gci_op_count == m_gci_op_alloc) {
Uint32 n = 1 + 2 * m_gci_op_alloc;
@@ -2207,6 +2220,7 @@ EventBufData_list::add_gci_op(Gci_op g)
m_gci_op_alloc = n;
}
assert(m_gci_op_count < m_gci_op_alloc);
+ assert(! del);
m_gci_op_list[m_gci_op_count++] = g;
}
}
diff --git a/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp b/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
index 9ce85a61361..044ac58ade1 100644
--- a/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
+++ b/storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp
@@ -129,9 +129,11 @@ public:
};
Gci_ops *first_gci_ops();
Gci_ops *next_gci_ops();
-private:
// case 1 above; add Gci_op to single list
- void add_gci_op(Gci_op g);
+ void add_gci_op(Gci_op g, bool del = false);
+ // delete bit from existing flags
+ void del_gci_op(Gci_op g) { add_gci_op(g, true); }
+private:
// case 2 above; move single list or multi list from
// one list to another
void move_gci_ops(EventBufData_list *list, Uint64 gci);