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
a1e5f5b0
Commit
a1e5f5b0
authored
Aug 01, 2006
by
jonas@perch.ndb.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge perch.ndb.mysql.com:/home/jonas/src/51-work
into perch.ndb.mysql.com:/home/jonas/src/mysql-5.1-new
parents
53a1ff95
31e4b8db
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
8 deletions
+29
-8
storage/ndb/test/include/HugoTransactions.hpp
storage/ndb/test/include/HugoTransactions.hpp
+2
-1
storage/ndb/test/src/HugoTransactions.cpp
storage/ndb/test/src/HugoTransactions.cpp
+18
-5
storage/ndb/test/tools/hugoLoad.cpp
storage/ndb/test/tools/hugoLoad.cpp
+9
-2
No files found.
storage/ndb/test/include/HugoTransactions.hpp
View file @
a1e5f5b0
...
@@ -34,7 +34,8 @@ public:
...
@@ -34,7 +34,8 @@ public:
bool
allowConstraintViolation
=
true
,
bool
allowConstraintViolation
=
true
,
int
doSleep
=
0
,
int
doSleep
=
0
,
bool
oneTrans
=
false
,
bool
oneTrans
=
false
,
int
updateValue
=
0
);
int
updateValue
=
0
,
bool
abort
=
false
);
int
scanReadRecords
(
Ndb
*
,
int
scanReadRecords
(
Ndb
*
,
int
records
,
int
records
,
...
...
storage/ndb/test/src/HugoTransactions.cpp
View file @
a1e5f5b0
...
@@ -519,7 +519,8 @@ HugoTransactions::loadTable(Ndb* pNdb,
...
@@ -519,7 +519,8 @@ HugoTransactions::loadTable(Ndb* pNdb,
bool
allowConstraintViolation
,
bool
allowConstraintViolation
,
int
doSleep
,
int
doSleep
,
bool
oneTrans
,
bool
oneTrans
,
int
value
){
int
value
,
bool
abort
){
int
check
,
a
;
int
check
,
a
;
int
retryAttempt
=
0
;
int
retryAttempt
=
0
;
int
retryMax
=
5
;
int
retryMax
=
5
;
...
@@ -585,10 +586,22 @@ HugoTransactions::loadTable(Ndb* pNdb,
...
@@ -585,10 +586,22 @@ HugoTransactions::loadTable(Ndb* pNdb,
if
(
!
oneTrans
||
(
c
+
batch
)
>=
records
)
{
if
(
!
oneTrans
||
(
c
+
batch
)
>=
records
)
{
// closeTrans = true;
// closeTrans = true;
closeTrans
=
false
;
closeTrans
=
false
;
check
=
pTrans
->
execute
(
Commit
);
if
(
!
abort
)
if
(
check
!=
-
1
)
{
m_latest_gci
=
pTrans
->
getGCI
();
check
=
pTrans
->
execute
(
Commit
);
pTrans
->
restart
();
if
(
check
!=
-
1
)
m_latest_gci
=
pTrans
->
getGCI
();
pTrans
->
restart
();
}
else
{
check
=
pTrans
->
execute
(
NoCommit
);
if
(
check
!=
-
1
)
{
check
=
pTrans
->
execute
(
Rollback
);
closeTransaction
(
pNdb
);
}
}
}
else
{
}
else
{
closeTrans
=
false
;
closeTrans
=
false
;
check
=
pTrans
->
execute
(
NoCommit
);
check
=
pTrans
->
execute
(
NoCommit
);
...
...
storage/ndb/test/tools/hugoLoad.cpp
View file @
a1e5f5b0
...
@@ -31,6 +31,8 @@ int main(int argc, const char** argv){
...
@@ -31,6 +31,8 @@ int main(int argc, const char** argv){
int
_batch
=
512
;
int
_batch
=
512
;
int
_loops
=
-
1
;
int
_loops
=
-
1
;
int
_rand
=
0
;
int
_rand
=
0
;
int
_onetrans
=
0
;
int
_abort
=
0
;
const
char
*
db
=
0
;
const
char
*
db
=
0
;
struct
getargs
args
[]
=
{
struct
getargs
args
[]
=
{
...
@@ -39,7 +41,9 @@ int main(int argc, const char** argv){
...
@@ -39,7 +41,9 @@ int main(int argc, const char** argv){
{
"loops"
,
'l'
,
arg_integer
,
&
_loops
,
"Number of loops"
,
""
},
{
"loops"
,
'l'
,
arg_integer
,
&
_loops
,
"Number of loops"
,
""
},
{
"database"
,
'd'
,
arg_string
,
&
db
,
"Database"
,
""
},
{
"database"
,
'd'
,
arg_string
,
&
db
,
"Database"
,
""
},
{
"usage"
,
'?'
,
arg_flag
,
&
_help
,
"Print help"
,
""
},
{
"usage"
,
'?'
,
arg_flag
,
&
_help
,
"Print help"
,
""
},
{
"rnd-rows"
,
0
,
arg_flag
,
&
_rand
,
"Rand number of records"
,
"recs"
}
{
"rnd-rows"
,
0
,
arg_flag
,
&
_rand
,
"Rand number of records"
,
"recs"
},
{
"one-trans"
,
0
,
arg_flag
,
&
_onetrans
,
"Insert as 1 trans"
,
""
},
{
"abort"
,
0
,
arg_integer
,
&
_abort
,
"Abort probability"
,
""
}
};
};
int
num_args
=
sizeof
(
args
)
/
sizeof
(
args
[
0
]);
int
num_args
=
sizeof
(
args
)
/
sizeof
(
args
[
0
]);
int
optind
=
0
;
int
optind
=
0
;
...
@@ -92,10 +96,13 @@ int main(int argc, const char** argv){
...
@@ -92,10 +96,13 @@ int main(int argc, const char** argv){
HugoTransactions
hugoTrans
(
*
pTab
);
HugoTransactions
hugoTrans
(
*
pTab
);
loop:
loop:
int
rows
=
(
_rand
?
rand
()
%
_records
:
_records
);
int
rows
=
(
_rand
?
rand
()
%
_records
:
_records
);
int
abort
=
(
rand
()
%
100
)
<
_abort
?
1
:
0
;
if
(
abort
)
ndbout
<<
"load+abort"
<<
endl
;
if
(
hugoTrans
.
loadTable
(
&
MyNdb
,
if
(
hugoTrans
.
loadTable
(
&
MyNdb
,
rows
,
rows
,
_batch
,
_batch
,
true
,
0
,
false
,
_loops
)
!=
0
){
true
,
0
,
_onetrans
,
_loops
,
abort
)
!=
0
){
return
NDBT_ProgramExit
(
NDBT_FAILED
);
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
}
...
...
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