Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
bb1fa5e3
Commit
bb1fa5e3
authored
Apr 25, 2007
by
knielsen@ymer.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal:/home/bk/mysql-5.0-telco-gca
into ymer.(none):/usr/local/mysql/mysql-5.0-telco-gca
parents
0ac443ef
32e7f9e6
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
94 additions
and
3 deletions
+94
-3
ndb/include/ndbapi/NdbTransaction.hpp
ndb/include/ndbapi/NdbTransaction.hpp
+5
-3
ndb/src/ndbapi/NdbTransaction.cpp
ndb/src/ndbapi/NdbTransaction.cpp
+11
-0
ndb/test/ndbapi/testNdbApi.cpp
ndb/test/ndbapi/testNdbApi.cpp
+74
-0
ndb/test/run-test/daily-basic-tests.txt
ndb/test/run-test/daily-basic-tests.txt
+4
-0
No files found.
ndb/include/ndbapi/NdbTransaction.hpp
View file @
bb1fa5e3
...
...
@@ -379,14 +379,16 @@ public:
void
executeAsynch
(
ExecType
aTypeOfExec
,
NdbAsynchCallback
aCallback
,
void
*
anyObject
,
AbortOption
abortOption
=
AbortOnError
);
AbortOption
abortOption
=
AbortOnError
,
int
forceSend
=
0
);
#ifndef DOXYGEN_SHOULD_SKIP_DEPRECATED
void
executeAsynch
(
::
ExecType
aTypeOfExec
,
NdbAsynchCallback
aCallback
,
void
*
anyObject
,
::
AbortOption
abortOption
=
::
AbortOnError
)
::
AbortOption
abortOption
=
::
AbortOnError
,
int
forceSend
=
0
)
{
executeAsynch
((
ExecType
)
aTypeOfExec
,
aCallback
,
anyObject
,
(
AbortOption
)
abortOption
);
}
(
AbortOption
)
abortOption
,
forceSend
);
}
#endif
#endif
/**
...
...
ndb/src/ndbapi/NdbTransaction.cpp
View file @
bb1fa5e3
...
...
@@ -694,6 +694,17 @@ NdbTransaction::executeAsynchPrepare( ExecType aTypeOfExec,
DBUG_VOID_RETURN
;
}
//NdbTransaction::executeAsynchPrepare()
void
NdbTransaction
::
executeAsynch
(
ExecType
aTypeOfExec
,
NdbAsynchCallback
aCallback
,
void
*
anyObject
,
AbortOption
abortOption
,
int
forceSend
)
{
executeAsynchPrepare
(
aTypeOfExec
,
aCallback
,
anyObject
,
abortOption
);
theNdb
->
sendPreparedTransactions
(
forceSend
);
}
void
NdbTransaction
::
close
()
{
theNdb
->
closeTransaction
(
this
);
...
...
ndb/test/ndbapi/testNdbApi.cpp
View file @
bb1fa5e3
...
...
@@ -1234,6 +1234,76 @@ int runScan_4006(NDBT_Context* ctx, NDBT_Step* step){
return
result
;
}
static
void
testExecuteAsynchCallback
(
int
res
,
NdbTransaction
*
con
,
void
*
data_ptr
)
{
int
*
res_ptr
=
(
int
*
)
data_ptr
;
*
res_ptr
=
res
;
}
int
runTestExecuteAsynch
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
/* Test that NdbTransaction::executeAsynch() works (BUG#27495). */
int
result
=
NDBT_OK
;
const
NdbDictionary
::
Table
*
pTab
=
ctx
->
getTab
();
Ndb
*
pNdb
=
new
Ndb
(
&
ctx
->
m_cluster_connection
,
"TEST_DB"
);
if
(
pNdb
==
NULL
){
ndbout
<<
"pNdb == NULL"
<<
endl
;
return
NDBT_FAILED
;
}
if
(
pNdb
->
init
(
2048
)){
ERR
(
pNdb
->
getNdbError
());
delete
pNdb
;
return
NDBT_FAILED
;
}
NdbConnection
*
pCon
=
pNdb
->
startTransaction
();
if
(
pCon
==
NULL
){
ERR
(
pNdb
->
getNdbError
());
delete
pNdb
;
return
NDBT_FAILED
;
}
NdbScanOperation
*
pOp
=
pCon
->
getNdbScanOperation
(
pTab
->
getName
());
if
(
pOp
==
NULL
){
ERR
(
pOp
->
getNdbError
());
pNdb
->
closeTransaction
(
pCon
);
delete
pNdb
;
return
NDBT_FAILED
;
}
if
(
pOp
->
readTuples
()
!=
0
){
ERR
(
pOp
->
getNdbError
());
pNdb
->
closeTransaction
(
pCon
);
delete
pNdb
;
return
NDBT_FAILED
;
}
if
(
pOp
->
getValue
(
NdbDictionary
::
Column
::
FRAGMENT
)
==
0
){
ERR
(
pOp
->
getNdbError
());
pNdb
->
closeTransaction
(
pCon
);
delete
pNdb
;
return
NDBT_FAILED
;
}
int
res
=
42
;
pCon
->
executeAsynch
(
NoCommit
,
testExecuteAsynchCallback
,
&
res
);
while
(
pNdb
->
pollNdb
(
100000
)
==
0
)
;
if
(
res
!=
0
){
ERR
(
pCon
->
getNdbError
());
ndbout
<<
"Error returned from execute: "
<<
res
<<
endl
;
result
=
NDBT_FAILED
;
}
pNdb
->
closeTransaction
(
pCon
);
delete
pNdb
;
return
result
;
}
template
class
Vector
<
NdbScanOperation
*
>;
...
...
@@ -1322,6 +1392,10 @@ TESTCASE("Scan_4006",
INITIALIZER
(
runScan_4006
);
FINALIZER
(
runClearTable
);
}
TESTCASE
(
"ExecuteAsynch"
,
"Check that executeAsync() works (BUG#27495)
\n
"
){
INITIALIZER
(
runTestExecuteAsynch
);
}
NDBT_TESTSUITE_END
(
testNdbApi
);
int
main
(
int
argc
,
const
char
**
argv
){
...
...
ndb/test/run-test/daily-basic-tests.txt
View file @
bb1fa5e3
...
...
@@ -609,6 +609,10 @@ max-time: 500
cmd: testNdbApi
args: -n Scan_4006 T1
max-time: 500
cmd: testNdbApi
args: -n ExecuteAsynch T1
#max-time: 500
#cmd: testInterpreter
#args: T1
...
...
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