wl#3023 ndb to return correct tables for initial table maps

+ removed extra binlog events generated by drop table schema ops to produce predictable test cases


storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  ndb: dict use define for number of pages in table definition
This commit is contained in:
unknown 2006-03-11 06:58:48 +01:00
commit 435e084481
13 changed files with 138 additions and 112 deletions

View file

@ -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:

View file

@ -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;
}
}

View file

@ -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);