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
9e188eae
Commit
9e188eae
authored
May 26, 2005
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - Testcase for bug#10669
--database option to hugo tools
parent
60d3e60e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
11 deletions
+98
-11
ndb/test/ndbapi/testNdbApi.cpp
ndb/test/ndbapi/testNdbApi.cpp
+81
-0
ndb/test/tools/hugoLoad.cpp
ndb/test/tools/hugoLoad.cpp
+4
-2
ndb/test/tools/hugoPkUpdate.cpp
ndb/test/tools/hugoPkUpdate.cpp
+4
-3
ndb/test/tools/hugoScanRead.cpp
ndb/test/tools/hugoScanRead.cpp
+4
-3
ndb/test/tools/hugoScanUpdate.cpp
ndb/test/tools/hugoScanUpdate.cpp
+5
-3
No files found.
ndb/test/ndbapi/testNdbApi.cpp
View file @
9e188eae
...
...
@@ -877,6 +877,81 @@ int runUpdateWithoutKeys(NDBT_Context* ctx, NDBT_Step* step){
return
result
;
}
int
runReadWithoutGetValue
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
result
=
NDBT_OK
;
const
NdbDictionary
::
Table
*
pTab
=
ctx
->
getTab
();
HugoOperations
hugoOps
(
*
pTab
);
Ndb
*
pNdb
=
new
Ndb
(
&
ctx
->
m_cluster_connection
,
"TEST_DB"
);
if
(
pNdb
==
NULL
){
ndbout
<<
"pNdb == NULL"
<<
endl
;
return
NDBT_FAILED
;
}
if
(
pNdb
->
init
()){
ERR
(
pNdb
->
getNdbError
());
delete
pNdb
;
return
NDBT_FAILED
;
}
for
(
Uint32
cm
=
0
;
cm
<
2
;
cm
++
)
{
for
(
Uint32
lm
=
0
;
lm
<=
NdbOperation
::
LM_CommittedRead
;
lm
++
)
{
NdbConnection
*
pCon
=
pNdb
->
startTransaction
();
if
(
pCon
==
NULL
){
pNdb
->
closeTransaction
(
pCon
);
delete
pNdb
;
return
NDBT_FAILED
;
}
NdbOperation
*
pOp
=
pCon
->
getNdbOperation
(
pTab
->
getName
());
if
(
pOp
==
NULL
){
ERR
(
pCon
->
getNdbError
());
pNdb
->
closeTransaction
(
pCon
);
delete
pNdb
;
return
NDBT_FAILED
;
}
if
(
pOp
->
readTuple
((
NdbOperation
::
LockMode
)
lm
)
!=
0
){
pNdb
->
closeTransaction
(
pCon
);
ERR
(
pOp
->
getNdbError
());
delete
pNdb
;
return
NDBT_FAILED
;
}
for
(
int
a
=
0
;
a
<
pTab
->
getNoOfColumns
();
a
++
){
if
(
pTab
->
getColumn
(
a
)
->
getPrimaryKey
()
==
true
){
if
(
hugoOps
.
equalForAttr
(
pOp
,
a
,
1
)
!=
0
){
ERR
(
pCon
->
getNdbError
());
pNdb
->
closeTransaction
(
pCon
);
delete
pNdb
;
return
NDBT_FAILED
;
}
}
}
// Dont' call any getValues
// Execute should work
int
check
=
pCon
->
execute
(
cm
==
0
?
NoCommit
:
Commit
);
if
(
check
==
0
){
ndbout
<<
"execute worked"
<<
endl
;
}
else
{
ERR
(
pCon
->
getNdbError
());
result
=
NDBT_FAILED
;
}
pNdb
->
closeTransaction
(
pCon
);
}
}
delete
pNdb
;
return
result
;
}
int
runCheckGetNdbErrorOperation
(
NDBT_Context
*
ctx
,
NDBT_Step
*
step
){
int
result
=
NDBT_OK
;
const
NdbDictionary
::
Table
*
pTab
=
ctx
->
getTab
();
...
...
@@ -1011,6 +1086,12 @@ TESTCASE("NdbErrorOperation",
"Test that NdbErrorOperation is properly set"
){
INITIALIZER
(
runCheckGetNdbErrorOperation
);
}
TESTCASE
(
"ReadWithoutGetValue"
,
"Test that it's possible to perform read wo/ getvalue's
\n
"
){
INITIALIZER
(
runLoadTable
);
INITIALIZER
(
runReadWithoutGetValue
);
FINALIZER
(
runClearTable
);
}
NDBT_TESTSUITE_END
(
testNdbApi
);
int
main
(
int
argc
,
const
char
**
argv
){
...
...
ndb/test/tools/hugoLoad.cpp
View file @
9e188eae
...
...
@@ -30,10 +30,12 @@ int main(int argc, const char** argv){
const
char
*
_tabname
=
NULL
;
int
_help
=
0
;
int
_batch
=
512
;
const
char
*
db
=
0
;
struct
getargs
args
[]
=
{
{
"records"
,
'r'
,
arg_integer
,
&
_records
,
"Number of records"
,
"recs"
},
{
"batch"
,
'b'
,
arg_integer
,
&
_batch
,
"Number of operations in each transaction"
,
"batch"
},
{
"database"
,
'd'
,
arg_string
,
&
db
,
"Database"
,
""
},
{
"usage"
,
'?'
,
arg_flag
,
&
_help
,
"Print help"
,
""
}
};
int
num_args
=
sizeof
(
args
)
/
sizeof
(
args
[
0
]);
...
...
@@ -54,7 +56,7 @@ int main(int argc, const char** argv){
_tabname
=
argv
[
optind
];
// Connect to Ndb
Ndb
MyNdb
(
"TEST_DB"
);
Ndb
MyNdb
(
db
?
db
:
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/tools/hugoPkUpdate.cpp
View file @
9e188eae
...
...
@@ -33,7 +33,7 @@ int main(int argc, const char** argv){
int
_loops
=
1
;
int
_abort
=
0
;
int
_batch
=
0
;
const
char
*
_tabname
=
NULL
;
const
char
*
_tabname
=
NULL
,
*
db
=
0
;
int
_help
=
0
;
struct
getargs
args
[]
=
{
...
...
@@ -41,7 +41,8 @@ int main(int argc, const char** argv){
{
"loops"
,
'l'
,
arg_integer
,
&
_loops
,
"number of times to run this program(0=infinite loop)"
,
"loops"
},
// { "batch", 'b', arg_integer, &_batch, "batch value", "batch" },
{
"records"
,
'r'
,
arg_integer
,
&
_records
,
"Number of records"
,
"records"
},
{
"usage"
,
'?'
,
arg_flag
,
&
_help
,
"Print help"
,
""
}
{
"usage"
,
'?'
,
arg_flag
,
&
_help
,
"Print help"
,
""
},
{
"database"
,
'd'
,
arg_string
,
&
db
,
"Database"
,
""
}
};
int
num_args
=
sizeof
(
args
)
/
sizeof
(
args
[
0
]);
int
optind
=
0
;
...
...
@@ -57,7 +58,7 @@ int main(int argc, const char** argv){
_tabname
=
argv
[
optind
];
// Connect to Ndb
Ndb
MyNdb
(
"TEST_DB"
);
Ndb
MyNdb
(
db
?
db
:
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/tools/hugoScanRead.cpp
View file @
9e188eae
...
...
@@ -33,7 +33,7 @@ int main(int argc, const char** argv){
int
_loops
=
1
;
int
_abort
=
0
;
int
_parallelism
=
1
;
const
char
*
_tabname
=
NULL
;
const
char
*
_tabname
=
NULL
,
*
db
=
0
;
int
_help
=
0
;
int
lock
=
NdbOperation
::
LM_Read
;
int
sorted
=
0
;
...
...
@@ -45,7 +45,8 @@ int main(int argc, const char** argv){
{
"records"
,
'r'
,
arg_integer
,
&
_records
,
"Number of records"
,
"recs"
},
{
"usage"
,
'?'
,
arg_flag
,
&
_help
,
"Print help"
,
""
},
{
"lock"
,
'm'
,
arg_integer
,
&
lock
,
"lock mode"
,
""
},
{
"sorted"
,
's'
,
arg_flag
,
&
sorted
,
"sorted"
,
""
}
{
"sorted"
,
's'
,
arg_flag
,
&
sorted
,
"sorted"
,
""
},
{
"database"
,
'd'
,
arg_string
,
&
db
,
"Database"
,
""
}
};
int
num_args
=
sizeof
(
args
)
/
sizeof
(
args
[
0
]);
int
optind
=
0
;
...
...
@@ -61,7 +62,7 @@ int main(int argc, const char** argv){
_tabname
=
argv
[
optind
];
// Connect to Ndb
Ndb
MyNdb
(
"TEST_DB"
);
Ndb
MyNdb
(
db
?
db
:
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
...
...
ndb/test/tools/hugoScanUpdate.cpp
View file @
9e188eae
...
...
@@ -33,7 +33,7 @@ int main(int argc, const char** argv){
int
_loops
=
1
;
int
_parallelism
=
1
;
int
_ver2
=
0
;
const
char
*
_tabname
=
NULL
;
const
char
*
_tabname
=
NULL
,
*
db
=
0
;
int
_help
=
0
;
struct
getargs
args
[]
=
{
...
...
@@ -42,7 +42,8 @@ int main(int argc, const char** argv){
{
"records"
,
'r'
,
arg_integer
,
&
_records
,
"Number of records"
,
"recs"
},
{
"ver2"
,
'2'
,
arg_flag
,
&
_ver2
,
"Use version 2 of scanUpdateRecords"
,
""
},
{
"ver2"
,
'1'
,
arg_negative_flag
,
&
_ver2
,
"Use version 1 of scanUpdateRecords (default)"
,
""
},
{
"usage"
,
'?'
,
arg_flag
,
&
_help
,
"Print help"
,
""
}
{
"usage"
,
'?'
,
arg_flag
,
&
_help
,
"Print help"
,
""
},
{
"database"
,
'd'
,
arg_string
,
&
db
,
"Database"
,
""
}
};
int
num_args
=
sizeof
(
args
)
/
sizeof
(
args
[
0
]);
int
optind
=
0
;
...
...
@@ -58,7 +59,7 @@ int main(int argc, const char** argv){
_tabname
=
argv
[
optind
];
// Connect to Ndb
Ndb
MyNdb
(
"TEST_DB"
);
Ndb
MyNdb
(
db
?
db
:
"TEST_DB"
);
if
(
MyNdb
.
init
()
!=
0
){
ERR
(
MyNdb
.
getNdbError
());
...
...
@@ -95,6 +96,7 @@ int main(int argc, const char** argv){
return
NDBT_ProgramExit
(
NDBT_FAILED
);
}
i
++
;
//NdbSleep_MilliSleep(300);
}
return
NDBT_ProgramExit
(
NDBT_OK
);
...
...
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