Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c3f03a38
Commit
c3f03a38
authored
Jan 03, 2005
by
tomas@poseidon.ndb.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated ndbapi examples
parent
864b3b20
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
128 additions
and
148 deletions
+128
-148
ndb/examples/Makefile
ndb/examples/Makefile
+2
-9
ndb/examples/ndbapi_example1/Makefile
ndb/examples/ndbapi_example1/Makefile
+4
-16
ndb/examples/ndbapi_example1/ndbapi_example1.cpp
ndb/examples/ndbapi_example1/ndbapi_example1.cpp
+18
-7
ndb/examples/ndbapi_example2/Makefile
ndb/examples/ndbapi_example2/Makefile
+4
-16
ndb/examples/ndbapi_example2/ndbapi_example2.cpp
ndb/examples/ndbapi_example2/ndbapi_example2.cpp
+16
-1
ndb/examples/ndbapi_example3/Makefile
ndb/examples/ndbapi_example3/Makefile
+4
-16
ndb/examples/ndbapi_example3/ndbapi_example3.cpp
ndb/examples/ndbapi_example3/ndbapi_example3.cpp
+16
-1
ndb/examples/ndbapi_example4/Makefile
ndb/examples/ndbapi_example4/Makefile
+4
-16
ndb/examples/ndbapi_example4/ndbapi_example4.cpp
ndb/examples/ndbapi_example4/ndbapi_example4.cpp
+16
-1
ndb/examples/ndbapi_example5/Makefile
ndb/examples/ndbapi_example5/Makefile
+7
-17
ndb/examples/ndbapi_example5/ndbapi_example5.cpp
ndb/examples/ndbapi_example5/ndbapi_example5.cpp
+26
-25
ndb/examples/ndbapi_scan_example/Makefile
ndb/examples/ndbapi_scan_example/Makefile
+11
-23
No files found.
ndb/examples/Makefile
View file @
c3f03a38
-include
.defs.mk
# XXX ndbapi_example4, select_all commented out until fixed
#ifneq ($(C++),)
#OPTS = CC=$(CC) CXX=$(C++)
#endif
# XXX ndbapi_example4 commented out until fixed
BIN_DIRS
:=
ndbapi_example1 ndbapi_example2 ndbapi_example3
$(ndbapi_example4)
\
BIN_DIRS
:=
ndbapi_example1 ndbapi_example2 ndbapi_example3
$(ndbapi_example4)
\
ndbapi_example5
select_all
ndbapi_example5
$(select_all)
ndbapi_scan_example
bins
:
$(patsubst %
,
_bins_%
,
$(BIN_DIRS))
bins
:
$(patsubst %
,
_bins_%
,
$(BIN_DIRS))
...
@@ -24,4 +18,3 @@ clean_dep: clean
...
@@ -24,4 +18,3 @@ clean_dep: clean
cleanall
:
clean
cleanall
:
clean
tidy
:
clean
tidy
:
clean
distclean
:
clean
distclean
:
clean
ndb/examples/ndbapi_example1/Makefile
View file @
c3f03a38
-include
.defs.mk
#NDB_OS = OS_YOU_ARE_RUNNING_ON
#You need to set the NDB_OS variable here
TARGET
=
ndbapi_example1
TARGET
=
ndbapi_example1
SRCS
=
ndbapi_example1.cpp
SRCS
=
ndbapi_example1.cpp
OBJS
=
ndbapi_example1.o
OBJS
=
ndbapi_example1.o
...
@@ -9,22 +6,13 @@ CFLAGS = -c -Wall -fno-rtti -fno-exceptions
...
@@ -9,22 +6,13 @@ CFLAGS = -c -Wall -fno-rtti -fno-exceptions
DEBUG
=
DEBUG
=
LFLAGS
=
-Wall
LFLAGS
=
-Wall
INCLUDE_DIR
=
../../include
INCLUDE_DIR
=
../../include
LIB_DIR
=
../../lib
LIB_DIR
=
-L
../../src/.libs
\
ifeq
($(NDB_OS), SOLARIS)
-L
../../../libmysql/.libs
\
# Here is the definition of system libraries necessary for Solaris 7
-L
../../../mysys
SYS_LIB
=
SYS_LIB
=
endif
ifeq
($(NDB_OS), LINUX)
# Here is the definition of system libraries necessary for Linux 2.4
SYS_LIB
=
endif
ifeq
($(NDB_OS), MACOSX)
# Here is the definition of system libraries necessary for Mac OS X
SYS_LIB
=
endif
$(TARGET)
:
$(OBJS)
$(TARGET)
:
$(OBJS)
$(CXX)
$(LFLAGS)
-L
$(LIB_DIR)
$(OBJS)
-lNDB_API
$(SYS_LIB)
-o
$(TARGET)
$(CXX)
$(LFLAGS)
$(LIB_DIR)
$(OBJS)
-lndbclient
-lmysqlclient
-lmysys
$(SYS_LIB)
-o
$(TARGET)
$(TARGET).o
:
$(SRCS)
$(TARGET).o
:
$(SRCS)
$(CXX)
$(CFLAGS)
-I
$(INCLUDE_DIR)
-I
$(INCLUDE_DIR)
/ndbapi
$(SRCS)
$(CXX)
$(CFLAGS)
-I
$(INCLUDE_DIR)
-I
$(INCLUDE_DIR)
/ndbapi
$(SRCS)
...
...
ndb/examples/ndbapi_example1/ndbapi_example1.cpp
View file @
c3f03a38
...
@@ -45,7 +45,18 @@
...
@@ -45,7 +45,18 @@
int
main
()
int
main
()
{
{
ndb_init
();
ndb_init
();
Ndb
*
myNdb
=
new
Ndb
(
"TEST_DB_1"
);
// Object representing the database
Ndb_cluster_connection
*
cluster_connection
=
new
Ndb_cluster_connection
();
// Object representing the cluster
if
(
cluster_connection
->
wait_until_ready
(
30
,
30
))
{
std
::
cout
<<
"Cluster was not ready within 30 secs."
<<
std
::
endl
;
exit
(
-
1
);
}
Ndb
*
myNdb
=
new
Ndb
(
cluster_connection
,
"TEST_DB_1"
);
// Object representing the database
NdbDictionary
::
Table
myTable
;
NdbDictionary
::
Table
myTable
;
NdbDictionary
::
Column
myColumn
;
NdbDictionary
::
Column
myColumn
;
...
@@ -56,16 +67,11 @@ int main()
...
@@ -56,16 +67,11 @@ int main()
/********************************************
/********************************************
* Initialize NDB and wait until it's ready *
* Initialize NDB and wait until it's ready *
********************************************/
********************************************/
if
(
myNdb
->
init
()
==
-
1
)
{
if
(
myNdb
->
init
())
{
APIERROR
(
myNdb
->
getNdbError
());
APIERROR
(
myNdb
->
getNdbError
());
exit
(
-
1
);
exit
(
-
1
);
}
}
if
(
myNdb
->
waitUntilReady
(
30
)
!=
0
)
{
std
::
cout
<<
"NDB was not ready within 30 secs."
<<
std
::
endl
;
exit
(
-
1
);
}
NdbDictionary
::
Dictionary
*
myDict
=
myNdb
->
getDictionary
();
NdbDictionary
::
Dictionary
*
myDict
=
myNdb
->
getDictionary
();
/*********************************************************
/*********************************************************
...
@@ -190,5 +196,10 @@ int main()
...
@@ -190,5 +196,10 @@ int main()
}
}
myNdb
->
closeTransaction
(
myConnection
);
myNdb
->
closeTransaction
(
myConnection
);
}
}
delete
myNdb
;
delete
myNdb
;
delete
cluster_connection
;
ndb_end
(
0
);
return
0
;
}
}
ndb/examples/ndbapi_example2/Makefile
View file @
c3f03a38
-include
.defs.mk
#NDB_OS = OS_YOU_ARE_RUNNING_ON
#You need to set the NDB_OS variable here
TARGET
=
ndbapi_example2
TARGET
=
ndbapi_example2
SRCS
=
ndbapi_example2.cpp
SRCS
=
ndbapi_example2.cpp
OBJS
=
ndbapi_example2.o
OBJS
=
ndbapi_example2.o
...
@@ -9,22 +6,13 @@ CFLAGS = -c -Wall -fno-rtti -fno-exceptions
...
@@ -9,22 +6,13 @@ CFLAGS = -c -Wall -fno-rtti -fno-exceptions
DEBUG
=
DEBUG
=
LFLAGS
=
-Wall
LFLAGS
=
-Wall
INCLUDE_DIR
=
../../include
INCLUDE_DIR
=
../../include
LIB_DIR
=
../../lib
LIB_DIR
=
-L
../../src/.libs
\
ifeq
($(NDB_OS), SOLARIS)
-L
../../../libmysql/.libs
\
# Here is the definition of system libraries necessary for Solaris 7
-L
../../../mysys
SYS_LIB
=
SYS_LIB
=
endif
ifeq
($(NDB_OS), LINUX)
# Here is the definition of system libraries necessary for Linux 2.4
SYS_LIB
=
endif
ifeq
($(NDB_OS), MACOSX)
# Here is the definition of system libraries necessary for Mac OS X
SYS_LIB
=
endif
$(TARGET)
:
$(OBJS)
$(TARGET)
:
$(OBJS)
$(CXX)
$(LFLAGS)
-L
$(LIB_DIR)
$(OBJS)
-lNDB_API
$(SYS_LIB)
-o
$(TARGET)
$(CXX)
$(LFLAGS)
$(LIB_DIR)
$(OBJS)
-lndbclient
-lmysqlclient
-lmysys
$(SYS_LIB)
-o
$(TARGET)
$(TARGET).o
:
$(SRCS)
$(TARGET).o
:
$(SRCS)
$(CXX)
$(CFLAGS)
-I
$(INCLUDE_DIR)
-I
$(INCLUDE_DIR)
/ndbapi
$(SRCS)
$(CXX)
$(CFLAGS)
-I
$(INCLUDE_DIR)
-I
$(INCLUDE_DIR)
/ndbapi
$(SRCS)
...
...
ndb/examples/ndbapi_example2/ndbapi_example2.cpp
View file @
c3f03a38
...
@@ -40,7 +40,18 @@ static void callback(int result, NdbConnection* NdbObject, void* aObject);
...
@@ -40,7 +40,18 @@ static void callback(int result, NdbConnection* NdbObject, void* aObject);
int
main
()
int
main
()
{
{
ndb_init
();
ndb_init
();
Ndb
*
myNdb
=
new
Ndb
(
"TEST_DB_2"
);
// Object representing the database
Ndb_cluster_connection
*
cluster_connection
=
new
Ndb_cluster_connection
();
// Object representing the cluster
if
(
cluster_connection
->
wait_until_ready
(
30
,
30
))
{
std
::
cout
<<
"Cluster was not ready within 30 secs."
<<
std
::
endl
;
exit
(
-
1
);
}
Ndb
*
myNdb
=
new
Ndb
(
cluster_connection
,
"TEST_DB_2"
);
// Object representing the database
NdbConnection
*
myNdbConnection
[
2
];
// For transactions
NdbConnection
*
myNdbConnection
[
2
];
// For transactions
NdbOperation
*
myNdbOperation
;
// For operations
NdbOperation
*
myNdbOperation
;
// For operations
...
@@ -88,6 +99,10 @@ int main()
...
@@ -88,6 +99,10 @@ int main()
myNdb
->
closeTransaction
(
myNdbConnection
[
i
]);
myNdb
->
closeTransaction
(
myNdbConnection
[
i
]);
delete
myNdb
;
delete
myNdb
;
delete
cluster_connection
;
ndb_end
(
0
);
return
0
;
}
}
/*
/*
...
...
ndb/examples/ndbapi_example3/Makefile
View file @
c3f03a38
-include
.defs.mk
#NDB_OS = OS_YOU_ARE_RUNNING_ON
#You need to set the NDB_OS variable here
TARGET
=
ndbapi_example3
TARGET
=
ndbapi_example3
SRCS
=
ndbapi_example3.cpp
SRCS
=
ndbapi_example3.cpp
OBJS
=
ndbapi_example3.o
OBJS
=
ndbapi_example3.o
...
@@ -9,22 +6,13 @@ CFLAGS = -c -Wall -fno-rtti -fno-exceptions
...
@@ -9,22 +6,13 @@ CFLAGS = -c -Wall -fno-rtti -fno-exceptions
DEBUG
=
DEBUG
=
LFLAGS
=
-Wall
LFLAGS
=
-Wall
INCLUDE_DIR
=
../../include
INCLUDE_DIR
=
../../include
LIB_DIR
=
../../lib
LIB_DIR
=
-L
../../src/.libs
\
ifeq
($(NDB_OS), SOLARIS)
-L
../../../libmysql/.libs
\
# Here is the definition of system libraries necessary for Solaris 7
-L
../../../mysys
SYS_LIB
=
SYS_LIB
=
endif
ifeq
($(NDB_OS), LINUX)
# Here is the definition of system libraries necessary for Linux 2.4
SYS_LIB
=
endif
ifeq
($(NDB_OS), MACOSX)
# Here is the definition of system libraries necessary for Mac OS X
SYS_LIB
=
endif
$(TARGET)
:
$(OBJS)
$(TARGET)
:
$(OBJS)
$(CXX)
$(LFLAGS)
-L
$(LIB_DIR)
$(OBJS)
-lNDB_API
$(SYS_LIB)
-o
$(TARGET)
$(CXX)
$(LFLAGS)
$(LIB_DIR)
$(OBJS)
-lndbclient
-lmysqlclient
-lmysys
$(SYS_LIB)
-o
$(TARGET)
$(TARGET).o
:
$(SRCS)
$(TARGET).o
:
$(SRCS)
$(CXX)
$(CFLAGS)
-I
$(INCLUDE_DIR)
-I
$(INCLUDE_DIR)
/ndbapi
$(SRCS)
$(CXX)
$(CFLAGS)
-I
$(INCLUDE_DIR)
-I
$(INCLUDE_DIR)
/ndbapi
$(SRCS)
...
...
ndb/examples/ndbapi_example3/ndbapi_example3.cpp
View file @
c3f03a38
...
@@ -177,7 +177,18 @@ int executeInsertTransaction(int transactionId, Ndb* myNdb) {
...
@@ -177,7 +177,18 @@ int executeInsertTransaction(int transactionId, Ndb* myNdb) {
int
main
()
int
main
()
{
{
ndb_init
();
ndb_init
();
Ndb
*
myNdb
=
new
Ndb
(
"TEST_DB_1"
);
// Object representing the database
Ndb_cluster_connection
*
cluster_connection
=
new
Ndb_cluster_connection
();
// Object representing the cluster
if
(
cluster_connection
->
wait_until_ready
(
30
,
30
))
{
std
::
cout
<<
"Cluster was not ready within 30 secs."
<<
std
::
endl
;
exit
(
-
1
);
}
Ndb
*
myNdb
=
new
Ndb
(
cluster_connection
,
"TEST_DB_1"
);
// Object representing the database
/*******************************************
/*******************************************
* Initialize NDB and wait until its ready *
* Initialize NDB and wait until its ready *
...
@@ -200,4 +211,8 @@ int main()
...
@@ -200,4 +211,8 @@ int main()
}
}
delete
myNdb
;
delete
myNdb
;
delete
cluster_connection
;
ndb_end
(
0
);
return
0
;
}
}
ndb/examples/ndbapi_example4/Makefile
View file @
c3f03a38
-include
.defs.mk
#NDB_OS = OS_YOU_ARE_RUNNING_ON
#You need to set the NDB_OS variable here
TARGET
=
ndbapi_example4
TARGET
=
ndbapi_example4
SRCS
=
ndbapi_example4.cpp
SRCS
=
ndbapi_example4.cpp
OBJS
=
ndbapi_example4.o
OBJS
=
ndbapi_example4.o
...
@@ -9,22 +6,13 @@ CFLAGS = -c -Wall -fno-rtti -fno-exceptions
...
@@ -9,22 +6,13 @@ CFLAGS = -c -Wall -fno-rtti -fno-exceptions
DEBUG
=
DEBUG
=
LFLAGS
=
-Wall
LFLAGS
=
-Wall
INCLUDE_DIR
=
../../include
INCLUDE_DIR
=
../../include
LIB_DIR
=
../../lib
LIB_DIR
=
-L
../../src/.libs
\
ifeq
($(NDB_OS), SOLARIS)
-L
../../../libmysql/.libs
\
# Here is the definition of system libraries necessary for Solaris 7
-L
../../../mysys
SYS_LIB
=
SYS_LIB
=
endif
ifeq
($(NDB_OS), LINUX)
# Here is the definition of system libraries necessary for Linux 2.4
SYS_LIB
=
endif
ifeq
($(NDB_OS), MACOSX)
# Here is the definition of system libraries necessary for Mac OS X
SYS_LIB
=
endif
$(TARGET)
:
$(OBJS)
$(TARGET)
:
$(OBJS)
$(CXX)
$(LFLAGS)
-L
$(LIB_DIR)
$(OBJS)
-lNDB_API
$(SYS_LIB)
-o
$(TARGET)
$(CXX)
$(LFLAGS)
$(LIB_DIR)
$(OBJS)
-lndbclient
-lmysqlclient
-lmysys
$(SYS_LIB)
-o
$(TARGET)
$(TARGET).o
:
$(SRCS)
$(TARGET).o
:
$(SRCS)
$(CXX)
$(CFLAGS)
-I
$(INCLUDE_DIR)
-I
$(INCLUDE_DIR)
/ndbapi
$(SRCS)
$(CXX)
$(CFLAGS)
-I
$(INCLUDE_DIR)
-I
$(INCLUDE_DIR)
/ndbapi
$(SRCS)
...
...
ndb/examples/ndbapi_example4/ndbapi_example4.cpp
View file @
c3f03a38
...
@@ -45,7 +45,18 @@
...
@@ -45,7 +45,18 @@
int
main
()
int
main
()
{
{
ndb_init
();
ndb_init
();
Ndb
*
myNdb
=
new
Ndb
(
"TEST_DB_1"
);
// Object representing the database
Ndb_cluster_connection
*
cluster_connection
=
new
Ndb_cluster_connection
();
// Object representing the cluster
if
(
cluster_connection
->
wait_until_ready
(
30
,
30
))
{
std
::
cout
<<
"Cluster was not ready within 30 secs."
<<
std
::
endl
;
exit
(
-
1
);
}
Ndb
*
myNdb
=
new
Ndb
(
cluster_connection
,
"TEST_DB_1"
);
// Object representing the database
NdbDictionary
::
Table
myTable
;
NdbDictionary
::
Table
myTable
;
NdbDictionary
::
Column
myColumn
;
NdbDictionary
::
Column
myColumn
;
NdbDictionary
::
Index
myIndex
;
NdbDictionary
::
Index
myIndex
;
...
@@ -250,4 +261,8 @@ int main()
...
@@ -250,4 +261,8 @@ int main()
APIERROR
(
myDict
->
getNdbError
());
APIERROR
(
myDict
->
getNdbError
());
delete
myNdb
;
delete
myNdb
;
delete
cluster_connection
;
ndb_end
(
0
);
return
0
;
}
}
ndb/examples/ndbapi_example5/Makefile
View file @
c3f03a38
-include
.defs.mk
#NDB_OS = OS_YOU_ARE_RUNNING_ON
#You need to set the NDB_OS variable here
TARGET
=
ndbapi_example5
TARGET
=
ndbapi_example5
SRCS
=
ndbapi_example5.cpp
SRCS
=
ndbapi_example5.cpp
OBJS
=
ndbapi_example5.o
OBJS
=
ndbapi_example5.o
CXX
=
g++
CXX
=
g++
CFLAGS
=
-c
-Wall
-fno-rtti
-fno-exceptions
CFLAGS
=
-c
-Wall
-fno-rtti
-fno-exceptions
CXXFLAGS
=
DEBUG
=
DEBUG
=
LFLAGS
=
-Wall
LFLAGS
=
-Wall
INCLUDE_DIR
=
../../include
TOP_SRCDIR
=
../../..
LIB_DIR
=
../../lib
INCLUDE_DIR
=
$(TOP_SRCDIR)
/ndb/include
ifeq
($(NDB_OS), SOLARIS)
LIB_DIR
=
-L
$(TOP_SRCDIR)
/ndb/src/.libs
\
# Here is the definition of system libraries necessary for Solaris 7
-L
$(TOP_SRCDIR)
/libmysql/.libs
\
-L
$(TOP_SRCDIR)
/mysys
SYS_LIB
=
SYS_LIB
=
endif
ifeq
($(NDB_OS), LINUX)
# Here is the definition of system libraries necessary for Linux 2.4
SYS_LIB
=
endif
ifeq
($(NDB_OS), MACOSX)
# Here is the definition of system libraries necessary for Mac OS X
SYS_LIB
=
endif
$(TARGET)
:
$(OBJS)
$(TARGET)
:
$(OBJS)
$(CXX)
$(
LFLAGS)
-L
$(LIB_DIR)
$(OBJS)
-lNDB_API
$(SYS_LIB)
-o
$(TARGET)
$(CXX)
$(
CXXFLAGS)
$(LFLAGS)
$(LIB_DIR)
$(OBJS)
-lndbclient
-lmysqlclient
-lmysys
$(SYS_LIB)
-o
$(TARGET)
$(TARGET).o
:
$(SRCS)
$(TARGET).o
:
$(SRCS)
$(CXX)
$(CFLAGS)
-I
$(INCLUDE_DIR)
-I
$(INCLUDE_DIR)
/ndbapi
$(SRCS)
$(CXX)
$(CFLAGS)
-I
$(INCLUDE_DIR)
-I
$(INCLUDE_DIR)
/ndbapi
$(SRCS)
...
...
ndb/examples/ndbapi_example5/ndbapi_example5.cpp
View file @
c3f03a38
...
@@ -56,7 +56,6 @@
...
@@ -56,7 +56,6 @@
<< error.code << ", msg: " << error.message << "." << std::endl; \
<< error.code << ", msg: " << error.message << "." << std::endl; \
exit(-1); }
exit(-1); }
Ndb
*
myCreateNdb
();
int
myCreateEvent
(
Ndb
*
myNdb
,
int
myCreateEvent
(
Ndb
*
myNdb
,
const
char
*
eventName
,
const
char
*
eventName
,
const
char
*
eventTableName
,
const
char
*
eventTableName
,
...
@@ -66,12 +65,29 @@ int myCreateEvent(Ndb* myNdb,
...
@@ -66,12 +65,29 @@ int myCreateEvent(Ndb* myNdb,
int
main
()
int
main
()
{
{
ndb_init
();
ndb_init
();
Ndb
*
myNdb
=
myCreateNdb
();
Ndb_cluster_connection
*
cluster_connection
=
new
Ndb_cluster_connection
();
// Object representing the cluster
if
(
cluster_connection
->
wait_until_ready
(
30
,
30
))
{
std
::
cout
<<
"Cluster was not ready within 30 secs."
<<
std
::
endl
;
exit
(
-
1
);
}
Ndb
*
myNdb
=
new
Ndb
(
cluster_connection
,
"TEST_DB"
);
// Object representing the database
if
(
myNdb
->
init
()
==
-
1
)
{
APIERROR
(
myNdb
->
getNdbError
());
exit
(
-
1
);
}
NdbDictionary
::
Dictionary
*
myDict
;
NdbDictionary
::
Dictionary
*
myDict
;
const
char
*
eventName
=
"CHNG_IN_TAB0"
;
const
char
*
eventName
=
"CHNG_IN_TAB0"
;
const
char
*
eventTableName
=
"TAB0"
;
const
char
*
eventTableName
=
"TAB0"
;
const
int
noEventColumnName
=
3
;
const
int
noEventColumnName
=
3
;
const
char
*
eventColumnName
[
noEventColumnName
]
=
const
char
*
eventColumnName
[
noEventColumnName
]
=
{
"COL0"
,
{
"COL0"
,
"COL1"
,
"COL1"
,
...
@@ -134,6 +150,8 @@ int main()
...
@@ -134,6 +150,8 @@ int main()
case
NdbDictionary
:
:
Event
::
TE_UPDATE
:
case
NdbDictionary
:
:
Event
::
TE_UPDATE
:
printf
(
"%u UPDATE: "
,
i
);
printf
(
"%u UPDATE: "
,
i
);
break
;
break
;
default:
abort
();
// should not happen
}
}
printf
(
"overrun %u pk %u: "
,
overrun
,
recAttr
[
0
]
->
u_32_value
());
printf
(
"overrun %u pk %u: "
,
overrun
,
recAttr
[
0
]
->
u_32_value
());
for
(
int
i
=
1
;
i
<
noEventColumnName
;
i
++
)
{
for
(
int
i
=
1
;
i
<
noEventColumnName
;
i
++
)
{
...
@@ -166,26 +184,9 @@ int main()
...
@@ -166,26 +184,9 @@ int main()
myDict
->
dropEvent
(
eventName
);
// remove event from database
myDict
->
dropEvent
(
eventName
);
// remove event from database
delete
myNdb
;
delete
myNdb
;
}
delete
cluster_connection
;
ndb_end
(
0
);
Ndb
*
myCreateNdb
()
return
0
;
{
Ndb
*
myNdb
=
new
Ndb
(
"TEST_DB"
);
/********************************************
* Initialize NDB and wait until it's ready *
********************************************/
if
(
myNdb
->
init
()
==
-
1
)
{
APIERROR
(
myNdb
->
getNdbError
());
exit
(
-
1
);
}
if
(
myNdb
->
waitUntilReady
(
30
)
!=
0
)
{
std
::
cout
<<
"NDB was not ready within 30 secs."
<<
std
::
endl
;
exit
(
-
1
);
}
return
myNdb
;
}
}
int
myCreateEvent
(
Ndb
*
myNdb
,
int
myCreateEvent
(
Ndb
*
myNdb
,
...
...
ndb/examples/ndbapi_scan_example/Makefile
View file @
c3f03a38
-include
.defs.mk
#NDB_OS = OS_YOU_ARE_RUNNING_ON
#You need to set the NDB_OS variable here (LINUX, SOLARIS, MACOSX)
#NDB_OS = LINUX
TARGET
=
ndbapi_scan
TARGET
=
ndbapi_scan
SRCS
=
ndbapi_scan.cpp
SRCS
=
ndbapi_scan.cpp
OBJS
=
ndbapi_scan.o
OBJS
=
ndbapi_scan.o
CC
=
g++
CXX
=
g++
CFLAGS
=
-c
-Wall
-fno-rtti
CFLAGS
=
-c
-Wall
-fno-rtti
-fno-exceptions
CXXFLAGS
=
DEBUG
=
DEBUG
=
LFLAGS
=
-Wall
LFLAGS
=
-Wall
INCLUDE_DIR
=
../../include
TOP_SRCDIR
=
../../..
LIB_DIR
=
../../lib
INCLUDE_DIR
=
$(TOP_SRCDIR)
/ndb/include
ifeq
($(NDB_OS), SOLARIS)
LIB_DIR
=
-L
$(TOP_SRCDIR)
/ndb/src/.libs
\
# Here is the definition of system libraries necessary for Solaris 7
-L
$(TOP_SRCDIR)
/libmysql/.libs
\
SYS_LIB
=
-lpthread
-lsocket
-lnsl
-lrt
-L
$(TOP_SRCDIR)
/mysys
endif
ifeq
($(NDB_OS), LINUX)
# Here is the definition of system libraries necessary for Linux 2.4
SYS_LIB
=
-lpthread
endif
ifeq
($(NDB_OS), MACOSX)
# Here is the definition of system libraries necessary for Mac OS X
SYS_LIB
=
SYS_LIB
=
endif
$(TARGET)
:
$(OBJS)
$(TARGET)
:
$(OBJS)
$(C
C)
$(LFLAGS)
-L
$(LIB_DIR)
-lNDB_API
$(OBJS)
$(SYS_LIB)
-o
$(TARGET)
$(C
XX)
$(CXXFLAGS)
$(LFLAGS)
$(LIB_DIR)
$(OBJS)
-lndbclient
-lmysqlclient
-lmysys
$(SYS_LIB)
-o
$(TARGET)
$(TARGET).o
:
$(SRCS)
$(TARGET).o
:
$(SRCS)
$(C
C
)
$(CFLAGS)
-I
$(INCLUDE_DIR)
-I
$(INCLUDE_DIR)
/ndbapi
$(SRCS)
$(C
XX
)
$(CFLAGS)
-I
$(INCLUDE_DIR)
-I
$(INCLUDE_DIR)
/ndbapi
$(SRCS)
clean
:
clean
:
rm
-f
*
.o
$(TARGET)
rm
-f
*
.o
$(TARGET)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment