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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
c39db2fe
Commit
c39db2fe
authored
Jan 05, 2005
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge joreland@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into mysql.com:/home/jonas/src/mysql-5.0-ndb
parents
597ecc8e
45738d53
Changes
38
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
627 additions
and
366 deletions
+627
-366
BitKeeper/etc/logging_ok
BitKeeper/etc/logging_ok
+1
-0
ndb/examples/Makefile
ndb/examples/Makefile
+7
-2
ndb/examples/ndbapi_async_example/ndbapi_async.cpp
ndb/examples/ndbapi_async_example/ndbapi_async.cpp
+1
-1
ndb/examples/ndbapi_async_example1/Makefile
ndb/examples/ndbapi_async_example1/Makefile
+3
-3
ndb/examples/ndbapi_async_example1/ndbapi_async1.cpp
ndb/examples/ndbapi_async_example1/ndbapi_async1.cpp
+3
-2
ndb/examples/ndbapi_event_example/Makefile
ndb/examples/ndbapi_event_example/Makefile
+3
-3
ndb/examples/ndbapi_event_example/ndbapi_event.cpp
ndb/examples/ndbapi_event_example/ndbapi_event.cpp
+53
-25
ndb/examples/ndbapi_retries_example/Makefile
ndb/examples/ndbapi_retries_example/Makefile
+3
-3
ndb/examples/ndbapi_retries_example/ndbapi_retries.cpp
ndb/examples/ndbapi_retries_example/ndbapi_retries.cpp
+4
-4
ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp
ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp
+7
-7
ndb/examples/ndbapi_simple_example/Makefile
ndb/examples/ndbapi_simple_example/Makefile
+1
-1
ndb/examples/ndbapi_simple_example/ndbapi_simple.cpp
ndb/examples/ndbapi_simple_example/ndbapi_simple.cpp
+6
-7
ndb/examples/ndbapi_simple_index_example/Makefile
ndb/examples/ndbapi_simple_index_example/Makefile
+1
-1
ndb/examples/ndbapi_simple_index_example/ndbapi_simple_index.cpp
...mples/ndbapi_simple_index_example/ndbapi_simple_index.cpp
+9
-9
ndb/include/kernel/signaldata/CreateEvnt.hpp
ndb/include/kernel/signaldata/CreateEvnt.hpp
+6
-7
ndb/include/ndbapi/Ndb.hpp
ndb/include/ndbapi/Ndb.hpp
+124
-111
ndb/include/ndbapi/NdbBlob.hpp
ndb/include/ndbapi/NdbBlob.hpp
+2
-2
ndb/include/ndbapi/NdbDictionary.hpp
ndb/include/ndbapi/NdbDictionary.hpp
+84
-24
ndb/include/ndbapi/NdbError.hpp
ndb/include/ndbapi/NdbError.hpp
+1
-1
ndb/include/ndbapi/NdbEventOperation.hpp
ndb/include/ndbapi/NdbEventOperation.hpp
+1
-1
ndb/include/ndbapi/NdbIndexScanOperation.hpp
ndb/include/ndbapi/NdbIndexScanOperation.hpp
+1
-1
ndb/include/ndbapi/NdbOperation.hpp
ndb/include/ndbapi/NdbOperation.hpp
+24
-6
ndb/include/ndbapi/NdbRecAttr.hpp
ndb/include/ndbapi/NdbRecAttr.hpp
+1
-1
ndb/include/ndbapi/NdbTransaction.hpp
ndb/include/ndbapi/NdbTransaction.hpp
+112
-51
ndb/src/ndbapi/NdbBlob.cpp
ndb/src/ndbapi/NdbBlob.cpp
+23
-22
ndb/src/ndbapi/NdbDictionary.cpp
ndb/src/ndbapi/NdbDictionary.cpp
+20
-2
ndb/src/ndbapi/NdbDictionaryImpl.cpp
ndb/src/ndbapi/NdbDictionaryImpl.cpp
+6
-5
ndb/src/ndbapi/NdbTransaction.cpp
ndb/src/ndbapi/NdbTransaction.cpp
+25
-12
ndb/src/ndbapi/ndberror.c
ndb/src/ndbapi/ndberror.c
+17
-0
ndb/tools/delete_all.cpp
ndb/tools/delete_all.cpp
+10
-8
ndb/tools/desc.cpp
ndb/tools/desc.cpp
+12
-10
ndb/tools/drop_index.cpp
ndb/tools/drop_index.cpp
+6
-4
ndb/tools/drop_tab.cpp
ndb/tools/drop_tab.cpp
+7
-4
ndb/tools/listTables.cpp
ndb/tools/listTables.cpp
+7
-4
ndb/tools/restore/consumer_restore.cpp
ndb/tools/restore/consumer_restore.cpp
+4
-3
ndb/tools/select_all.cpp
ndb/tools/select_all.cpp
+8
-7
ndb/tools/select_count.cpp
ndb/tools/select_count.cpp
+8
-6
sql/ha_ndbcluster.cc
sql/ha_ndbcluster.cc
+16
-6
No files found.
BitKeeper/etc/logging_ok
View file @
c39db2fe
...
@@ -96,6 +96,7 @@ jcole@tetra.spaceapes.com
...
@@ -96,6 +96,7 @@ jcole@tetra.spaceapes.com
jimw@mysql.com
jimw@mysql.com
joerg@mysql.com
joerg@mysql.com
jon@gigan.
jon@gigan.
jonas@mysql.com
joreland@bk-internal.mysql.com
joreland@bk-internal.mysql.com
joreland@mysql.com
joreland@mysql.com
jorge@linux.jorge.mysql.com
jorge@linux.jorge.mysql.com
...
...
ndb/examples/Makefile
View file @
c39db2fe
BIN_DIRS
:=
ndbapi_example1 ndbapi_example3 ndbapi_example4
\
BIN_DIRS
:=
ndbapi_simple_example
\
ndbapi_example5 ndbapi_scan_example
ndbapi_async_example
\
ndbapi_async_example1
\
ndbapi_retries_example
\
ndbapi_simple_index_example
\
ndbapi_event_example
\
ndbapi_scan_example
bins
:
$(patsubst %
,
_bins_%
,
$(BIN_DIRS))
bins
:
$(patsubst %
,
_bins_%
,
$(BIN_DIRS))
...
...
ndb/examples/ndbapi_async_example/ndbapi_async.cpp
View file @
c39db2fe
...
@@ -381,7 +381,7 @@ int populate(Ndb * myNdb, int data, async_callback_t * cbData)
...
@@ -381,7 +381,7 @@ int populate(Ndb * myNdb, int data, async_callback_t * cbData)
}
}
/*Prepare transaction (the transaction is NOT yet sent to NDB)*/
/*Prepare transaction (the transaction is NOT yet sent to NDB)*/
transaction
[
current
].
conn
->
executeAsynchPrepare
(
Commit
,
transaction
[
current
].
conn
->
executeAsynchPrepare
(
NdbTransaction
::
Commit
,
&
callback
,
&
callback
,
cb
);
cb
);
/**
/**
...
...
ndb/examples/ndbapi_
example3
/Makefile
→
ndb/examples/ndbapi_
async_example1
/Makefile
View file @
c39db2fe
TARGET
=
ndbapi_
example3
TARGET
=
ndbapi_
async1
SRCS
=
ndbapi_
example3
.cpp
SRCS
=
ndbapi_
async1
.cpp
OBJS
=
ndbapi_
example3
.o
OBJS
=
ndbapi_
async1
.o
CXX
=
g++
CXX
=
g++
CFLAGS
=
-c
-Wall
-fno-rtti
-fno-exceptions
CFLAGS
=
-c
-Wall
-fno-rtti
-fno-exceptions
DEBUG
=
DEBUG
=
...
...
ndb/examples/ndbapi_
example2/ndbapi_example2
.cpp
→
ndb/examples/ndbapi_
async_example1/ndbapi_async1
.cpp
View file @
c39db2fe
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
//
//
// ndbapi_
example2
.cpp: Using asynchronous transactions in NDB API
// ndbapi_
async1
.cpp: Using asynchronous transactions in NDB API
//
//
// Execute ndbapi_example1 to create the table "MYTABLENAME"
// Execute ndbapi_example1 to create the table "MYTABLENAME"
// before executing this program.
// before executing this program.
...
@@ -99,7 +99,8 @@ int main()
...
@@ -99,7 +99,8 @@ int main()
myNdbOperation
->
setValue
(
"ATTR2"
,
20
+
i
);
myNdbOperation
->
setValue
(
"ATTR2"
,
20
+
i
);
// Prepare transaction (the transaction is NOT yet sent to NDB)
// Prepare transaction (the transaction is NOT yet sent to NDB)
myNdbTransaction
[
i
]
->
executeAsynchPrepare
(
Commit
,
&
callback
,
NULL
);
myNdbTransaction
[
i
]
->
executeAsynchPrepare
(
NdbTransaction
::
Commit
,
&
callback
,
NULL
);
}
}
// Send all transactions to NDB
// Send all transactions to NDB
...
...
ndb/examples/ndbapi_e
xample5
/Makefile
→
ndb/examples/ndbapi_e
vent_example
/Makefile
View file @
c39db2fe
TARGET
=
ndbapi_e
xample5
TARGET
=
ndbapi_e
vent
SRCS
=
ndbapi_e
xample5
.cpp
SRCS
=
ndbapi_e
vent
.cpp
OBJS
=
ndbapi_e
xample5
.o
OBJS
=
ndbapi_e
vent
.o
CXX
=
g++
CXX
=
g++
CFLAGS
=
-c
-Wall
-fno-rtti
-fno-exceptions
CFLAGS
=
-c
-Wall
-fno-rtti
-fno-exceptions
CXXFLAGS
=
CXXFLAGS
=
...
...
ndb/examples/ndbapi_e
xample5/ndbapi_example5
.cpp
→
ndb/examples/ndbapi_e
vent_example/ndbapi_event
.cpp
View file @
c39db2fe
...
@@ -15,7 +15,38 @@
...
@@ -15,7 +15,38 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/**
/**
* ndbapi_example5.cpp: Using API level events in NDB API
* ndbapi_event.cpp: Using API level events in NDB API
*
* Classes and methods used in this example:
*
* Ndb_cluster_connection
* connect()
* wait_until_ready()
*
* Ndb
* init()
* getDictionary()
* createEventOperation()
* dropEventOperation()
* pollEvents()
*
* NdbDictionary
* createEvent()
* dropEvent()
*
* NdbDictionary::Event
* setTable()
* addTableEvent()
* addEventColumn()
*
* NdbEventOperation
* getValue()
* getPreValue()
* execute()
* next()
* isConsistent()
* getEventType()
*
*/
*/
#include <NdbApi.hpp>
#include <NdbApi.hpp>
...
@@ -32,12 +63,12 @@
...
@@ -32,12 +63,12 @@
* another process (e.g. flexBench -l 0 -stdtables).
* another process (e.g. flexBench -l 0 -stdtables).
* We want to monitor what happens with columns COL0, COL2, COL11
* We want to monitor what happens with columns COL0, COL2, COL11
*
*
* or together with the mysql
cluster
client;
* or together with the mysql client;
*
*
* shell> mysql
cluster
-u root
* shell> mysql -u root
* mysql> create database TEST_DB;
* mysql> create database TEST_DB;
* mysql> use TEST_DB;
* mysql> use TEST_DB;
* mysql> create table TAB0 (COL0 int primary key, COL1 int, COL11 int);
* mysql> create table TAB0 (COL0 int primary key, COL1 int, COL11 int)
engine=ndb
;
*
*
* In another window start ndbapi_example5, wait until properly started
* In another window start ndbapi_example5, wait until properly started
*
*
...
@@ -168,7 +199,7 @@ int main()
...
@@ -168,7 +199,7 @@ int main()
printf
(
"NULL"
);
printf
(
"NULL"
);
}
}
if
(
recAttrPre
[
i
]
->
isNULL
()
>=
0
)
{
// we have a value
if
(
recAttrPre
[
i
]
->
isNULL
()
>=
0
)
{
// we have a value
printf
(
" p
ost
[%u]="
,
i
);
printf
(
" p
re
[%u]="
,
i
);
if
(
recAttrPre
[
i
]
->
isNULL
()
==
0
)
// we have a non-null value
if
(
recAttrPre
[
i
]
->
isNULL
()
==
0
)
// we have a non-null value
printf
(
"%u"
,
recAttrPre
[
i
]
->
u_32_value
());
printf
(
"%u"
,
recAttrPre
[
i
]
->
u_32_value
());
else
// we have a null value
else
// we have a null value
...
@@ -181,7 +212,7 @@ int main()
...
@@ -181,7 +212,7 @@ int main()
;
//printf("timed out\n");
;
//printf("timed out\n");
}
}
// don't want to listen to events anymore
// don't want to listen to events anymore
myNdb
->
dropEventOperation
(
op
);
if
(
myNdb
->
dropEventOperation
(
op
))
APIERROR
(
myNdb
->
getNdbError
()
);
j
++
;
j
++
;
}
}
...
@@ -189,7 +220,8 @@ int main()
...
@@ -189,7 +220,8 @@ int main()
{
{
NdbDictionary
::
Dictionary
*
myDict
=
myNdb
->
getDictionary
();
NdbDictionary
::
Dictionary
*
myDict
=
myNdb
->
getDictionary
();
if
(
!
myDict
)
APIERROR
(
myNdb
->
getNdbError
());
if
(
!
myDict
)
APIERROR
(
myNdb
->
getNdbError
());
myDict
->
dropEvent
(
eventName
);
// remove event from database
// remove event from database
if
(
myDict
->
dropEvent
(
eventName
))
APIERROR
(
myDict
->
getNdbError
());
}
}
delete
myNdb
;
delete
myNdb
;
...
@@ -201,8 +233,8 @@ int main()
...
@@ -201,8 +233,8 @@ int main()
int
myCreateEvent
(
Ndb
*
myNdb
,
int
myCreateEvent
(
Ndb
*
myNdb
,
const
char
*
eventName
,
const
char
*
eventName
,
const
char
*
eventTableName
,
const
char
*
eventTableName
,
const
char
**
eventColumnName
,
const
char
**
eventColumnName
s
,
const
int
noEventColumnName
)
const
int
noEventColumnName
s
)
{
{
NdbDictionary
::
Dictionary
*
myDict
=
myNdb
->
getDictionary
();
NdbDictionary
::
Dictionary
*
myDict
=
myNdb
->
getDictionary
();
if
(
!
myDict
)
APIERROR
(
myNdb
->
getNdbError
());
if
(
!
myDict
)
APIERROR
(
myNdb
->
getNdbError
());
...
@@ -214,24 +246,20 @@ int myCreateEvent(Ndb* myNdb,
...
@@ -214,24 +246,20 @@ int myCreateEvent(Ndb* myNdb,
// myEvent.addTableEvent(NdbDictionary::Event::TE_UPDATE);
// myEvent.addTableEvent(NdbDictionary::Event::TE_UPDATE);
// myEvent.addTableEvent(NdbDictionary::Event::TE_DELETE);
// myEvent.addTableEvent(NdbDictionary::Event::TE_DELETE);
for
(
int
i
=
0
;
i
<
noEventColumnName
;
i
++
)
myEvent
.
addEventColumns
(
noEventColumnNames
,
eventColumnNames
);
myEvent
.
addEventColumn
(
eventColumnName
[
i
]);
int
res
=
myDict
->
createEvent
(
myEvent
);
// Add event to database
// Add event to database
if
(
myDict
->
createEvent
(
myEvent
)
==
0
)
if
(
res
==
0
)
myEvent
.
print
();
myEvent
.
print
();
else
{
else
if
(
myDict
->
getNdbError
().
code
==
4709
)
{
printf
(
"Event creation failed
\n
"
);
printf
(
"Event creation failed, event exists
\n
"
);
printf
(
"trying drop Event, maybe event exists
\n
"
);
printf
(
"dropping Event...
\n
"
);
res
=
myDict
->
dropEvent
(
eventName
);
if
(
myDict
->
dropEvent
(
eventName
))
APIERROR
(
myDict
->
getNdbError
());
if
(
res
)
exit
(
-
1
);
// try again
// try again
res
=
myDict
->
createEvent
(
myEvent
);
// Add event to database
// Add event to database
if
(
res
)
if
(
myDict
->
createEvent
(
myEvent
))
APIERROR
(
myDict
->
getNdbError
());
exit
(
-
1
);
}
else
}
APIERROR
(
myDict
->
getNdbError
());
return
res
;
return
0
;
}
}
ndb/examples/ndbapi_
example2
/Makefile
→
ndb/examples/ndbapi_
retries_example
/Makefile
View file @
c39db2fe
TARGET
=
ndbapi_
example2
TARGET
=
ndbapi_
retries
SRCS
=
ndbapi_
example2
.cpp
SRCS
=
ndbapi_
retries
.cpp
OBJS
=
ndbapi_
example2
.o
OBJS
=
ndbapi_
retries
.o
CXX
=
g++
CXX
=
g++
CFLAGS
=
-c
-Wall
-fno-rtti
-fno-exceptions
CFLAGS
=
-c
-Wall
-fno-rtti
-fno-exceptions
DEBUG
=
DEBUG
=
...
...
ndb/examples/ndbapi_
example3/ndbapi_example3
.cpp
→
ndb/examples/ndbapi_
retries_example/ndbapi_retries
.cpp
View file @
c39db2fe
...
@@ -15,9 +15,9 @@
...
@@ -15,9 +15,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
//
//
// ndbapi_
example3
.cpp: Error handling and transaction retries
// ndbapi_
retries
.cpp: Error handling and transaction retries
//
//
// Execute ndbapi_
example1
to create the table "MYTABLENAME"
// Execute ndbapi_
simple
to create the table "MYTABLENAME"
// before executing this program.
// before executing this program.
//
//
// There are many ways to program using the NDB API. In this example
// There are many ways to program using the NDB API. In this example
...
@@ -104,7 +104,7 @@ int insert(int transactionId, NdbTransaction* myTransaction) {
...
@@ -104,7 +104,7 @@ int insert(int transactionId, NdbTransaction* myTransaction) {
exit
(
-
1
);
exit
(
-
1
);
}
}
return
myTransaction
->
execute
(
NoCommit
);
return
myTransaction
->
execute
(
N
dbTransaction
::
N
oCommit
);
}
}
...
@@ -131,7 +131,7 @@ int executeInsertTransaction(int transactionId, Ndb* myNdb) {
...
@@ -131,7 +131,7 @@ int executeInsertTransaction(int transactionId, Ndb* myNdb) {
result
=
-
1
;
// Failure
result
=
-
1
;
// Failure
}
else
if
(
insert
(
transactionId
,
myTransaction
)
||
}
else
if
(
insert
(
transactionId
,
myTransaction
)
||
insert
(
10000
+
transactionId
,
myTransaction
)
||
insert
(
10000
+
transactionId
,
myTransaction
)
||
myTransaction
->
execute
(
Commit
))
{
myTransaction
->
execute
(
NdbTransaction
::
Commit
))
{
TRANSERROR
(
myTransaction
);
TRANSERROR
(
myTransaction
);
ndberror
=
myTransaction
->
getNdbError
();
ndberror
=
myTransaction
->
getNdbError
();
result
=
-
1
;
// Failure
result
=
-
1
;
// Failure
...
...
ndb/examples/ndbapi_scan_example/ndbapi_scan.cpp
View file @
c39db2fe
...
@@ -187,7 +187,7 @@ int populate(Ndb * myNdb)
...
@@ -187,7 +187,7 @@ int populate(Ndb * myNdb)
myNdbOperation
->
setValue
(
"COLOR"
,
cars
[
i
].
color
);
myNdbOperation
->
setValue
(
"COLOR"
,
cars
[
i
].
color
);
}
}
int
check
=
myTrans
->
execute
(
Commit
);
int
check
=
myTrans
->
execute
(
NdbTransaction
::
Commit
);
myTrans
->
close
();
myTrans
->
close
();
...
@@ -280,7 +280,7 @@ int scan_delete(Ndb* myNdb,
...
@@ -280,7 +280,7 @@ int scan_delete(Ndb* myNdb,
/**
/**
* Start scan (NoCommit since we are only reading at this stage);
* Start scan (NoCommit since we are only reading at this stage);
*/
*/
if
(
myTrans
->
execute
(
NoCommit
)
!=
0
){
if
(
myTrans
->
execute
(
N
dbTransaction
::
N
oCommit
)
!=
0
){
err
=
myTrans
->
getNdbError
();
err
=
myTrans
->
getNdbError
();
if
(
err
.
status
==
NdbError
::
TemporaryError
){
if
(
err
.
status
==
NdbError
::
TemporaryError
){
std
::
cout
<<
myTrans
->
getNdbError
().
message
<<
std
::
endl
;
std
::
cout
<<
myTrans
->
getNdbError
().
message
<<
std
::
endl
;
...
@@ -322,7 +322,7 @@ int scan_delete(Ndb* myNdb,
...
@@ -322,7 +322,7 @@ int scan_delete(Ndb* myNdb,
*/
*/
if
(
check
!=
-
1
)
if
(
check
!=
-
1
)
{
{
check
=
myTrans
->
execute
(
Commit
);
check
=
myTrans
->
execute
(
NdbTransaction
::
Commit
);
}
}
if
(
check
==
-
1
)
if
(
check
==
-
1
)
...
@@ -453,7 +453,7 @@ int scan_update(Ndb* myNdb,
...
@@ -453,7 +453,7 @@ int scan_update(Ndb* myNdb,
/**
/**
* Start scan (NoCommit since we are only reading at this stage);
* Start scan (NoCommit since we are only reading at this stage);
*/
*/
if
(
myTrans
->
execute
(
NoCommit
)
!=
0
)
if
(
myTrans
->
execute
(
N
dbTransaction
::
N
oCommit
)
!=
0
)
{
{
err
=
myTrans
->
getNdbError
();
err
=
myTrans
->
getNdbError
();
if
(
err
.
status
==
NdbError
::
TemporaryError
){
if
(
err
.
status
==
NdbError
::
TemporaryError
){
...
@@ -501,7 +501,7 @@ int scan_update(Ndb* myNdb,
...
@@ -501,7 +501,7 @@ int scan_update(Ndb* myNdb,
*/
*/
if
(
check
!=
-
1
)
if
(
check
!=
-
1
)
{
{
check
=
myTrans
->
execute
(
NoCommit
);
check
=
myTrans
->
execute
(
N
dbTransaction
::
N
oCommit
);
}
}
/**
/**
...
@@ -525,7 +525,7 @@ int scan_update(Ndb* myNdb,
...
@@ -525,7 +525,7 @@ int scan_update(Ndb* myNdb,
/**
/**
* Commit all prepared operations
* Commit all prepared operations
*/
*/
if
(
myTrans
->
execute
(
Commit
)
==
-
1
)
if
(
myTrans
->
execute
(
NdbTransaction
::
Commit
)
==
-
1
)
{
{
if
(
err
.
status
==
NdbError
::
TemporaryError
){
if
(
err
.
status
==
NdbError
::
TemporaryError
){
std
::
cout
<<
myTrans
->
getNdbError
().
message
<<
std
::
endl
;
std
::
cout
<<
myTrans
->
getNdbError
().
message
<<
std
::
endl
;
...
@@ -640,7 +640,7 @@ int scan_print(Ndb * myNdb)
...
@@ -640,7 +640,7 @@ int scan_print(Ndb * myNdb)
/**
/**
* Start scan (NoCommit since we are only reading at this stage);
* Start scan (NoCommit since we are only reading at this stage);
*/
*/
if
(
myTrans
->
execute
(
NoCommit
)
!=
0
){
if
(
myTrans
->
execute
(
N
dbTransaction
::
N
oCommit
)
!=
0
){
err
=
myTrans
->
getNdbError
();
err
=
myTrans
->
getNdbError
();
if
(
err
.
status
==
NdbError
::
TemporaryError
){
if
(
err
.
status
==
NdbError
::
TemporaryError
){
std
::
cout
<<
myTrans
->
getNdbError
().
message
<<
std
::
endl
;
std
::
cout
<<
myTrans
->
getNdbError
().
message
<<
std
::
endl
;
...
...
ndb/examples/ndbapi_
example1
/Makefile
→
ndb/examples/ndbapi_
simple_example
/Makefile
View file @
c39db2fe
TARGET
=
ndbapi_
example1
TARGET
=
ndbapi_
simple
SRCS
=
$(TARGET)
.cpp
SRCS
=
$(TARGET)
.cpp
OBJS
=
$(TARGET)
.o
OBJS
=
$(TARGET)
.o
CXX
=
g++
CXX
=
g++
...
...
ndb/examples/ndbapi_
example1/ndbapi_example1
.cpp
→
ndb/examples/ndbapi_
simple_example/ndbapi_simple
.cpp
View file @
c39db2fe
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/*
/*
* ndbapi_
example1
.cpp: Using synchronous transactions in NDB API
* ndbapi_
simple
.cpp: Using synchronous transactions in NDB API
*
*
* Correct output from this program is:
* Correct output from this program is:
*
*
...
@@ -72,7 +72,7 @@ int main()
...
@@ -72,7 +72,7 @@ int main()
}
}
// Optionally connect and wait for the storage nodes (ndbd's)
// Optionally connect and wait for the storage nodes (ndbd's)
if
(
cluster_connection
.
wait_until_ready
(
30
,
30
)
)
if
(
cluster_connection
.
wait_until_ready
(
30
,
0
)
<
0
)
{
{
std
::
cout
<<
"Cluster was not ready within 30 secs.
\n
"
;
std
::
cout
<<
"Cluster was not ready within 30 secs.
\n
"
;
exit
(
-
1
);
exit
(
-
1
);
...
@@ -92,7 +92,6 @@ int main()
...
@@ -92,7 +92,6 @@ int main()
run_application
(
mysql
,
cluster_connection
);
run_application
(
mysql
,
cluster_connection
);
}
}
// ndb_end should not be called until all "Ndb" objects are deleted
ndb_end
(
0
);
ndb_end
(
0
);
std
::
cout
<<
"
\n
To drop created table use:
\n
"
std
::
cout
<<
"
\n
To drop created table use:
\n
"
...
@@ -170,7 +169,7 @@ static void do_insert(Ndb &myNdb)
...
@@ -170,7 +169,7 @@ static void do_insert(Ndb &myNdb)
myOperation
->
equal
(
"ATTR1"
,
i
+
5
);
myOperation
->
equal
(
"ATTR1"
,
i
+
5
);
myOperation
->
setValue
(
"ATTR2"
,
i
+
5
);
myOperation
->
setValue
(
"ATTR2"
,
i
+
5
);
if
(
myTransaction
->
execute
(
Commit
)
==
-
1
)
if
(
myTransaction
->
execute
(
NdbTransaction
::
Commit
)
==
-
1
)
APIERROR
(
myTransaction
->
getNdbError
());
APIERROR
(
myTransaction
->
getNdbError
());
myNdb
.
closeTransaction
(
myTransaction
);
myNdb
.
closeTransaction
(
myTransaction
);
...
@@ -193,7 +192,7 @@ static void do_update(Ndb &myNdb)
...
@@ -193,7 +192,7 @@ static void do_update(Ndb &myNdb)
myOperation
->
equal
(
"ATTR1"
,
i
);
myOperation
->
equal
(
"ATTR1"
,
i
);
myOperation
->
setValue
(
"ATTR2"
,
i
+
10
);
myOperation
->
setValue
(
"ATTR2"
,
i
+
10
);
if
(
myTransaction
->
execute
(
Commit
)
==
-
1
)
if
(
myTransaction
->
execute
(
NdbTransaction
::
Commit
)
==
-
1
)
APIERROR
(
myTransaction
->
getNdbError
());
APIERROR
(
myTransaction
->
getNdbError
());
myNdb
.
closeTransaction
(
myTransaction
);
myNdb
.
closeTransaction
(
myTransaction
);
...
@@ -214,7 +213,7 @@ static void do_delete(Ndb &myNdb)
...
@@ -214,7 +213,7 @@ static void do_delete(Ndb &myNdb)
myOperation
->
deleteTuple
();
myOperation
->
deleteTuple
();
myOperation
->
equal
(
"ATTR1"
,
3
);
myOperation
->
equal
(
"ATTR1"
,
3
);
if
(
myTransaction
->
execute
(
Commit
)
==
-
1
)
if
(
myTransaction
->
execute
(
NdbTransaction
::
Commit
)
==
-
1
)
APIERROR
(
myTransaction
->
getNdbError
());
APIERROR
(
myTransaction
->
getNdbError
());
myNdb
.
closeTransaction
(
myTransaction
);
myNdb
.
closeTransaction
(
myTransaction
);
...
@@ -240,7 +239,7 @@ static void do_read(Ndb &myNdb)
...
@@ -240,7 +239,7 @@ static void do_read(Ndb &myNdb)
NdbRecAttr
*
myRecAttr
=
myOperation
->
getValue
(
"ATTR2"
,
NULL
);
NdbRecAttr
*
myRecAttr
=
myOperation
->
getValue
(
"ATTR2"
,
NULL
);
if
(
myRecAttr
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
if
(
myRecAttr
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
if
(
myTransaction
->
execute
(
Commit
)
==
-
1
)
if
(
myTransaction
->
execute
(
NdbTransaction
::
Commit
)
==
-
1
)
if
(
i
==
3
)
{
if
(
i
==
3
)
{
std
::
cout
<<
"Detected that deleted tuple doesn't exist!"
<<
std
::
endl
;
std
::
cout
<<
"Detected that deleted tuple doesn't exist!"
<<
std
::
endl
;
}
else
{
}
else
{
...
...
ndb/examples/ndbapi_
example4
/Makefile
→
ndb/examples/ndbapi_
simple_index_example
/Makefile
View file @
c39db2fe
TARGET
=
ndbapi_
example4
TARGET
=
ndbapi_
simple_index
SRCS
=
$(TARGET)
.cpp
SRCS
=
$(TARGET)
.cpp
OBJS
=
$(TARGET)
.o
OBJS
=
$(TARGET)
.o
CXX
=
g++
CXX
=
g++
...
...
ndb/examples/ndbapi_
example4/ndbapi_example4
.cpp
→
ndb/examples/ndbapi_
simple_index_example/ndbapi_simple_index
.cpp
View file @
c39db2fe
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
//
//
// ndbapi_
example4
.cpp: Using secondary indexes in NDB API
// ndbapi_
simple_index
.cpp: Using secondary indexes in NDB API
//
//
// Correct output from this program is:
// Correct output from this program is:
//
//
...
@@ -127,7 +127,7 @@ int main()
...
@@ -127,7 +127,7 @@ int main()
myOperation
->
equal
(
"ATTR1"
,
i
+
5
);
myOperation
->
equal
(
"ATTR1"
,
i
+
5
);
myOperation
->
setValue
(
"ATTR2"
,
i
+
5
);
myOperation
->
setValue
(
"ATTR2"
,
i
+
5
);
if
(
myTransaction
->
execute
(
Commit
)
==
-
1
)
if
(
myTransaction
->
execute
(
NdbTransaction
::
Commit
)
==
-
1
)
APIERROR
(
myTransaction
->
getNdbError
());
APIERROR
(
myTransaction
->
getNdbError
());
myNdb
->
closeTransaction
(
myTransaction
);
myNdb
->
closeTransaction
(
myTransaction
);
...
@@ -143,7 +143,7 @@ int main()
...
@@ -143,7 +143,7 @@ int main()
if
(
myTransaction
==
NULL
)
APIERROR
(
myNdb
->
getNdbError
());
if
(
myTransaction
==
NULL
)
APIERROR
(
myNdb
->
getNdbError
());
NdbIndexOperation
*
myIndexOperation
=
NdbIndexOperation
*
myIndexOperation
=
myTransaction
->
getNdbIndexOperation
(
"MYINDEXNAME
$unique
"
,
"MYTABLENAME"
);
myTransaction
->
getNdbIndexOperation
(
"MYINDEXNAME"
,
"MYTABLENAME"
);
if
(
myIndexOperation
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
if
(
myIndexOperation
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
myIndexOperation
->
readTuple
(
NdbOperation
::
LM_Read
);
myIndexOperation
->
readTuple
(
NdbOperation
::
LM_Read
);
...
@@ -152,7 +152,7 @@ int main()
...
@@ -152,7 +152,7 @@ int main()
NdbRecAttr
*
myRecAttr
=
myIndexOperation
->
getValue
(
"ATTR1"
,
NULL
);
NdbRecAttr
*
myRecAttr
=
myIndexOperation
->
getValue
(
"ATTR1"
,
NULL
);
if
(
myRecAttr
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
if
(
myRecAttr
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
if
(
myTransaction
->
execute
(
Commit
)
!=
-
1
)
if
(
myTransaction
->
execute
(
NdbTransaction
::
Commit
)
!=
-
1
)
printf
(
" %2d %2d
\n
"
,
myRecAttr
->
u_32_value
(),
i
);
printf
(
" %2d %2d
\n
"
,
myRecAttr
->
u_32_value
(),
i
);
myNdb
->
closeTransaction
(
myTransaction
);
myNdb
->
closeTransaction
(
myTransaction
);
...
@@ -166,14 +166,14 @@ int main()
...
@@ -166,14 +166,14 @@ int main()
if
(
myTransaction
==
NULL
)
APIERROR
(
myNdb
->
getNdbError
());
if
(
myTransaction
==
NULL
)
APIERROR
(
myNdb
->
getNdbError
());
NdbIndexOperation
*
myIndexOperation
=
NdbIndexOperation
*
myIndexOperation
=
myTransaction
->
getNdbIndexOperation
(
"MYINDEXNAME
$unique
"
,
"MYTABLENAME"
);
myTransaction
->
getNdbIndexOperation
(
"MYINDEXNAME"
,
"MYTABLENAME"
);
if
(
myIndexOperation
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
if
(
myIndexOperation
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
myIndexOperation
->
updateTuple
();
myIndexOperation
->
updateTuple
();
myIndexOperation
->
equal
(
"ATTR2"
,
i
);
myIndexOperation
->
equal
(
"ATTR2"
,
i
);
myIndexOperation
->
setValue
(
"ATTR2"
,
i
+
10
);
myIndexOperation
->
setValue
(
"ATTR2"
,
i
+
10
);
if
(
myTransaction
->
execute
(
Commit
)
==
-
1
)
if
(
myTransaction
->
execute
(
NdbTransaction
::
Commit
)
==
-
1
)
APIERROR
(
myTransaction
->
getNdbError
());
APIERROR
(
myTransaction
->
getNdbError
());
myNdb
->
closeTransaction
(
myTransaction
);
myNdb
->
closeTransaction
(
myTransaction
);
...
@@ -187,13 +187,13 @@ int main()
...
@@ -187,13 +187,13 @@ int main()
if
(
myTransaction
==
NULL
)
APIERROR
(
myNdb
->
getNdbError
());
if
(
myTransaction
==
NULL
)
APIERROR
(
myNdb
->
getNdbError
());
NdbIndexOperation
*
myIndexOperation
=
NdbIndexOperation
*
myIndexOperation
=
myTransaction
->
getNdbIndexOperation
(
"MYINDEXNAME
$unique
"
,
"MYTABLENAME"
);
myTransaction
->
getNdbIndexOperation
(
"MYINDEXNAME"
,
"MYTABLENAME"
);
if
(
myIndexOperation
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
if
(
myIndexOperation
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
myIndexOperation
->
deleteTuple
();
myIndexOperation
->
deleteTuple
();
myIndexOperation
->
equal
(
"ATTR2"
,
3
);
myIndexOperation
->
equal
(
"ATTR2"
,
3
);
if
(
myTransaction
->
execute
(
Commit
)
==
-
1
)
if
(
myTransaction
->
execute
(
NdbTransaction
::
Commit
)
==
-
1
)
APIERROR
(
myTransaction
->
getNdbError
());
APIERROR
(
myTransaction
->
getNdbError
());
myNdb
->
closeTransaction
(
myTransaction
);
myNdb
->
closeTransaction
(
myTransaction
);
...
@@ -218,7 +218,7 @@ int main()
...
@@ -218,7 +218,7 @@ int main()
NdbRecAttr
*
myRecAttr
=
myOperation
->
getValue
(
"ATTR2"
,
NULL
);
NdbRecAttr
*
myRecAttr
=
myOperation
->
getValue
(
"ATTR2"
,
NULL
);
if
(
myRecAttr
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
if
(
myRecAttr
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
if
(
myTransaction
->
execute
(
Commit
)
==
-
1
)
if
(
myTransaction
->
execute
(
NdbTransaction
::
Commit
)
==
-
1
)
if
(
i
==
3
)
{
if
(
i
==
3
)
{
std
::
cout
<<
"Detected that deleted tuple doesn't exist!
\n
"
;
std
::
cout
<<
"Detected that deleted tuple doesn't exist!
\n
"
;
}
else
{
}
else
{
...
...
ndb/include/kernel/signaldata/CreateEvnt.hpp
View file @
c39db2fe
...
@@ -101,7 +101,7 @@ public:
...
@@ -101,7 +101,7 @@ public:
Busy
=
701
,
Busy
=
701
,
NotMaster
=
702
,
NotMaster
=
702
,
SeizeError
=
703
,
SeizeError
=
703
,
EventNotFound
=
4
238
,
EventNotFound
=
4
710
,
EventNameTooLong
=
4241
,
EventNameTooLong
=
4241
,
TooManyEvents
=
4242
,
TooManyEvents
=
4242
,
BadRequestType
=
4247
,
BadRequestType
=
4247
,
...
@@ -363,11 +363,10 @@ struct CreateEvntRef {
...
@@ -363,11 +363,10 @@ struct CreateEvntRef {
Busy
=
701
,
Busy
=
701
,
NotMaster
=
702
,
NotMaster
=
702
,
SeizeError
=
703
,
SeizeError
=
703
,
EventNotFound
=
4238
,
TooManyEvents
=
4707
,
EventExists
=
4239
,
EventNameTooLong
=
4708
,
EventNameTooLong
=
4241
,
EventExists
=
4709
,
TooManyEvents
=
4242
,
EventNotFound
=
4731
,
// EventExists = 4244,
AttributeNotStored
=
4245
,
AttributeNotStored
=
4245
,
AttributeNullable
=
4246
,
AttributeNullable
=
4246
,
BadRequestType
=
4247
,
BadRequestType
=
4247
,
...
@@ -376,7 +375,7 @@ struct CreateEvntRef {
...
@@ -376,7 +375,7 @@ struct CreateEvntRef {
InvalidEventType
=
4250
,
InvalidEventType
=
4250
,
NotUnique
=
4251
,
NotUnique
=
4251
,
AllocationError
=
4252
,
AllocationError
=
4252
,
CreateEventTableFailed
=
4
253
,
CreateEventTableFailed
=
4
711
,
InvalidAttributeOrder
=
4255
,
InvalidAttributeOrder
=
4255
,
Temporary
=
0x1
<<
16
Temporary
=
0x1
<<
16
};
};
...
...
ndb/include/ndbapi/Ndb.hpp
View file @
c39db2fe
This diff is collapsed.
Click to expand it.
ndb/include/ndbapi/NdbBlob.hpp
View file @
c39db2fe
...
@@ -309,8 +309,8 @@ private:
...
@@ -309,8 +309,8 @@ private:
int
invokeActiveHook
();
int
invokeActiveHook
();
// blob handle maintenance
// blob handle maintenance
int
atPrepare
(
NdbTransaction
*
aCon
,
NdbOperation
*
anOp
,
const
NdbColumnImpl
*
aColumn
);
int
atPrepare
(
NdbTransaction
*
aCon
,
NdbOperation
*
anOp
,
const
NdbColumnImpl
*
aColumn
);
int
preExecute
(
ExecType
anExecType
,
bool
&
batch
);
int
preExecute
(
NdbTransaction
::
ExecType
anExecType
,
bool
&
batch
);
int
postExecute
(
ExecType
anExecType
);
int
postExecute
(
NdbTransaction
::
ExecType
anExecType
);
int
preCommit
();
int
preCommit
();
int
atNextResult
();
int
atNextResult
();
// errors
// errors
...
...
ndb/include/ndbapi/NdbDictionary.hpp
View file @
c39db2fe
...
@@ -56,7 +56,7 @@ typedef struct charset_info_st CHARSET_INFO;
...
@@ -56,7 +56,7 @@ typedef struct charset_info_st CHARSET_INFO;
* -# NdbDictionary::Column for creating table columns
* -# NdbDictionary::Column for creating table columns
* -# NdbDictionary::Index for creating secondary indexes
* -# NdbDictionary::Index for creating secondary indexes
*
*
* See @ref ndbapi_
example4
.cpp for details of usage.
* See @ref ndbapi_
simple_index
.cpp for details of usage.
*/
*/
class
NdbDictionary
{
class
NdbDictionary
{
public:
public:
...
@@ -286,14 +286,14 @@ public:
...
@@ -286,14 +286,14 @@ public:
int
getSize
()
const
;
int
getSize
()
const
;
/**
/**
* Check if column is part of
distribu
tion key
* Check if column is part of
parti
tion key
*
*
* A <em>
distribu
tion key</em> is a set of attributes which are used
* A <em>
parti
tion key</em> is a set of attributes which are used
* to distribute the tuples onto the NDB nodes.
* to distribute the tuples onto the NDB nodes.
* The
distribu
tion key uses the NDB Cluster hashing function.
* The
parti
tion key uses the NDB Cluster hashing function.
*
*
* An example where this is useful is TPC-C where it might be
* An example where this is useful is TPC-C where it might be
* good to use the warehouse id and district id as the
distribu
tion key.
* good to use the warehouse id and district id as the
parti
tion key.
* This would place all data for a specific district and warehouse
* This would place all data for a specific district and warehouse
* in the same database node.
* in the same database node.
*
*
...
@@ -301,9 +301,12 @@ public:
...
@@ -301,9 +301,12 @@ public:
* will still be used with the hashing algorithm.
* will still be used with the hashing algorithm.
*
*
* @return true then the column is part of
* @return true then the column is part of
* the
distribu
tion key.
* the
parti
tion key.
*/
*/
bool
getDistributionKey
()
const
;
bool
getPartitionKey
()
const
;
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
inline
bool
getDistributionKey
()
const
{
return
getPartitionKey
();
};
#endif
/** @} *******************************************************************/
/** @} *******************************************************************/
...
@@ -401,13 +404,17 @@ public:
...
@@ -401,13 +404,17 @@ public:
void
setStripeSize
(
int
size
);
void
setStripeSize
(
int
size
);
/**
/**
* Set
distribu
tion key
* Set
parti
tion key
* @see get
Distribu
tionKey
* @see get
Parti
tionKey
*
*
* @param enable If set to true, then the column will be part of
* @param enable If set to true, then the column will be part of
* the
distribu
tion key.
* the
parti
tion key.
*/
*/
void
setDistributionKey
(
bool
enable
);
void
setPartitionKey
(
bool
enable
);
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
inline
void
setDistributionKey
(
bool
enable
)
{
setPartitionKey
(
enable
);
};
#endif
/** @} *******************************************************************/
/** @} *******************************************************************/
...
@@ -691,7 +698,7 @@ public:
...
@@ -691,7 +698,7 @@ public:
/** @} *******************************************************************/
/** @} *******************************************************************/
#ifndef DOXYGEN_SHOULD_SKIP_
DEPRECATED
#ifndef DOXYGEN_SHOULD_SKIP_
INTERNAL
void
setStoredTable
(
bool
x
)
{
setLogging
(
x
);
}
void
setStoredTable
(
bool
x
)
{
setLogging
(
x
);
}
bool
getStoredTable
()
const
{
return
getLogging
();
}
bool
getStoredTable
()
const
{
return
getLogging
();
}
...
@@ -894,32 +901,80 @@ public:
...
@@ -894,32 +901,80 @@ public:
*/
*/
class
Event
:
public
Object
{
class
Event
:
public
Object
{
public:
public:
enum
TableEvent
{
TE_INSERT
=
1
,
TE_DELETE
=
2
,
TE_UPDATE
=
4
,
TE_ALL
=
7
};
enum
TableEvent
{
TE_INSERT
=
1
,
///< Insert event on table
TE_DELETE
=
2
,
///< Delete event on table
TE_UPDATE
=
4
,
///< Update event on table
TE_ALL
=
7
///< Any/all event on table (not relevant when
///< events are received)
};
enum
EventDurability
{
enum
EventDurability
{
ED_UNDEFINED
=
0
,
ED_UNDEFINED
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
=
0
#endif
#if 0 // not supported
#if 0 // not supported
ED_SESSION = 1,
,
ED_SESSION = 1,
// Only this API can use it
// Only this API can use it
// and it's deleted after api has disconnected or ndb has restarted
// and it's deleted after api has disconnected or ndb has restarted
ED_TEMPORARY = 2
,
ED_TEMPORARY = 2
// All API's can use it,
// All API's can use it,
// But's its removed when ndb is restarted
// But's its removed when ndb is restarted
#endif
#endif
ED_PERMANENT
=
3
,
ED_PERMANENT
///< All API's can use it,
// All API's can use it,
///< It's still defined after a restart
// It's still defined after a restart
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
=
3
#endif
};
};
Event
(
const
char
*
name
);
Event
(
const
char
*
name
);
virtual
~
Event
();
virtual
~
Event
();
void
setName
(
const
char
*
);
/**
void
setTable
(
const
char
*
);
* Set unique identifier for the event
void
addTableEvent
(
const
TableEvent
);
*/
void
setDurability
(
const
EventDurability
);
void
setName
(
const
char
*
name
);
/**
* Set table for which events should be detected
*/
void
setTable
(
const
char
*
tableName
);
/**
* Add type of event that should be detected
*/
void
addTableEvent
(
const
TableEvent
te
);
/**
* Set durability of the event
*/
void
setDurability
(
const
EventDurability
ed
);
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
void
addColumn
(
const
Column
&
c
);
void
addColumn
(
const
Column
&
c
);
#endif
/**
* Add a column on which events should be detected
*
* @param attrId Column id
*
* @note errors will mot be detected until createEvent() is called
*/
void
addEventColumn
(
unsigned
attrId
);
void
addEventColumn
(
unsigned
attrId
);
/**
* Add a column on which events should be detected
*
* @param columnName Column name
*
* @note errors will mot be detected until createEvent() is called
*/
void
addEventColumn
(
const
char
*
columnName
);
void
addEventColumn
(
const
char
*
columnName
);
/**
* Add several columns on which events should be detected
*
* @param n Number of columns
* @param columnNames Column names
*
* @note errors will mot be detected until
* NdbDictionary::Dictionary::createEvent() is called
*/
void
addEventColumns
(
int
n
,
const
char
**
columnNames
);
void
addEventColumns
(
int
n
,
const
char
**
columnNames
);
/**
/**
...
@@ -932,7 +987,9 @@ public:
...
@@ -932,7 +987,9 @@ public:
*/
*/
virtual
int
getObjectVersion
()
const
;
virtual
int
getObjectVersion
()
const
;
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
void
print
();
void
print
();
#endif
private:
private:
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
...
@@ -1003,6 +1060,8 @@ public:
...
@@ -1003,6 +1060,8 @@ public:
* Fetch list of all objects, optionally restricted to given type.
* Fetch list of all objects, optionally restricted to given type.
*/
*/
int
listObjects
(
List
&
list
,
Object
::
Type
type
=
Object
::
TypeUndefined
);
int
listObjects
(
List
&
list
,
Object
::
Type
type
=
Object
::
TypeUndefined
);
int
listObjects
(
List
&
list
,
Object
::
Type
type
=
Object
::
TypeUndefined
)
const
;
/**
/**
* Get the latest error
* Get the latest error
...
@@ -1041,6 +1100,7 @@ public:
...
@@ -1041,6 +1100,7 @@ public:
* @return 0 if successful, otherwise -1
* @return 0 if successful, otherwise -1
*/
*/
int
listIndexes
(
List
&
list
,
const
char
*
tableName
);
int
listIndexes
(
List
&
list
,
const
char
*
tableName
);
int
listIndexes
(
List
&
list
,
const
char
*
tableName
)
const
;
/** @} *******************************************************************/
/** @} *******************************************************************/
/**
/**
...
...
ndb/include/ndbapi/NdbError.hpp
View file @
c39db2fe
...
@@ -41,7 +41,7 @@
...
@@ -41,7 +41,7 @@
* The <em>error messages</em> and <em>error details</em> may
* The <em>error messages</em> and <em>error details</em> may
* change without notice.
* change without notice.
*
*
* For example of use, see @ref ndbapi_
example3
.cpp.
* For example of use, see @ref ndbapi_
retries
.cpp.
*/
*/
struct
NdbError
{
struct
NdbError
{
/**
/**
...
...
ndb/include/ndbapi/NdbEventOperation.hpp
View file @
c39db2fe
...
@@ -46,7 +46,7 @@ class NdbEventOperationImpl;
...
@@ -46,7 +46,7 @@ class NdbEventOperationImpl;
* The instance is removed by Ndb::dropEventOperation
* The instance is removed by Ndb::dropEventOperation
*
*
* For more info see:
* For more info see:
* @ref ndbapi_e
xample5
.cpp
* @ref ndbapi_e
vent
.cpp
*
*
* Known limitations:
* Known limitations:
*
*
...
...
ndb/include/ndbapi/NdbIndexScanOperation.hpp
View file @
c39db2fe
...
@@ -73,7 +73,7 @@ public:
...
@@ -73,7 +73,7 @@ public:
*
*
* For equality, it is better to use BoundEQ instead of the equivalent
* For equality, it is better to use BoundEQ instead of the equivalent
* pair of BoundLE and BoundGE. This is especially true when table
* pair of BoundLE and BoundGE. This is especially true when table
*
distribu
tion key is an initial part of the index key.
*
parti
tion key is an initial part of the index key.
*
*
* The sets of lower and upper bounds must be on initial sequences of
* The sets of lower and upper bounds must be on initial sequences of
* index keys. All but possibly the last bound must be non-strict.
* index keys. All but possibly the last bound must be non-strict.
...
...
ndb/include/ndbapi/NdbOperation.hpp
View file @
c39db2fe
...
@@ -59,10 +59,17 @@ public:
...
@@ -59,10 +59,17 @@ public:
*/
*/
enum
LockMode
{
enum
LockMode
{
LM_Read
=
0
,
LM_Read
///< Read with shared lock
LM_Exclusive
=
1
,
LM_CommittedRead
=
2
,
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
=
0
#endif
,
LM_Exclusive
///< Read with exclusive lock
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
=
1
#endif
,
LM_CommittedRead
///< Ignore locks, read last committed value
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
=
2
,
LM_Dirty
=
2
LM_Dirty
=
2
#endif
#endif
};
};
...
@@ -237,10 +244,13 @@ public:
...
@@ -237,10 +244,13 @@ public:
* use several equals (then all of them must be satisfied for the
* use several equals (then all of them must be satisfied for the
* tuple to be selected).
* tuple to be selected).
*
*
* @note There are 10 versions of NdbOperation::equal with
* @note For insertTuple() it is also allowed to define the
* search key by using setValue().
*
* @note There are 10 versions of equal() with
* slightly different parameters.
* slightly different parameters.
*
*
* @note When using
NdbOperation::equal
with a string (char *) as
* @note When using
equal()
with a string (char *) as
* second argument, the string needs to be padded with
* second argument, the string needs to be padded with
* zeros in the following sense:
* zeros in the following sense:
* @code
* @code
...
@@ -248,6 +258,8 @@ public:
...
@@ -248,6 +258,8 @@ public:
* strncpy(buf, str, sizeof(buf));
* strncpy(buf, str, sizeof(buf));
* NdbOperation->equal("Attr1", buf);
* NdbOperation->equal("Attr1", buf);
* @endcode
* @endcode
*
*
*
*
* @param anAttrName Attribute name
* @param anAttrName Attribute name
* @param aValue Attribute value.
* @param aValue Attribute value.
...
@@ -328,6 +340,12 @@ public:
...
@@ -328,6 +340,12 @@ public:
* then the API will assume that the pointer
* then the API will assume that the pointer
* is correct and not bother with checking it.
* is correct and not bother with checking it.
*
*
* @note For insertTuple() the NDB API will automatically detect that
* it is supposed to use equal() instead.
*
* @note For insertTuple() it is not necessary to use
* setValue() on key attributes before other attributes.
*
* @note There are 14 versions of NdbOperation::setValue with
* @note There are 14 versions of NdbOperation::setValue with
* slightly different parameters.
* slightly different parameters.
*
*
...
@@ -720,7 +738,7 @@ public:
...
@@ -720,7 +738,7 @@ public:
void
setAbortOption
(
Int8
ao
)
{
m_abortOption
=
ao
;
}
void
setAbortOption
(
Int8
ao
)
{
m_abortOption
=
ao
;
}
/**
/**
* Set/get
distribution/
partition key
* Set/get partition key
*/
*/
void
setPartitionId
(
Uint32
id
);
void
setPartitionId
(
Uint32
id
);
void
setPartitionHash
(
Uint32
key
);
void
setPartitionHash
(
Uint32
key
);
...
...
ndb/include/ndbapi/NdbRecAttr.hpp
View file @
c39db2fe
...
@@ -39,7 +39,7 @@ class NdbOperation;
...
@@ -39,7 +39,7 @@ class NdbOperation;
* ndbout << MyRecAttr->u_32_value();
* ndbout << MyRecAttr->u_32_value();
* @endcode
* @endcode
* For more examples, see
* For more examples, see
* @ref ndbapi_
example1
.cpp.
* @ref ndbapi_
simple
.cpp.
*
*
* @note The NdbRecAttr object is instantiated with its value when
* @note The NdbRecAttr object is instantiated with its value when
* NdbTransaction::execute is called. Before this, the value is
* NdbTransaction::execute is called. Before this, the value is
...
...
ndb/include/ndbapi/NdbTransaction.hpp
View file @
c39db2fe
...
@@ -42,72 +42,62 @@ class NdbBlob;
...
@@ -42,72 +42,62 @@ class NdbBlob;
typedef
void
(
*
NdbAsynchCallback
)(
int
,
NdbTransaction
*
,
void
*
);
typedef
void
(
*
NdbAsynchCallback
)(
int
,
NdbTransaction
*
,
void
*
);
#endif
#endif
/**
* Commit type of transaction
*/
enum
AbortOption
{
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
CommitIfFailFree
=
0
,
enum
AbortOption
{
Commit
AsMuchAsPossible
=
2
,
///< Commit transaction with as many
Commit
IfFailFree
=
0
,
TryCommit
=
0
,
///< <i>Missing explanation</i>
TryCommit
=
0
,
#endif
AbortOnError
=
0
,
AbortOnError
=
0
,
///< Abort transaction on failed operation
CommitAsMuchAsPossible
=
2
,
AO_IgnoreError
=
2
///< Transaction continues on failed operation
AO_IgnoreError
=
2
};
};
typedef
AbortOption
CommitType
;
/**
* Execution type of transaction
*/
enum
ExecType
{
enum
ExecType
{
NoExecTypeDef
=
-
1
,
///< Erroneous type (Used for debugging only)
NoExecTypeDef
=
-
1
,
Prepare
,
///< <i>Missing explanation</i>
Prepare
,
NoCommit
,
///< Execute the transaction as far as it has
NoCommit
,
///< been defined, but do not yet commit it
Commit
,
Commit
,
///< Execute and try to commit the transaction
Rollback
Rollback
///< Rollback transaction
};
};
#endif
/**
/**
* @class NdbTransaction
* @class NdbTransaction
* @brief Represents a transaction.
* @brief Represents a transaction.
*
*
* A transaction (represented by an NdbTransaction object)
* A transaction (represented by an NdbTransaction object)
* belongs to an Ndb object and is
typically
created using
* belongs to an Ndb object and is created using
* Ndb::startTransaction.
* Ndb::startTransaction
()
.
* A transaction consists of a list of operations
* A transaction consists of a list of operations
* (represented by NdbOperation objects).
* (represented by NdbOperation, NdbScanOperation, NdbIndexOperation,
* and NdbIndexScanOperation objects).
* Each operation access exactly one table.
* Each operation access exactly one table.
*
*
* After getting the NdbTransaction object,
* After getting the NdbTransaction object,
* the first step is to get (allocate) an operation given the table name.
* the first step is to get (allocate) an operation given the table name using
* one of the methods getNdbOperation(), getNdbScanOperation(),
* getNdbIndexOperation(), or getNdbIndexScanOperation().
* Then the operation is defined.
* Then the operation is defined.
* Several operations can be defined
in parallel
on the same
* Several operations can be defined on the same
* NdbTransaction object
.
* NdbTransaction object
, they will in that case be executed in parallell.
* When all operations are defined, the
NdbTransaction::execute
* When all operations are defined, the
execute()
* method sends them to the NDB kernel for execution.
* method sends them to the NDB kernel for execution.
*
*
* The
NdbTransaction::execute
method returns when the NDB kernel has
* The
execute()
method returns when the NDB kernel has
* completed execution of all operations defined before the call to
* completed execution of all operations defined before the call to
* NdbTransaction::execute.
* execute(). All allocated operations should be properly defined
* All allocated operations should be properly defined
* before calling execute().
* before calling NdbTransaction::execute.
*
*
* A call to
NdbTransaction::execute
uses one out of three types of execution:
* A call to
execute()
uses one out of three types of execution:
* -#
ExecType
::NoCommit Executes operations without committing them.
* -#
NdbTransaction
::NoCommit Executes operations without committing them.
* -#
ExecType::Commit
Executes remaining operation and commits the
* -#
NdbTransaction::Commit
Executes remaining operation and commits the
* complete transaction
* complete transaction
* -#
ExecType
::Rollback Rollbacks the entire transaction.
* -#
NdbTransaction
::Rollback Rollbacks the entire transaction.
*
*
*
NdbTransaction::execute is equipped with an extra error handling parameter
*
execute() is equipped with an extra error handling parameter.
* There are two alternatives:
* There are two alternatives:
* -#
AbortOp
tion::AbortOnError (default).
* -#
NdbTransac
tion::AbortOnError (default).
* The transaction is aborted if there are any error during the
* The transaction is aborted if there are any error during the
* execution
* execution
* -#
AbortOption::
IgnoreError
* -#
NdbTransaction::AO_
IgnoreError
* Continue execution of transaction even if operation fails
* Continue execution of transaction even if operation fails
*
*
*/
*/
...
@@ -139,6 +129,7 @@ enum ExecType {
...
@@ -139,6 +129,7 @@ enum ExecType {
* primary key since it came along from the scanned tuple.
* primary key since it came along from the scanned tuple.
*
*
*/
*/
class
NdbTransaction
class
NdbTransaction
{
{
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
...
@@ -152,6 +143,44 @@ class NdbTransaction
...
@@ -152,6 +143,44 @@ class NdbTransaction
public:
public:
/**
* Commit type of transaction
*/
enum
AbortOption
{
AbortOnError
=
///< Abort transaction on failed operation
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
::
AbortOnError
#endif
,
AO_IgnoreError
=
///< Transaction continues on failed operation
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
::
AO_IgnoreError
#endif
};
/**
* Execution type of transaction
*/
enum
ExecType
{
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
NoExecTypeDef
=
::
NoExecTypeDef
,
///< Erroneous type (Used for debugging only)
Prepare
=
::
Prepare
,
///< <i>Missing explanation</i>
#endif
NoCommit
=
///< Execute the transaction as far as it has
///< been defined, but do not yet commit it
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
::
NoCommit
#endif
,
Commit
=
///< Execute and try to commit the transaction
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
::
Commit
#endif
,
Rollback
///< Rollback transaction
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
=
::
Rollback
#endif
};
/**
/**
* Get an NdbOperation for a table.
* Get an NdbOperation for a table.
* Note that the operation has to be defined before it is executed.
* Note that the operation has to be defined before it is executed.
...
@@ -279,9 +308,15 @@ public:
...
@@ -279,9 +308,15 @@ public:
* the send.
* the send.
* @return 0 if successful otherwise -1.
* @return 0 if successful otherwise -1.
*/
*/
int
execute
(
ExecType
execType
,
int
execute
(
ExecType
execType
,
AbortOption
abortOption
=
AbortOnError
,
AbortOption
abortOption
=
AbortOnError
,
int
force
=
0
);
int
force
=
0
);
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
int
execute
(
::
ExecType
execType
,
::
AbortOption
abortOption
=
::
AbortOnError
,
int
force
=
0
)
{
return
execute
((
ExecType
)
execType
,(
AbortOption
)
abortOption
,
force
);
}
#endif
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
// to be documented later
// to be documented later
...
@@ -298,7 +333,7 @@ public:
...
@@ -298,7 +333,7 @@ public:
* ExecType::Rollback rollbacks the entire transaction.
* ExecType::Rollback rollbacks the entire transaction.
* @param callback A callback method. This method gets
* @param callback A callback method. This method gets
* called when the transaction has been
* called when the transaction has been
* executed. See @ref ndbapi_
example2
.cpp
* executed. See @ref ndbapi_
async1
.cpp
* for an example on how to specify and use
* for an example on how to specify and use
* a callback method.
* a callback method.
* @param anyObject A void pointer. This pointer is forwarded to the
* @param anyObject A void pointer. This pointer is forwarded to the
...
@@ -312,6 +347,14 @@ public:
...
@@ -312,6 +347,14 @@ public:
NdbAsynchCallback
callback
,
NdbAsynchCallback
callback
,
void
*
anyObject
,
void
*
anyObject
,
AbortOption
abortOption
=
AbortOnError
);
AbortOption
abortOption
=
AbortOnError
);
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
void
executeAsynchPrepare
(
::
ExecType
execType
,
NdbAsynchCallback
callback
,
void
*
anyObject
,
::
AbortOption
abortOption
=
::
AbortOnError
)
{
executeAsynchPrepare
((
ExecType
)
execType
,
callback
,
anyObject
,
(
AbortOption
)
abortOption
);
}
#endif
/**
/**
* Prepare and send an asynchronous transaction.
* Prepare and send an asynchronous transaction.
...
@@ -330,6 +373,14 @@ public:
...
@@ -330,6 +373,14 @@ public:
NdbAsynchCallback
aCallback
,
NdbAsynchCallback
aCallback
,
void
*
anyObject
,
void
*
anyObject
,
AbortOption
abortOption
=
AbortOnError
);
AbortOption
abortOption
=
AbortOnError
);
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
void
executeAsynch
(
::
ExecType
aTypeOfExec
,
NdbAsynchCallback
aCallback
,
void
*
anyObject
,
::
AbortOption
abortOption
=
::
AbortOnError
)
{
executeAsynch
((
ExecType
)
aTypeOfExec
,
aCallback
,
anyObject
,
(
AbortOption
)
abortOption
);
}
#endif
#endif
#endif
/**
/**
* Refresh
* Refresh
...
@@ -345,6 +396,8 @@ public:
...
@@ -345,6 +396,8 @@ public:
/**
/**
* Close transaction
* Close transaction
*
* @note Equivalent to to calling Ndb::closeTransaction()
*/
*/
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
#ifndef DOXYGEN_SHOULD_SKIP_INTERNAL
/**
/**
...
@@ -366,7 +419,13 @@ public:
...
@@ -366,7 +419,13 @@ public:
* Once a transaction has been completed successfully
* Once a transaction has been completed successfully
* it can be started again wo/ calling closeTransaction/startTransaction
* it can be started again wo/ calling closeTransaction/startTransaction
*
*
* Note this method also releases completed operations
* @note This method also releases completed operations
*
* @note This method does not close open scans,
* c.f. NdbScanOperation::close()
*
* @note This method can only be called _directly_ after commit
* and only if commit is successful
*/
*/
int
restart
();
int
restart
();
#endif
#endif
...
@@ -409,10 +468,7 @@ public:
...
@@ -409,10 +468,7 @@ public:
Uint64
getTransactionId
();
Uint64
getTransactionId
();
/**
/**
* Returns the commit status of the transaction.
* The commit status of the transaction.
*
* @return The commit status of the transaction, i.e. one of
* { NotStarted, Started, TimeOut, Committed, Aborted, NeedAbort }
*/
*/
enum
CommitStatusType
{
enum
CommitStatusType
{
NotStarted
,
///< Transaction not yet started
NotStarted
,
///< Transaction not yet started
...
@@ -422,6 +478,11 @@ public:
...
@@ -422,6 +478,11 @@ public:
NeedAbort
///< <i>Missing explanation</i>
NeedAbort
///< <i>Missing explanation</i>
};
};
/**
* Get the commit status of the transaction.
*
* @return The commit status of the transaction
*/
CommitStatusType
commitStatus
();
CommitStatusType
commitStatus
();
/** @} *********************************************************************/
/** @} *********************************************************************/
...
@@ -443,7 +504,7 @@ public:
...
@@ -443,7 +504,7 @@ public:
* This method is used on the NdbTransaction object to find the
* This method is used on the NdbTransaction object to find the
* NdbOperation causing an error.
* NdbOperation causing an error.
* To find more information about the
* To find more information about the
* actual error, use method NdbOperation::getNdbError
* actual error, use method NdbOperation::getNdbError
()
* on the returned NdbOperation object.
* on the returned NdbOperation object.
*
*
* @return The NdbOperation causing the latest error.
* @return The NdbOperation causing the latest error.
...
...
ndb/src/ndbapi/NdbBlob.cpp
View file @
c39db2fe
...
@@ -875,7 +875,7 @@ NdbBlob::readParts(char* buf, Uint32 part, Uint32 count)
...
@@ -875,7 +875,7 @@ NdbBlob::readParts(char* buf, Uint32 part, Uint32 count)
setErrorCode
(
tOp
);
setErrorCode
(
tOp
);
return
-
1
;
return
-
1
;
}
}
tOp
->
m_abortOption
=
AbortOnError
;
tOp
->
m_abortOption
=
NdbTransaction
::
AbortOnError
;
buf
+=
thePartSize
;
buf
+=
thePartSize
;
n
++
;
n
++
;
thePendingBlobOps
|=
(
1
<<
NdbOperation
::
ReadRequest
);
thePendingBlobOps
|=
(
1
<<
NdbOperation
::
ReadRequest
);
...
@@ -898,7 +898,7 @@ NdbBlob::insertParts(const char* buf, Uint32 part, Uint32 count)
...
@@ -898,7 +898,7 @@ NdbBlob::insertParts(const char* buf, Uint32 part, Uint32 count)
setErrorCode
(
tOp
);
setErrorCode
(
tOp
);
return
-
1
;
return
-
1
;
}
}
tOp
->
m_abortOption
=
AbortOnError
;
tOp
->
m_abortOption
=
NdbTransaction
::
AbortOnError
;
buf
+=
thePartSize
;
buf
+=
thePartSize
;
n
++
;
n
++
;
thePendingBlobOps
|=
(
1
<<
NdbOperation
::
InsertRequest
);
thePendingBlobOps
|=
(
1
<<
NdbOperation
::
InsertRequest
);
...
@@ -921,7 +921,7 @@ NdbBlob::updateParts(const char* buf, Uint32 part, Uint32 count)
...
@@ -921,7 +921,7 @@ NdbBlob::updateParts(const char* buf, Uint32 part, Uint32 count)
setErrorCode
(
tOp
);
setErrorCode
(
tOp
);
return
-
1
;
return
-
1
;
}
}
tOp
->
m_abortOption
=
AbortOnError
;
tOp
->
m_abortOption
=
NdbTransaction
::
AbortOnError
;
buf
+=
thePartSize
;
buf
+=
thePartSize
;
n
++
;
n
++
;
thePendingBlobOps
|=
(
1
<<
NdbOperation
::
UpdateRequest
);
thePendingBlobOps
|=
(
1
<<
NdbOperation
::
UpdateRequest
);
...
@@ -943,7 +943,7 @@ NdbBlob::deleteParts(Uint32 part, Uint32 count)
...
@@ -943,7 +943,7 @@ NdbBlob::deleteParts(Uint32 part, Uint32 count)
setErrorCode
(
tOp
);
setErrorCode
(
tOp
);
return
-
1
;
return
-
1
;
}
}
tOp
->
m_abortOption
=
AbortOnError
;
tOp
->
m_abortOption
=
NdbTransaction
::
AbortOnError
;
n
++
;
n
++
;
thePendingBlobOps
|=
(
1
<<
NdbOperation
::
DeleteRequest
);
thePendingBlobOps
|=
(
1
<<
NdbOperation
::
DeleteRequest
);
theNdbCon
->
thePendingBlobOps
|=
(
1
<<
NdbOperation
::
DeleteRequest
);
theNdbCon
->
thePendingBlobOps
|=
(
1
<<
NdbOperation
::
DeleteRequest
);
...
@@ -976,11 +976,11 @@ NdbBlob::deletePartsUnknown(Uint32 part)
...
@@ -976,11 +976,11 @@ NdbBlob::deletePartsUnknown(Uint32 part)
setErrorCode
(
tOp
);
setErrorCode
(
tOp
);
return
-
1
;
return
-
1
;
}
}
tOp
->
m_abortOption
=
AO_IgnoreError
;
tOp
->
m_abortOption
=
NdbTransaction
::
AO_IgnoreError
;
n
++
;
n
++
;
}
}
DBG
(
"deletePartsUnknown: executeNoBlobs [in] bat="
<<
bat
);
DBG
(
"deletePartsUnknown: executeNoBlobs [in] bat="
<<
bat
);
if
(
theNdbCon
->
executeNoBlobs
(
NoCommit
)
==
-
1
)
if
(
theNdbCon
->
executeNoBlobs
(
N
dbTransaction
::
N
oCommit
)
==
-
1
)
return
-
1
;
return
-
1
;
DBG
(
"deletePartsUnknown: executeNoBlobs [out]"
);
DBG
(
"deletePartsUnknown: executeNoBlobs [out]"
);
n
=
0
;
n
=
0
;
...
@@ -1012,7 +1012,7 @@ NdbBlob::executePendingBlobReads()
...
@@ -1012,7 +1012,7 @@ NdbBlob::executePendingBlobReads()
Uint8
flags
=
(
1
<<
NdbOperation
::
ReadRequest
);
Uint8
flags
=
(
1
<<
NdbOperation
::
ReadRequest
);
if
(
thePendingBlobOps
&
flags
)
{
if
(
thePendingBlobOps
&
flags
)
{
DBG
(
"executePendingBlobReads: executeNoBlobs [in]"
);
DBG
(
"executePendingBlobReads: executeNoBlobs [in]"
);
if
(
theNdbCon
->
executeNoBlobs
(
NoCommit
)
==
-
1
)
if
(
theNdbCon
->
executeNoBlobs
(
N
dbTransaction
::
N
oCommit
)
==
-
1
)
return
-
1
;
return
-
1
;
DBG
(
"executePendingBlobReads: executeNoBlobs [out]"
);
DBG
(
"executePendingBlobReads: executeNoBlobs [out]"
);
thePendingBlobOps
=
0
;
thePendingBlobOps
=
0
;
...
@@ -1027,7 +1027,7 @@ NdbBlob::executePendingBlobWrites()
...
@@ -1027,7 +1027,7 @@ NdbBlob::executePendingBlobWrites()
Uint8
flags
=
0xFF
&
~
(
1
<<
NdbOperation
::
ReadRequest
);
Uint8
flags
=
0xFF
&
~
(
1
<<
NdbOperation
::
ReadRequest
);
if
(
thePendingBlobOps
&
flags
)
{
if
(
thePendingBlobOps
&
flags
)
{
DBG
(
"executePendingBlobWrites: executeNoBlobs [in]"
);
DBG
(
"executePendingBlobWrites: executeNoBlobs [in]"
);
if
(
theNdbCon
->
executeNoBlobs
(
NoCommit
)
==
-
1
)
if
(
theNdbCon
->
executeNoBlobs
(
N
dbTransaction
::
N
oCommit
)
==
-
1
)
return
-
1
;
return
-
1
;
DBG
(
"executePendingBlobWrites: executeNoBlobs [out]"
);
DBG
(
"executePendingBlobWrites: executeNoBlobs [out]"
);
thePendingBlobOps
=
0
;
thePendingBlobOps
=
0
;
...
@@ -1175,7 +1175,7 @@ NdbBlob::atPrepare(NdbTransaction* aCon, NdbOperation* anOp, const NdbColumnImpl
...
@@ -1175,7 +1175,7 @@ NdbBlob::atPrepare(NdbTransaction* aCon, NdbOperation* anOp, const NdbColumnImpl
* back after postExecute.
* back after postExecute.
*/
*/
int
int
NdbBlob
::
preExecute
(
ExecType
anExecType
,
bool
&
batch
)
NdbBlob
::
preExecute
(
NdbTransaction
::
ExecType
anExecType
,
bool
&
batch
)
{
{
DBG
(
"preExecute [in]"
);
DBG
(
"preExecute [in]"
);
if
(
theState
==
Invalid
)
if
(
theState
==
Invalid
)
...
@@ -1224,7 +1224,7 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch)
...
@@ -1224,7 +1224,7 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch)
return
-
1
;
return
-
1
;
}
}
if
(
isWriteOp
())
{
if
(
isWriteOp
())
{
tOp
->
m_abortOption
=
AO_IgnoreError
;
tOp
->
m_abortOption
=
NdbTransaction
::
AO_IgnoreError
;
}
}
theHeadInlineReadOp
=
tOp
;
theHeadInlineReadOp
=
tOp
;
// execute immediately
// execute immediately
...
@@ -1270,7 +1270,7 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch)
...
@@ -1270,7 +1270,7 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch)
return
-
1
;
return
-
1
;
}
}
if
(
isWriteOp
())
{
if
(
isWriteOp
())
{
tOp
->
m_abortOption
=
AO_IgnoreError
;
tOp
->
m_abortOption
=
NdbTransaction
::
AO_IgnoreError
;
}
}
theHeadInlineReadOp
=
tOp
;
theHeadInlineReadOp
=
tOp
;
// execute immediately
// execute immediately
...
@@ -1316,18 +1316,18 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch)
...
@@ -1316,18 +1316,18 @@ NdbBlob::preExecute(ExecType anExecType, bool& batch)
* any remaining prepared operations.
* any remaining prepared operations.
*/
*/
int
int
NdbBlob
::
postExecute
(
ExecType
anExecType
)
NdbBlob
::
postExecute
(
NdbTransaction
::
ExecType
anExecType
)
{
{
DBG
(
"postExecute [in] type="
<<
anExecType
);
DBG
(
"postExecute [in] type="
<<
anExecType
);
if
(
theState
==
Invalid
)
if
(
theState
==
Invalid
)
return
-
1
;
return
-
1
;
if
(
theState
==
Active
)
{
if
(
theState
==
Active
)
{
setState
(
anExecType
==
NoCommit
?
Active
:
Closed
);
setState
(
anExecType
==
N
dbTransaction
::
N
oCommit
?
Active
:
Closed
);
DBG
(
"postExecute [skip]"
);
DBG
(
"postExecute [skip]"
);
return
0
;
return
0
;
}
}
assert
(
theState
==
Prepared
);
assert
(
theState
==
Prepared
);
setState
(
anExecType
==
NoCommit
?
Active
:
Closed
);
setState
(
anExecType
==
N
dbTransaction
::
N
oCommit
?
Active
:
Closed
);
assert
(
isKeyOp
());
assert
(
isKeyOp
());
if
(
isIndexOp
())
{
if
(
isIndexOp
())
{
NdbBlob
*
tFirstBlob
=
theNdbOp
->
theBlobList
;
NdbBlob
*
tFirstBlob
=
theNdbOp
->
theBlobList
;
...
@@ -1343,14 +1343,15 @@ NdbBlob::postExecute(ExecType anExecType)
...
@@ -1343,14 +1343,15 @@ NdbBlob::postExecute(ExecType anExecType)
return
-
1
;
return
-
1
;
if
(
theGetFlag
)
{
if
(
theGetFlag
)
{
assert
(
theGetSetBytes
==
0
||
theGetBuf
!=
0
);
assert
(
theGetSetBytes
==
0
||
theGetBuf
!=
0
);
assert
(
theGetSetBytes
<=
theInlineSize
||
anExecType
==
NoCommit
);
assert
(
theGetSetBytes
<=
theInlineSize
||
anExecType
==
NdbTransaction
::
NoCommit
);
Uint32
bytes
=
theGetSetBytes
;
Uint32
bytes
=
theGetSetBytes
;
if
(
readDataPrivate
(
theGetBuf
,
bytes
)
==
-
1
)
if
(
readDataPrivate
(
theGetBuf
,
bytes
)
==
-
1
)
return
-
1
;
return
-
1
;
}
}
}
}
if
(
isUpdateOp
())
{
if
(
isUpdateOp
())
{
assert
(
anExecType
==
NoCommit
);
assert
(
anExecType
==
N
dbTransaction
::
N
oCommit
);
getHeadFromRecAttr
();
getHeadFromRecAttr
();
if
(
theSetFlag
)
{
if
(
theSetFlag
)
{
// setValue overwrites everything
// setValue overwrites everything
...
@@ -1367,7 +1368,7 @@ NdbBlob::postExecute(ExecType anExecType)
...
@@ -1367,7 +1368,7 @@ NdbBlob::postExecute(ExecType anExecType)
}
}
}
}
if
(
isWriteOp
()
&&
isTableOp
())
{
if
(
isWriteOp
()
&&
isTableOp
())
{
assert
(
anExecType
==
NoCommit
);
assert
(
anExecType
==
N
dbTransaction
::
N
oCommit
);
if
(
theHeadInlineReadOp
->
theError
.
code
==
0
)
{
if
(
theHeadInlineReadOp
->
theError
.
code
==
0
)
{
int
tNullFlag
=
theNullFlag
;
int
tNullFlag
=
theNullFlag
;
Uint64
tLength
=
theLength
;
Uint64
tLength
=
theLength
;
...
@@ -1418,18 +1419,18 @@ NdbBlob::postExecute(ExecType anExecType)
...
@@ -1418,18 +1419,18 @@ NdbBlob::postExecute(ExecType anExecType)
}
}
}
}
if
(
isDeleteOp
())
{
if
(
isDeleteOp
())
{
assert
(
anExecType
==
NoCommit
);
assert
(
anExecType
==
N
dbTransaction
::
N
oCommit
);
getHeadFromRecAttr
();
getHeadFromRecAttr
();
if
(
deleteParts
(
0
,
getPartCount
())
==
-
1
)
if
(
deleteParts
(
0
,
getPartCount
())
==
-
1
)
return
-
1
;
return
-
1
;
}
}
setState
(
anExecType
==
NoCommit
?
Active
:
Closed
);
setState
(
anExecType
==
N
dbTransaction
::
N
oCommit
?
Active
:
Closed
);
// activation callback
// activation callback
if
(
theActiveHook
!=
NULL
)
{
if
(
theActiveHook
!=
NULL
)
{
if
(
invokeActiveHook
()
==
-
1
)
if
(
invokeActiveHook
()
==
-
1
)
return
-
1
;
return
-
1
;
}
}
if
(
anExecType
==
NoCommit
&&
theHeadInlineUpdateFlag
)
{
if
(
anExecType
==
N
dbTransaction
::
N
oCommit
&&
theHeadInlineUpdateFlag
)
{
NdbOperation
*
tOp
=
theNdbCon
->
getNdbOperation
(
theTable
);
NdbOperation
*
tOp
=
theNdbCon
->
getNdbOperation
(
theTable
);
if
(
tOp
==
NULL
||
if
(
tOp
==
NULL
||
tOp
->
updateTuple
()
==
-
1
||
tOp
->
updateTuple
()
==
-
1
||
...
@@ -1438,7 +1439,7 @@ NdbBlob::postExecute(ExecType anExecType)
...
@@ -1438,7 +1439,7 @@ NdbBlob::postExecute(ExecType anExecType)
setErrorCode
(
NdbBlobImpl
::
ErrAbort
);
setErrorCode
(
NdbBlobImpl
::
ErrAbort
);
return
-
1
;
return
-
1
;
}
}
tOp
->
m_abortOption
=
AbortOnError
;
tOp
->
m_abortOption
=
NdbTransaction
::
AbortOnError
;
DBG
(
"added op to update head+inline"
);
DBG
(
"added op to update head+inline"
);
}
}
DBG
(
"postExecute [out]"
);
DBG
(
"postExecute [out]"
);
...
@@ -1468,7 +1469,7 @@ NdbBlob::preCommit()
...
@@ -1468,7 +1469,7 @@ NdbBlob::preCommit()
setErrorCode
(
NdbBlobImpl
::
ErrAbort
);
setErrorCode
(
NdbBlobImpl
::
ErrAbort
);
return
-
1
;
return
-
1
;
}
}
tOp
->
m_abortOption
=
AbortOnError
;
tOp
->
m_abortOption
=
NdbTransaction
::
AbortOnError
;
DBG
(
"added op to update head+inline"
);
DBG
(
"added op to update head+inline"
);
}
}
}
}
...
...
ndb/src/ndbapi/NdbDictionary.cpp
View file @
c39db2fe
...
@@ -177,12 +177,12 @@ NdbDictionary::Column::getPrimaryKey() const {
...
@@ -177,12 +177,12 @@ NdbDictionary::Column::getPrimaryKey() const {
}
}
void
void
NdbDictionary
::
Column
::
set
Distribu
tionKey
(
bool
val
){
NdbDictionary
::
Column
::
set
Parti
tionKey
(
bool
val
){
m_impl
.
m_distributionKey
=
val
;
m_impl
.
m_distributionKey
=
val
;
}
}
bool
bool
NdbDictionary
::
Column
::
get
Distribu
tionKey
()
const
{
NdbDictionary
::
Column
::
get
Parti
tionKey
()
const
{
return
m_impl
.
m_distributionKey
;
return
m_impl
.
m_distributionKey
;
}
}
...
@@ -823,6 +823,12 @@ NdbDictionary::Dictionary::listObjects(List& list, Object::Type type)
...
@@ -823,6 +823,12 @@ NdbDictionary::Dictionary::listObjects(List& list, Object::Type type)
return
m_impl
.
listObjects
(
list
,
type
);
return
m_impl
.
listObjects
(
list
,
type
);
}
}
int
NdbDictionary
::
Dictionary
::
listObjects
(
List
&
list
,
Object
::
Type
type
)
const
{
return
m_impl
.
listObjects
(
list
,
type
);
}
int
int
NdbDictionary
::
Dictionary
::
listIndexes
(
List
&
list
,
const
char
*
tableName
)
NdbDictionary
::
Dictionary
::
listIndexes
(
List
&
list
,
const
char
*
tableName
)
{
{
...
@@ -834,6 +840,18 @@ NdbDictionary::Dictionary::listIndexes(List& list, const char * tableName)
...
@@ -834,6 +840,18 @@ NdbDictionary::Dictionary::listIndexes(List& list, const char * tableName)
return
m_impl
.
listIndexes
(
list
,
tab
->
getTableId
());
return
m_impl
.
listIndexes
(
list
,
tab
->
getTableId
());
}
}
int
NdbDictionary
::
Dictionary
::
listIndexes
(
List
&
list
,
const
char
*
tableName
)
const
{
const
NdbDictionary
::
Table
*
tab
=
getTable
(
tableName
);
if
(
tab
==
0
)
{
return
-
1
;
}
return
m_impl
.
listIndexes
(
list
,
tab
->
getTableId
());
}
const
struct
NdbError
&
const
struct
NdbError
&
NdbDictionary
::
Dictionary
::
getNdbError
()
const
{
NdbDictionary
::
Dictionary
::
getNdbError
()
const
{
return
m_impl
.
getNdbError
();
return
m_impl
.
getNdbError
();
...
...
ndb/src/ndbapi/NdbDictionaryImpl.cpp
View file @
c39db2fe
...
@@ -941,7 +941,7 @@ NdbDictInterface::dictSignal(NdbApiSignal* signal,
...
@@ -941,7 +941,7 @@ NdbDictInterface::dictSignal(NdbApiSignal* signal,
for
(
int
j
=
0
;
j
<
noerrcodes
;
j
++
)
for
(
int
j
=
0
;
j
<
noerrcodes
;
j
++
)
if
(
m_error
.
code
==
errcodes
[
j
])
{
if
(
m_error
.
code
==
errcodes
[
j
])
{
doContinue
=
1
;
doContinue
=
1
;
continue
;
break
;
}
}
if
(
doContinue
)
if
(
doContinue
)
continue
;
continue
;
...
@@ -1007,12 +1007,14 @@ NdbDictInterface::getTable(class NdbApiSignal * signal,
...
@@ -1007,12 +1007,14 @@ NdbDictInterface::getTable(class NdbApiSignal * signal,
Uint32
noOfSections
,
bool
fullyQualifiedNames
)
Uint32
noOfSections
,
bool
fullyQualifiedNames
)
{
{
//GetTabInfoReq * const req = CAST_PTR(GetTabInfoReq, signal->getDataPtrSend());
//GetTabInfoReq * const req = CAST_PTR(GetTabInfoReq, signal->getDataPtrSend());
int
errCodes
[]
=
{
GetTabInfoRef
::
Busy
};
int
r
=
dictSignal
(
signal
,
ptr
,
noOfSections
,
int
r
=
dictSignal
(
signal
,
ptr
,
noOfSections
,
0
/*do not use masternode id*/
,
0
/*do not use masternode id*/
,
100
,
100
,
WAIT_GET_TAB_INFO_REQ
,
WAIT_GET_TAB_INFO_REQ
,
WAITFOR_RESPONSE_TIMEOUT
,
WAITFOR_RESPONSE_TIMEOUT
,
NULL
,
0
);
errCodes
,
1
);
if
(
r
)
return
0
;
if
(
r
)
return
0
;
NdbTableImpl
*
rt
=
0
;
NdbTableImpl
*
rt
=
0
;
...
@@ -2234,10 +2236,9 @@ NdbDictionaryImpl::createEvent(NdbEventImpl & evnt)
...
@@ -2234,10 +2236,9 @@ NdbDictionaryImpl::createEvent(NdbEventImpl & evnt)
NdbTableImpl
*
tab
=
getTable
(
evnt
.
getTable
());
NdbTableImpl
*
tab
=
getTable
(
evnt
.
getTable
());
if
(
tab
==
0
){
if
(
tab
==
0
){
// m_error.code = 3249;
ndbout_c
(
":createEvent: table %s not found"
,
evnt
.
getTable
());
#ifdef EVENT_DEBUG
#ifdef EVENT_DEBUG
ndbout_c
(
"NdbDictionaryImpl::createEvent: table not found: %s"
,
evnt
.
getTable
());
ndbout_c
(
"NdbDictionaryImpl::createEvent: table not found: %s"
,
evnt
.
getTable
());
#endif
#endif
return
-
1
;
return
-
1
;
}
}
...
...
ndb/src/ndbapi/NdbTransaction.cpp
View file @
c39db2fe
...
@@ -1076,15 +1076,15 @@ NdbTransaction::getNdbScanOperation(const char* aTableName)
...
@@ -1076,15 +1076,15 @@ NdbTransaction::getNdbScanOperation(const char* aTableName)
}
//NdbTransaction::getNdbScanOperation()
}
//NdbTransaction::getNdbScanOperation()
/*****************************************************************************
/*****************************************************************************
NdbScanOperation* getNdbScanOperation(const char* anIndexName, const char* aTableName);
NdbScanOperation* getNdb
Index
ScanOperation(const char* anIndexName, const char* aTableName);
Return Value Return a pointer to a Ndb
ScanOperation object if getNdb
ScanOperation was succesful.
Return Value Return a pointer to a Ndb
IndexScanOperation object if getNdbIndex
ScanOperation was succesful.
Return NULL : In all other case.
Return NULL : In all other case.
Parameters: anIndexName : Name of the index to use.
Parameters: anIndexName : Name of the index to use.
aTableName : Name of the database table.
aTableName : Name of the database table.
Remark: Get an operation from NdbScanOperation idlelist and get the NdbTransaction object
Remark: Get an operation from Ndb
Index
ScanOperation idlelist and get the NdbTransaction object
who was fetch by startTransaction pointing to this operation
who was fetch by startTransaction pointing to this operation
getOperation will set the theTableId in the NdbOperation object.synchronous
getOperation will set the theTableId in the Ndb
IndexScan
Operation object.synchronous
******************************************************************************/
******************************************************************************/
NdbIndexScanOperation
*
NdbIndexScanOperation
*
NdbTransaction
::
getNdbIndexScanOperation
(
const
char
*
anIndexName
,
NdbTransaction
::
getNdbIndexScanOperation
(
const
char
*
anIndexName
,
...
@@ -1134,12 +1134,12 @@ NdbTransaction::getNdbIndexScanOperation(const NdbDictionary::Index * index,
...
@@ -1134,12 +1134,12 @@ NdbTransaction::getNdbIndexScanOperation(const NdbDictionary::Index * index,
/*****************************************************************************
/*****************************************************************************
NdbScanOperation* getNdbScanOperation(int aTableId);
NdbScanOperation* getNdbScanOperation(int aTableId);
Return Value Return a pointer to a Ndb
Operation object if getNdb
Operation was succesful.
Return Value Return a pointer to a Ndb
ScanOperation object if getNdbScan
Operation was succesful.
Return NULL: In all other case.
Return NULL: In all other case.
Parameters: tableId : Id of the database table beeing deleted.
Parameters: tableId : Id of the database table beeing deleted.
Remark: Get an operation from NdbScanOperation object idlelist and get the NdbTransaction
Remark: Get an operation from NdbScanOperation object idlelist and get the NdbTransaction
object who was fetch by startTransaction pointing to this operation
object who was fetch by startTransaction pointing to this operation
getOperation will set the theTableId in the NdbOperation object, synchronous.
getOperation will set the theTableId in the Ndb
Scan
Operation object, synchronous.
*****************************************************************************/
*****************************************************************************/
NdbIndexScanOperation
*
NdbIndexScanOperation
*
NdbTransaction
::
getNdbScanOperation
(
const
NdbTableImpl
*
tab
)
NdbTransaction
::
getNdbScanOperation
(
const
NdbTableImpl
*
tab
)
...
@@ -1203,12 +1203,12 @@ NdbTransaction::getNdbScanOperation(const NdbDictionary::Table * table)
...
@@ -1203,12 +1203,12 @@ NdbTransaction::getNdbScanOperation(const NdbDictionary::Table * table)
NdbIndexOperation* getNdbIndexOperation(const char* anIndexName,
NdbIndexOperation* getNdbIndexOperation(const char* anIndexName,
const char* aTableName);
const char* aTableName);
Return Value Return a pointer to a NdbOperation object if getNdb
Scan
Operation was succesful.
Return Value Return a pointer to a NdbOperation object if getNdb
Index
Operation was succesful.
Return NULL : In all other case.
Return NULL : In all other case.
Parameters: aTableName : Name of the database table.
Parameters: aTableName : Name of the database table.
Remark: Get an operation from Ndb
Scan
Operation idlelist and get the NdbTransaction object
Remark: Get an operation from Ndb
Index
Operation idlelist and get the NdbTransaction object
who was fetch by startTransaction pointing to this
operation
who was fetch by startTransaction pointing to this operation
getOperation will set the theTableId in the Ndb
Scan
Operation object.synchronous
getOperation will set the theTableId in the Ndb
Index
Operation object.synchronous
******************************************************************************/
******************************************************************************/
NdbIndexOperation
*
NdbIndexOperation
*
NdbTransaction
::
getNdbIndexOperation
(
const
char
*
anIndexName
,
NdbTransaction
::
getNdbIndexOperation
(
const
char
*
anIndexName
,
...
@@ -1216,8 +1216,21 @@ NdbTransaction::getNdbIndexOperation(const char* anIndexName,
...
@@ -1216,8 +1216,21 @@ NdbTransaction::getNdbIndexOperation(const char* anIndexName,
{
{
if
(
theCommitStatus
==
Started
)
{
if
(
theCommitStatus
==
Started
)
{
NdbTableImpl
*
table
=
theNdb
->
theDictionary
->
getTable
(
aTableName
);
NdbTableImpl
*
table
=
theNdb
->
theDictionary
->
getTable
(
aTableName
);
NdbIndexImpl
*
index
=
theNdb
->
theDictionary
->
getIndex
(
anIndexName
,
NdbIndexImpl
*
index
;
aTableName
);
if
(
table
->
m_frm
.
get_data
())
{
// This unique index is defined from SQL level
static
const
char
*
uniqueSuffix
=
"$unique"
;
char
uniqueIndexName
[
MAX_TAB_NAME_SIZE
];
strxnmov
(
uniqueIndexName
,
MAX_TAB_NAME_SIZE
,
anIndexName
,
uniqueSuffix
,
NullS
);
index
=
theNdb
->
theDictionary
->
getIndex
(
uniqueIndexName
,
aTableName
);
}
else
index
=
theNdb
->
theDictionary
->
getIndex
(
anIndexName
,
aTableName
);
if
(
table
!=
0
&&
index
!=
0
){
if
(
table
!=
0
&&
index
!=
0
){
return
getNdbIndexOperation
(
index
,
table
);
return
getNdbIndexOperation
(
index
,
table
);
}
}
...
...
ndb/src/ndbapi/ndberror.c
View file @
c39db2fe
...
@@ -79,6 +79,7 @@ static const char* empty_string = "";
...
@@ -79,6 +79,7 @@ static const char* empty_string = "";
* 4400 - ""
* 4400 - ""
* 4500 - ""
* 4500 - ""
* 4600 - ""
* 4600 - ""
* 4700 - "" Event
* 5000 - Management server
* 5000 - Management server
*/
*/
...
@@ -296,6 +297,22 @@ ErrorBundle ErrorCodes[] = {
...
@@ -296,6 +297,22 @@ ErrorBundle ErrorCodes[] = {
{
4232
,
AE
,
"Parallelism can only be between 1 and 240"
},
{
4232
,
AE
,
"Parallelism can only be between 1 and 240"
},
{
290
,
AE
,
"Scan not started or has been closed by kernel due to timeout"
},
{
290
,
AE
,
"Scan not started or has been closed by kernel due to timeout"
},
/**
* Event application errors
*/
{
4707
,
AE
,
"Too many event have been defined"
},
{
4708
,
AE
,
"Event name is too long"
},
{
4709
,
AE
,
"Event already exists"
},
{
4710
,
AE
,
"Event not found"
},
{
4711
,
AE
,
"Creation of event failed"
},
/**
* Event internal errors
*/
{
4731
,
IE
,
"Event not found"
},
/**
/**
* SchemaError
* SchemaError
*/
*/
...
...
ndb/tools/delete_all.cpp
View file @
c39db2fe
...
@@ -80,19 +80,21 @@ int main(int argc, char** argv){
...
@@ -80,19 +80,21 @@ int main(int argc, char** argv){
Ndb_cluster_connection
con
(
opt_connect_str
);
Ndb_cluster_connection
con
(
opt_connect_str
);
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
{
ndbout
<<
"Unable to connect to management server."
<<
endl
;
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
if
(
con
.
wait_until_ready
(
30
,
0
)
<
0
)
{
ndbout
<<
"Cluster nodes not ready in 30 seconds."
<<
endl
;
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
}
Ndb
MyNdb
(
&
con
,
_dbname
);
Ndb
MyNdb
(
&
con
,
_dbname
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
}
// Connect to Ndb and wait for it to become ready
while
(
MyNdb
.
waitUntilReady
()
!=
0
)
ndbout
<<
"Waiting for ndb to become ready..."
<<
endl
;
// Check if table exists in db
// Check if table exists in db
int
res
=
NDBT_OK
;
int
res
=
NDBT_OK
;
for
(
int
i
=
0
;
i
<
argc
;
i
++
){
for
(
int
i
=
0
;
i
<
argc
;
i
++
){
...
@@ -148,11 +150,11 @@ int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism)
...
@@ -148,11 +150,11 @@ int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism)
goto
failed
;
goto
failed
;
}
}
if
(
pOp
->
readTuples
Exclusive
(
par
)
)
{
if
(
pOp
->
readTuples
(
NdbOperation
::
LM_Exclusive
,
par
)
)
{
goto
failed
;
goto
failed
;
}
}
if
(
pTrans
->
execute
(
NoCommit
)
!=
0
){
if
(
pTrans
->
execute
(
N
dbTransaction
::
N
oCommit
)
!=
0
){
err
=
pTrans
->
getNdbError
();
err
=
pTrans
->
getNdbError
();
if
(
err
.
status
==
NdbError
::
TemporaryError
){
if
(
err
.
status
==
NdbError
::
TemporaryError
){
ERR
(
err
);
ERR
(
err
);
...
@@ -172,7 +174,7 @@ int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism)
...
@@ -172,7 +174,7 @@ int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, int parallelism)
}
while
((
check
=
pOp
->
nextResult
(
false
))
==
0
);
}
while
((
check
=
pOp
->
nextResult
(
false
))
==
0
);
if
(
check
!=
-
1
){
if
(
check
!=
-
1
){
check
=
pTrans
->
execute
(
Commit
);
check
=
pTrans
->
execute
(
NdbTransaction
::
Commit
);
pTrans
->
restart
();
pTrans
->
restart
();
}
}
...
...
ndb/tools/desc.cpp
View file @
c39db2fe
...
@@ -80,19 +80,22 @@ int main(int argc, char** argv){
...
@@ -80,19 +80,22 @@ int main(int argc, char** argv){
Ndb_cluster_connection
con
(
opt_connect_str
);
Ndb_cluster_connection
con
(
opt_connect_str
);
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
{
ndbout
<<
"Unable to connect to management server."
<<
endl
;
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
}
if
(
con
.
wait_until_ready
(
30
,
0
)
<
0
)
Ndb
*
pMyNdb
=
new
Ndb
(
&
con
,
_dbname
);
{
pMyNdb
->
init
();
ndbout
<<
"Cluster nodes not ready in 30 seconds."
<<
endl
;
return
NDBT_ProgramExit
(
NDBT_FAILED
);
ndbout
<<
"Waiting..."
;
while
(
pMyNdb
->
waitUntilReady
()
!=
0
)
{
ndbout
<<
"..."
;
}
}
ndbout
<<
endl
;
NdbDictionary
::
Dictionary
*
dict
=
pMyNdb
->
getDictionary
();
Ndb
MyNdb
(
&
con
,
_dbname
);
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
const
NdbDictionary
::
Dictionary
*
dict
=
MyNdb
.
getDictionary
();
for
(
int
i
=
0
;
i
<
argc
;
i
++
)
{
for
(
int
i
=
0
;
i
<
argc
;
i
++
)
{
NDBT_Table
*
pTab
=
(
NDBT_Table
*
)
dict
->
getTable
(
argv
[
i
]);
NDBT_Table
*
pTab
=
(
NDBT_Table
*
)
dict
->
getTable
(
argv
[
i
]);
if
(
pTab
!=
0
){
if
(
pTab
!=
0
){
...
@@ -132,6 +135,5 @@ int main(int argc, char** argv){
...
@@ -132,6 +135,5 @@ int main(int argc, char** argv){
ndbout
<<
argv
[
i
]
<<
": "
<<
dict
->
getNdbError
()
<<
endl
;
ndbout
<<
argv
[
i
]
<<
": "
<<
dict
->
getNdbError
()
<<
endl
;
}
}
delete
pMyNdb
;
return
NDBT_ProgramExit
(
NDBT_OK
);
return
NDBT_ProgramExit
(
NDBT_OK
);
}
}
ndb/tools/drop_index.cpp
View file @
c39db2fe
...
@@ -83,16 +83,18 @@ int main(int argc, char** argv){
...
@@ -83,16 +83,18 @@ int main(int argc, char** argv){
{
{
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
}
Ndb
MyNdb
(
&
con
,
_dbname
);
if
(
con
.
wait_until_ready
(
30
,
0
)
<
0
)
{
ndbout
<<
"Cluster nodes not ready in 30 seconds."
<<
endl
;
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
Ndb
MyNdb
(
&
con
,
_dbname
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
}
while
(
MyNdb
.
waitUntilReady
()
!=
0
)
ndbout
<<
"Waiting for ndb to become ready..."
<<
endl
;
int
res
=
0
;
int
res
=
0
;
for
(
int
i
=
0
;
i
<
argc
;
i
++
){
for
(
int
i
=
0
;
i
<
argc
;
i
++
){
ndbout
<<
"Dropping index "
<<
argv
[
i
]
<<
"..."
;
ndbout
<<
"Dropping index "
<<
argv
[
i
]
<<
"..."
;
...
...
ndb/tools/drop_tab.cpp
View file @
c39db2fe
...
@@ -81,18 +81,21 @@ int main(int argc, char** argv){
...
@@ -81,18 +81,21 @@ int main(int argc, char** argv){
Ndb_cluster_connection
con
(
opt_connect_str
);
Ndb_cluster_connection
con
(
opt_connect_str
);
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
{
ndbout
<<
"Unable to connect to management server."
<<
endl
;
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
if
(
con
.
wait_until_ready
(
30
,
0
)
<
0
)
{
ndbout
<<
"Cluster nodes not ready in 30 seconds."
<<
endl
;
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
}
Ndb
MyNdb
(
&
con
,
_dbname
);
Ndb
MyNdb
(
&
con
,
_dbname
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
}
while
(
MyNdb
.
waitUntilReady
()
!=
0
)
ndbout
<<
"Waiting for ndb to become ready..."
<<
endl
;
int
res
=
0
;
int
res
=
0
;
for
(
int
i
=
0
;
i
<
argc
;
i
++
){
for
(
int
i
=
0
;
i
<
argc
;
i
++
){
ndbout
<<
"Dropping table "
<<
argv
[
i
]
<<
"..."
;
ndbout
<<
"Dropping table "
<<
argv
[
i
]
<<
"..."
;
...
...
ndb/tools/listTables.cpp
View file @
c39db2fe
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
static
Ndb_cluster_connection
*
ndb_cluster_connection
=
0
;
static
Ndb_cluster_connection
*
ndb_cluster_connection
=
0
;
static
Ndb
*
ndb
=
0
;
static
Ndb
*
ndb
=
0
;
static
NdbDictionary
::
Dictionary
*
dic
=
0
;
static
const
NdbDictionary
::
Dictionary
*
dic
=
0
;
static
int
_unqualified
=
0
;
static
int
_unqualified
=
0
;
static
void
static
void
...
@@ -233,16 +233,19 @@ int main(int argc, char** argv){
...
@@ -233,16 +233,19 @@ int main(int argc, char** argv){
ndb_cluster_connection
=
new
Ndb_cluster_connection
(
opt_connect_str
);
ndb_cluster_connection
=
new
Ndb_cluster_connection
(
opt_connect_str
);
if
(
ndb_cluster_connection
->
connect
(
12
,
5
,
1
))
if
(
ndb_cluster_connection
->
connect
(
12
,
5
,
1
))
fatal
(
"unable to connect"
);
fatal
(
"Unable to connect to management server."
);
if
(
ndb_cluster_connection
->
wait_until_ready
(
30
,
0
)
<
0
)
fatal
(
"Cluster nodes not ready in 30 seconds."
);
ndb
=
new
Ndb
(
ndb_cluster_connection
,
_dbname
);
ndb
=
new
Ndb
(
ndb_cluster_connection
,
_dbname
);
if
(
ndb
->
init
()
!=
0
)
if
(
ndb
->
init
()
!=
0
)
fatal
(
"init"
);
fatal
(
"init"
);
if
(
ndb
->
waitUntilReady
(
30
)
<
0
)
fatal
(
"waitUntilReady"
);
dic
=
ndb
->
getDictionary
();
dic
=
ndb
->
getDictionary
();
for
(
int
i
=
0
;
_loops
==
0
||
i
<
_loops
;
i
++
)
{
for
(
int
i
=
0
;
_loops
==
0
||
i
<
_loops
;
i
++
)
{
list
(
_tabname
,
(
NdbDictionary
::
Object
::
Type
)
_type
);
list
(
_tabname
,
(
NdbDictionary
::
Object
::
Type
)
_type
);
}
}
delete
ndb
;
delete
ndb_cluster_connection
;
return
NDBT_ProgramExit
(
NDBT_OK
);
return
NDBT_ProgramExit
(
NDBT_OK
);
}
}
...
...
ndb/tools/restore/consumer_restore.cpp
View file @
c39db2fe
...
@@ -375,7 +375,8 @@ void BackupRestore::tuple_a(restore_callback_t *cb)
...
@@ -375,7 +375,8 @@ void BackupRestore::tuple_a(restore_callback_t *cb)
}
}
// Prepare transaction (the transaction is NOT yet sent to NDB)
// Prepare transaction (the transaction is NOT yet sent to NDB)
cb
->
connection
->
executeAsynchPrepare
(
Commit
,
&
callback
,
cb
);
cb
->
connection
->
executeAsynchPrepare
(
NdbTransaction
::
Commit
,
&
callback
,
cb
);
m_transactions
++
;
m_transactions
++
;
return
;
return
;
}
}
...
@@ -543,7 +544,7 @@ BackupRestore::logEntry(const LogEntry & tup)
...
@@ -543,7 +544,7 @@ BackupRestore::logEntry(const LogEntry & tup)
op
->
setValue
(
attr
->
Desc
->
attrId
,
dataPtr
,
length
);
op
->
setValue
(
attr
->
Desc
->
attrId
,
dataPtr
,
length
);
}
}
const
int
ret
=
trans
->
execute
(
Commit
);
const
int
ret
=
trans
->
execute
(
NdbTransaction
::
Commit
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
{
{
// Both insert update and delete can fail during log running
// Both insert update and delete can fail during log running
...
@@ -654,7 +655,7 @@ BackupRestore::tuple(const TupleS & tup)
...
@@ -654,7 +655,7 @@ BackupRestore::tuple(const TupleS & tup)
else
else
op->setValue(i, dataPtr, length);
op->setValue(i, dataPtr, length);
}
}
int ret = trans->execute(Commit);
int ret = trans->execute(
NdbTransaction::
Commit);
if (ret != 0)
if (ret != 0)
{
{
ndbout << "execute failed: ";
ndbout << "execute failed: ";
...
...
ndb/tools/select_all.cpp
View file @
c39db2fe
...
@@ -24,7 +24,6 @@
...
@@ -24,7 +24,6 @@
#include <NdbMain.h>
#include <NdbMain.h>
#include <NDBT.hpp>
#include <NDBT.hpp>
#include <NdbSleep.h>
#include <NdbSleep.h>
#include <NdbScanFilter.hpp>
int
scanReadRecords
(
Ndb
*
,
int
scanReadRecords
(
Ndb
*
,
const
NdbDictionary
::
Table
*
,
const
NdbDictionary
::
Table
*
,
...
@@ -127,19 +126,21 @@ int main(int argc, char** argv){
...
@@ -127,19 +126,21 @@ int main(int argc, char** argv){
Ndb_cluster_connection
con
(
opt_connect_str
);
Ndb_cluster_connection
con
(
opt_connect_str
);
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
{
ndbout
<<
"Unable to connect to management server."
<<
endl
;
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
if
(
con
.
wait_until_ready
(
30
,
0
)
<
0
)
{
ndbout
<<
"Cluster nodes not ready in 30 seconds."
<<
endl
;
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
}
Ndb
MyNdb
(
&
con
,
_dbname
);
Ndb
MyNdb
(
&
con
,
_dbname
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
}
// Connect to Ndb and wait for it to become ready
while
(
MyNdb
.
waitUntilReady
()
!=
0
)
ndbout
<<
"Waiting for ndb to become ready..."
<<
endl
;
// Check if table exists in db
// Check if table exists in db
const
NdbDictionary
::
Table
*
pTab
=
NDBT_Table
::
discoverTableFromDb
(
&
MyNdb
,
_tabname
);
const
NdbDictionary
::
Table
*
pTab
=
NDBT_Table
::
discoverTableFromDb
(
&
MyNdb
,
_tabname
);
const
NdbDictionary
::
Index
*
pIdx
=
0
;
const
NdbDictionary
::
Index
*
pIdx
=
0
;
...
@@ -320,7 +321,7 @@ int scanReadRecords(Ndb* pNdb,
...
@@ -320,7 +321,7 @@ int scanReadRecords(Ndb* pNdb,
}
}
}
}
check
=
pTrans
->
execute
(
NoCommit
);
check
=
pTrans
->
execute
(
N
dbTransaction
::
N
oCommit
);
if
(
check
==
-
1
)
{
if
(
check
==
-
1
)
{
const
NdbError
err
=
pTrans
->
getNdbError
();
const
NdbError
err
=
pTrans
->
getNdbError
();
...
...
ndb/tools/select_count.cpp
View file @
c39db2fe
...
@@ -100,19 +100,21 @@ int main(int argc, char** argv){
...
@@ -100,19 +100,21 @@ int main(int argc, char** argv){
Ndb_cluster_connection
con
(
opt_connect_str
);
Ndb_cluster_connection
con
(
opt_connect_str
);
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
if
(
con
.
connect
(
12
,
5
,
1
)
!=
0
)
{
{
ndbout
<<
"Unable to connect to management server."
<<
endl
;
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
if
(
con
.
wait_until_ready
(
30
,
0
)
<
0
)
{
ndbout
<<
"Cluster nodes not ready in 30 seconds."
<<
endl
;
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
}
Ndb
MyNdb
(
&
con
,
_dbname
);
Ndb
MyNdb
(
&
con
,
_dbname
);
if
(
MyNdb
.
init
()
!=
0
){
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
ERR
(
MyNdb
.
getNdbError
());
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
}
// Connect to Ndb and wait for it to become ready
while
(
MyNdb
.
waitUntilReady
()
!=
0
)
ndbout
<<
"Waiting for ndb to become ready..."
<<
endl
;
for
(
int
i
=
0
;
i
<
argc
;
i
++
){
for
(
int
i
=
0
;
i
<
argc
;
i
++
){
// Check if table exists in db
// Check if table exists in db
const
NdbDictionary
::
Table
*
pTab
=
NDBT_Table
::
discoverTableFromDb
(
&
MyNdb
,
argv
[
i
]);
const
NdbDictionary
::
Table
*
pTab
=
NDBT_Table
::
discoverTableFromDb
(
&
MyNdb
,
argv
[
i
]);
...
@@ -189,7 +191,7 @@ select_count(Ndb* pNdb, const NdbDictionary::Table* pTab,
...
@@ -189,7 +191,7 @@ select_count(Ndb* pNdb, const NdbDictionary::Table* pTab,
Uint32
row_size
;
Uint32
row_size
;
pOp
->
getValue
(
NdbDictionary
::
Column
::
ROW_COUNT
,
(
char
*
)
&
tmp
);
pOp
->
getValue
(
NdbDictionary
::
Column
::
ROW_COUNT
,
(
char
*
)
&
tmp
);
pOp
->
getValue
(
NdbDictionary
::
Column
::
ROW_SIZE
,
(
char
*
)
&
row_size
);
pOp
->
getValue
(
NdbDictionary
::
Column
::
ROW_SIZE
,
(
char
*
)
&
row_size
);
check
=
pTrans
->
execute
(
NoCommit
);
check
=
pTrans
->
execute
(
N
dbTransaction
::
N
oCommit
);
if
(
check
==
-
1
)
{
if
(
check
==
-
1
)
{
ERR
(
pTrans
->
getNdbError
());
ERR
(
pTrans
->
getNdbError
());
pNdb
->
closeTransaction
(
pTrans
);
pNdb
->
closeTransaction
(
pTrans
);
...
...
sql/ha_ndbcluster.cc
View file @
c39db2fe
...
@@ -161,7 +161,9 @@ int execute_no_commit(ha_ndbcluster *h, NdbTransaction *trans)
...
@@ -161,7 +161,9 @@ int execute_no_commit(ha_ndbcluster *h, NdbTransaction *trans)
if
(
m_batch_execute
)
if
(
m_batch_execute
)
return
0
;
return
0
;
#endif
#endif
return
trans
->
execute
(
NoCommit
,
AbortOnError
,
h
->
m_force_send
);
return
trans
->
execute
(
NdbTransaction
::
NoCommit
,
NdbTransaction
::
AbortOnError
,
h
->
m_force_send
);
}
}
inline
inline
...
@@ -172,7 +174,9 @@ int execute_commit(ha_ndbcluster *h, NdbTransaction *trans)
...
@@ -172,7 +174,9 @@ int execute_commit(ha_ndbcluster *h, NdbTransaction *trans)
if
(
m_batch_execute
)
if
(
m_batch_execute
)
return
0
;
return
0
;
#endif
#endif
return
trans
->
execute
(
Commit
,
AbortOnError
,
h
->
m_force_send
);
return
trans
->
execute
(
NdbTransaction
::
Commit
,
NdbTransaction
::
AbortOnError
,
h
->
m_force_send
);
}
}
inline
inline
...
@@ -183,7 +187,9 @@ int execute_commit(THD *thd, NdbTransaction *trans)
...
@@ -183,7 +187,9 @@ int execute_commit(THD *thd, NdbTransaction *trans)
if
(
m_batch_execute
)
if
(
m_batch_execute
)
return
0
;
return
0
;
#endif
#endif
return
trans
->
execute
(
Commit
,
AbortOnError
,
thd
->
variables
.
ndb_force_send
);
return
trans
->
execute
(
NdbTransaction
::
Commit
,
NdbTransaction
::
AbortOnError
,
thd
->
variables
.
ndb_force_send
);
}
}
inline
inline
...
@@ -194,7 +200,9 @@ int execute_no_commit_ie(ha_ndbcluster *h, NdbTransaction *trans)
...
@@ -194,7 +200,9 @@ int execute_no_commit_ie(ha_ndbcluster *h, NdbTransaction *trans)
if
(
m_batch_execute
)
if
(
m_batch_execute
)
return
0
;
return
0
;
#endif
#endif
return
trans
->
execute
(
NoCommit
,
AO_IgnoreError
,
h
->
m_force_send
);
return
trans
->
execute
(
NdbTransaction
::
NoCommit
,
NdbTransaction
::
AO_IgnoreError
,
h
->
m_force_send
);
}
}
/*
/*
...
@@ -3345,7 +3353,7 @@ int ndbcluster_rollback(THD *thd, void *ndb_transaction)
...
@@ -3345,7 +3353,7 @@ int ndbcluster_rollback(THD *thd, void *ndb_transaction)
"stmt"
:
"all"
));
"stmt"
:
"all"
));
DBUG_ASSERT
(
ndb
&&
trans
);
DBUG_ASSERT
(
ndb
&&
trans
);
if
(
trans
->
execute
(
Rollback
)
!=
0
)
if
(
trans
->
execute
(
NdbTransaction
::
Rollback
)
!=
0
)
{
{
const
NdbError
err
=
trans
->
getNdbError
();
const
NdbError
err
=
trans
->
getNdbError
();
const
NdbOperation
*
error_op
=
trans
->
getNdbErrorOperation
();
const
NdbOperation
*
error_op
=
trans
->
getNdbErrorOperation
();
...
@@ -4863,7 +4871,9 @@ ndb_get_table_statistics(Ndb* ndb, const char * table,
...
@@ -4863,7 +4871,9 @@ ndb_get_table_statistics(Ndb* ndb, const char * table,
pOp
->
getValue
(
NdbDictionary
::
Column
::
ROW_COUNT
,
(
char
*
)
&
rows
);
pOp
->
getValue
(
NdbDictionary
::
Column
::
ROW_COUNT
,
(
char
*
)
&
rows
);
pOp
->
getValue
(
NdbDictionary
::
Column
::
COMMIT_COUNT
,
(
char
*
)
&
commits
);
pOp
->
getValue
(
NdbDictionary
::
Column
::
COMMIT_COUNT
,
(
char
*
)
&
commits
);
check
=
pTrans
->
execute
(
NoCommit
,
AbortOnError
,
TRUE
);
check
=
pTrans
->
execute
(
NdbTransaction
::
NoCommit
,
NdbTransaction
::
AbortOnError
,
TRUE
);
if
(
check
==
-
1
)
if
(
check
==
-
1
)
break
;
break
;
...
...
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