Commit 1c6fd0ee authored by pekka@mysql.com's avatar pekka@mysql.com

Merge pnousiainen@bk-internal.mysql.com:/home/bk/mysql-5.1-new

into  mysql.com:/space/pekka/ndb/version/my51
parents 4e1ccbe2 d952e3e3
......@@ -94,11 +94,9 @@ public:
*/
State getState();
/**
* By default events on same NdbEventOperation within same GCI
* are merged into a single event. This can be changed with
* separateEvents(true).
* See NdbDictionary::Event. Default is false.
*/
void separateEvents(bool flag);
void mergeEvents(bool flag);
/**
* Activates the NdbEventOperation to start receiving events. The
......
......@@ -100,7 +100,7 @@ int myCreateEvent(Ndb* myNdb,
int main(int argc, char** argv)
{
ndb_init();
bool sep = argc > 1 && strcmp(argv[1], "-s") == 0;
bool merge_events = argc > 1 && strcmp(argv[1], "-m") == 0;
Ndb_cluster_connection *cluster_connection=
new Ndb_cluster_connection(); // Object representing the cluster
......@@ -157,7 +157,7 @@ int main(int argc, char** argv)
printf("create EventOperation\n");
if ((op = myNdb->createEventOperation(eventName)) == NULL)
APIERROR(myNdb->getNdbError());
op->separateEvents(sep);
op->mergeEvents(merge_events);
printf("get values\n");
NdbRecAttr* recAttr[noEventColumnName];
......
......@@ -38,9 +38,9 @@ NdbEventOperation::State NdbEventOperation::getState()
return m_impl.getState();
}
void NdbEventOperation::separateEvents(bool flag)
void NdbEventOperation::mergeEvents(bool flag)
{
m_impl.m_separateEvents = flag;
m_impl.m_mergeEvents = flag;
}
NdbRecAttr *
......
......@@ -104,7 +104,7 @@ NdbEventOperationImpl::NdbEventOperationImpl(NdbEventOperation &N,
m_state= EO_CREATED;
m_separateEvents = true;
m_mergeEvents = false;
m_has_error= 0;
......@@ -1168,7 +1168,7 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
}
bool use_hash =
! op->m_separateEvents &&
op->m_mergeEvents &&
sdata->operation < NdbDictionary::Event::_TE_FIRST_NON_DATA_EVENT;
// find position in bucket hash table
......
......@@ -206,7 +206,7 @@ public:
Uint32 m_eventId;
Uint32 m_oid;
bool m_separateEvents;
bool m_mergeEvents;
EventBufData *m_data_item;
......
......@@ -169,7 +169,6 @@ eventOperation(Ndb* pNdb, const NdbDictionary::Table &tab, void* pstats, int rec
g_err << function << "Event operation creation failed\n";
return NDBT_FAILED;
}
pOp->separateEvents(true);
g_info << function << "get values\n";
NdbRecAttr* recAttr[1024];
......@@ -381,7 +380,6 @@ int runCreateDropEventOperation(NDBT_Context* ctx, NDBT_Step* step)
g_err << "Event operation creation failed\n";
return NDBT_FAILED;
}
pOp->separateEvents(true);
g_info << "dropping event operation" << endl;
int res = pNdb->dropEventOperation(pOp);
......@@ -552,7 +550,6 @@ int runEventApplier(NDBT_Context* ctx, NDBT_Step* step)
g_err << "Event operation creation failed on %s" << buf << endl;
DBUG_RETURN(NDBT_FAILED);
}
pOp->separateEvents(true);
int i;
int n_columns= table->getNoOfColumns();
......@@ -1198,7 +1195,6 @@ static int createEventOperations(Ndb * ndb)
{
DBUG_RETURN(NDBT_FAILED);
}
pOp->separateEvents(true);
int n_columns= pTabs[i]->getNoOfColumns();
for (int j = 0; j < n_columns; j++)
......
......@@ -850,7 +850,7 @@ createevent()
evt.addEventColumn(c.name);
}
#ifdef version51rbr
evt.separateEvents(g_opts.separate_events);
evt.mergeEvents(! g_opts.separate_events);
#endif
if (g_dic->getEvent(evt.getName()) != 0)
chkdb(g_dic->dropEvent(evt.getName()) == 0);
......@@ -881,7 +881,7 @@ createeventop()
#else
chkdb((g_evt_op = g_ndb->createEventOperation(g_evt->getName())) != 0);
// available in gci merge changeset
g_evt_op->separateEvents(g_opts.separate_events); // not yet inherited
g_evt_op->mergeEvents(! g_opts.separate_events); // not yet inherited
#endif
uint i;
for (i = 0; i < ncol(); i++) {
......
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