Commit ea42c5a7 authored by unknown's avatar unknown

Merge perch.ndb.mysql.com:/home/jonas/src/51-work

into  perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new-ndb


storage/ndb/src/kernel/blocks/suma/Suma.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/suma/Suma.hpp:
  Auto merged
parents 93c0d6d2 734a3036
......@@ -1430,17 +1430,26 @@ Suma::initTable(Signal *signal, Uint32 tableId, TablePtr &tabPtr,
if (r)
{
jam();
// we have to wait getting tab info
DBUG_RETURN(1);
}
if (tabPtr.p->setupTrigger(signal, *this))
{
jam();
// we have to wait for triggers to be setup
DBUG_RETURN(1);
}
completeOneSubscriber(signal, tabPtr, subbPtr);
int ret = completeOneSubscriber(signal, tabPtr, subbPtr);
if (ret == -1)
{
jam();
LocalDLList<Subscriber> subscribers(c_subscriberPool,
tabPtr.p->c_subscribers);
subscribers.release(subbPtr);
}
completeInitTable(signal, tabPtr);
DBUG_RETURN(0);
}
......@@ -1516,6 +1525,20 @@ Suma::initTable(Signal *signal, Uint32 tableId, TablePtr &tabPtr)
req->tableId = tableId;
DBUG_PRINT("info",("GET_TABINFOREQ id %d", req->tableId));
if (ERROR_INSERTED(13031))
{
jam();
CLEAR_ERROR_INSERT_VALUE;
GetTabInfoRef* ref = (GetTabInfoRef*)signal->getDataPtrSend();
ref->tableId = tableId;
ref->senderData = tabPtr.i;
ref->errorCode = GetTabInfoRef::TableNotDefined;
sendSignal(reference(), GSN_GET_TABINFOREF, signal,
GetTabInfoRef::SignalLength, JBB);
DBUG_RETURN(1);
}
sendSignal(DBDICT_REF, GSN_GET_TABINFOREQ, signal,
GetTabInfoReq::SignalLength, JBB);
DBUG_RETURN(1);
......@@ -1529,7 +1552,7 @@ Suma::initTable(Signal *signal, Uint32 tableId, TablePtr &tabPtr)
DBUG_RETURN(0);
}
void
int
Suma::completeOneSubscriber(Signal *signal, TablePtr tabPtr, SubscriberPtr subbPtr)
{
jam();
......@@ -1539,19 +1562,22 @@ Suma::completeOneSubscriber(Signal *signal, TablePtr tabPtr, SubscriberPtr subbP
(c_startup.m_restart_server_node_id == 0 ||
tabPtr.p->m_state != Table::DROPPED))
{
jam();
sendSubStartRef(signal,subbPtr,tabPtr.p->m_error,
SubscriptionData::TableData);
tabPtr.p->n_subscribers--;
DBUG_RETURN(-1);
}
else
{
jam();
SubscriptionPtr subPtr;
c_subscriptions.getPtr(subPtr, subbPtr.p->m_subPtrI);
subPtr.p->m_table_ptrI= tabPtr.i;
sendSubStartComplete(signal,subbPtr, m_last_complete_gci + 3,
SubscriptionData::TableData);
}
DBUG_VOID_RETURN;
DBUG_RETURN(0);
}
void
......@@ -1564,11 +1590,17 @@ Suma::completeAllSubscribers(Signal *signal, TablePtr tabPtr)
LocalDLList<Subscriber> subscribers(c_subscriberPool,
tabPtr.p->c_subscribers);
SubscriberPtr subbPtr;
for(subscribers.first(subbPtr);
!subbPtr.isNull();
subscribers.next(subbPtr))
for(subscribers.first(subbPtr); !subbPtr.isNull();)
{
completeOneSubscriber(signal, tabPtr, subbPtr);
jam();
Ptr<Subscriber> tmp = subbPtr;
subscribers.next(subbPtr);
int ret = completeOneSubscriber(signal, tabPtr, tmp);
if (ret == -1)
{
jam();
subscribers.release(tmp);
}
}
}
DBUG_VOID_RETURN;
......
......@@ -250,7 +250,7 @@ public:
SubscriberPtr subbPtr);
int initTable(Signal *signal,Uint32 tableId, TablePtr &tabPtr);
void completeOneSubscriber(Signal* signal, TablePtr tabPtr, SubscriberPtr subbPtr);
int completeOneSubscriber(Signal* signal, TablePtr tabPtr, SubscriberPtr subbPtr);
void completeAllSubscribers(Signal* signal, TablePtr tabPtr);
void completeInitTable(Signal* signal, TablePtr tabPtr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment