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
6db8fef5
Commit
6db8fef5
authored
Feb 20, 2007
by
knielsen@ymer.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A few minor cleanups for recent AbortOption behaviour change.
parent
5d37bbee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
9 deletions
+49
-9
storage/ndb/include/ndbapi/NdbOperation.hpp
storage/ndb/include/ndbapi/NdbOperation.hpp
+16
-5
storage/ndb/ndbapi-examples/ndbapi_simple_index/ndbapi_simple_index.cpp
...bapi-examples/ndbapi_simple_index/ndbapi_simple_index.cpp
+15
-2
storage/ndb/src/ndbapi/NdbOperationDefine.cpp
storage/ndb/src/ndbapi/NdbOperationDefine.cpp
+18
-2
No files found.
storage/ndb/include/ndbapi/NdbOperation.hpp
View file @
6db8fef5
...
...
@@ -98,7 +98,20 @@ public:
};
/**
* How should transaction be handled if operation fails
* How should transaction be handled if operation fails.
*
* If AO_IgnoreError, a failure in one operation will not abort the
* transaction, and NdbTransaction::execute() will return 0 (success). Use
* NdbOperation::getNdbError() to check for errors from individual
* operations.
*
* If AbortOnError, a failure in one operation will abort the transaction
* and cause NdbTransaction::execute() to return -1.
*
* Abort option can be set on execute(), or in the individual operation.
* Setting AO_IgnoreError or AbortOnError in execute() overrides the settings
* on individual operations. Setting DefaultAbortOption in execute() (the
* default) causes individual operation settings to be used.
*
* For READ, default is AO_IgnoreError
* DML, default is AbortOnError
...
...
@@ -1019,10 +1032,8 @@ protected:
NdbBlob
*
theBlobList
;
/*
* Abort option per operation, used by blobs. Default -1. If set,
* overrides abort option on connection level. If set to IgnoreError,
* does not cause execute() to return failure. This is different from
* IgnoreError on connection level.
* Abort option per operation, used by blobs.
* See also comments on enum AbortOption.
*/
Int8
m_abortOption
;
...
...
storage/ndb/ndbapi-examples/ndbapi_simple_index/ndbapi_simple_index.cpp
View file @
6db8fef5
...
...
@@ -19,6 +19,17 @@
// Correct output from this program is:
//
// ATTR1 ATTR2
// 0 0
// 1 1
// 2 2
// 3 3
// 4 4
// 5 5
// 6 6
// 7 7
// 8 8
// 9 9
// ATTR1 ATTR2
// 0 10
// 1 1
// 2 12
...
...
@@ -166,7 +177,8 @@ int main(int argc, char** argv)
NdbRecAttr
*
myRecAttr
=
myIndexOperation
->
getValue
(
"ATTR1"
,
NULL
);
if
(
myRecAttr
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
if
(
myTransaction
->
execute
(
NdbTransaction
::
Commit
)
!=
-
1
)
if
(
myTransaction
->
execute
(
NdbTransaction
::
Commit
,
NdbOperation
::
AbortOnError
)
!=
-
1
)
printf
(
" %2d %2d
\n
"
,
myRecAttr
->
u_32_value
(),
i
);
myNdb
->
closeTransaction
(
myTransaction
);
...
...
@@ -232,7 +244,8 @@ int main(int argc, char** argv)
NdbRecAttr
*
myRecAttr
=
myOperation
->
getValue
(
"ATTR2"
,
NULL
);
if
(
myRecAttr
==
NULL
)
APIERROR
(
myTransaction
->
getNdbError
());
if
(
myTransaction
->
execute
(
NdbTransaction
::
Commit
)
==
-
1
)
if
(
myTransaction
->
execute
(
NdbTransaction
::
Commit
,
NdbOperation
::
AbortOnError
)
==
-
1
)
if
(
i
==
3
)
{
std
::
cout
<<
"Detected that deleted tuple doesn't exist!
\n
"
;
}
else
{
...
...
storage/ndb/src/ndbapi/NdbOperationDefine.cpp
View file @
6db8fef5
...
...
@@ -715,6 +715,22 @@ insertATTRINFO_error1:
}
//NdbOperation::insertATTRINFOloop()
NdbOperation
::
AbortOption
NdbOperation
::
getAbortOption
()
const
{
return
(
AbortOption
)
m_abortOption
;
}
int
NdbOperation
::
setAbortOption
(
AbortOption
ao
)
{
switch
(
ao
)
{
case
AO_IgnoreError
:
case
AbortOnError
:
m_abortOption
=
ao
;
return
0
;
default:
return
-
1
;
}
}
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