mirror of
https://github.com/MariaDB/server.git
synced 2025-08-29 00:08:14 +03:00
updated event example to make use of new NdbError member in NdbEventOperation
added my_pthread_init to get dbug print correct in Hugo added define for event error code
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
*/
|
||||
|
||||
#include <NdbApi.hpp>
|
||||
#include <ndberror.h>
|
||||
|
||||
// Used for cout
|
||||
#include <stdio.h>
|
||||
@@ -160,10 +161,9 @@ int main()
|
||||
|
||||
// set up the callbacks
|
||||
printf("execute\n");
|
||||
if (op->execute()) { // This starts changes to "start flowing"
|
||||
printf("operation execution failed\n");
|
||||
exit(-1);
|
||||
}
|
||||
// This starts changes to "start flowing"
|
||||
if (op->execute())
|
||||
APIERROR(op->getNdbError());
|
||||
|
||||
int i= 0;
|
||||
while(i < 40) {
|
||||
@@ -251,7 +251,7 @@ int myCreateEvent(Ndb* myNdb,
|
||||
// Add event to database
|
||||
if (myDict->createEvent(myEvent) == 0)
|
||||
myEvent.print();
|
||||
else if (myDict->getNdbError().code == 4709) {
|
||||
else if (myDict->getNdbError().code == NDBERR_EVENT_NAME_ALEADY_EXISTS) {
|
||||
printf("Event creation failed, event exists\n");
|
||||
printf("dropping Event...\n");
|
||||
if (myDict->dropEvent(eventName)) APIERROR(myDict->getNdbError());
|
||||
|
Reference in New Issue
Block a user