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
3f08e0bd
Commit
3f08e0bd
authored
Dec 06, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skeleton for ndb bitfields testing
parent
255cf71a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
170 additions
and
1 deletion
+170
-1
ndb/test/ndbapi/Makefile.am
ndb/test/ndbapi/Makefile.am
+3
-1
ndb/test/ndbapi/testBitfield.cpp
ndb/test/ndbapi/testBitfield.cpp
+167
-0
No files found.
ndb/test/ndbapi/Makefile.am
View file @
3f08e0bd
...
...
@@ -31,7 +31,8 @@ testTimeout \
testTransactions
\
testDeadlock
\
test_event ndbapi_slow_select testReadPerf testLcp
\
testPartitioning
testPartitioning
\
testBitfield
#flexTimedAsynch
#testBlobs
...
...
@@ -71,6 +72,7 @@ ndbapi_slow_select_SOURCES = slow_select.cpp
testReadPerf_SOURCES
=
testReadPerf.cpp
testLcp_SOURCES
=
testLcp.cpp
testPartitioning_SOURCES
=
testPartitioning.cpp
testBitfield_SOURCES
=
testBitfield.cpp
INCLUDES_LOC
=
-I
$(top_srcdir)
/ndb/include/kernel
...
...
ndb/test/ndbapi/testBitfield.cpp
0 → 100644
View file @
3f08e0bd
#include <ndb_global.h>
#include <ndb_opts.h>
#include <NDBT.hpp>
#include <NdbApi.hpp>
static
const
char
*
opt_connect_str
=
0
;
static
const
char
*
_dbname
=
"TEST_DB"
;
static
int
g_loops
=
5
;
static
struct
my_option
my_long_options
[]
=
{
NDB_STD_OPTS
(
"ndb_desc"
),
{
"database"
,
'd'
,
"Name of database table is in"
,
(
gptr
*
)
&
_dbname
,
(
gptr
*
)
&
_dbname
,
0
,
GET_STR
,
REQUIRED_ARG
,
0
,
0
,
0
,
0
,
0
,
0
},
{
0
,
0
,
0
,
0
,
0
,
0
,
GET_NO_ARG
,
NO_ARG
,
0
,
0
,
0
,
0
,
0
,
0
}
};
static
void
print_version
()
{
printf
(
"MySQL distrib %s, for %s (%s)
\n
"
,
MYSQL_SERVER_VERSION
,
SYSTEM_TYPE
,
MACHINE_TYPE
);
}
static
void
usage
()
{
char
desc
[]
=
"tabname
\n
"
\
"This program list all properties of table(s) in NDB Cluster.
\n
"
\
" ex: desc T1 T2 T4
\n
"
;
print_version
();
my_print_help
(
my_long_options
);
my_print_variables
(
my_long_options
);
}
static
my_bool
get_one_option
(
int
optid
,
const
struct
my_option
*
opt
__attribute__
((
unused
)),
char
*
argument
)
{
switch
(
optid
)
{
case
'#'
:
DBUG_PUSH
(
argument
?
argument
:
"d:t:O,/tmp/ndb_desc.trace"
);
break
;
case
'V'
:
print_version
();
exit
(
0
);
case
'?'
:
usage
();
exit
(
0
);
}
return
0
;
}
static
const
NdbDictionary
::
Table
*
create_random_table
(
Ndb
*
);
static
int
transactions
(
Ndb
*
,
const
NdbDictionary
::
Table
*
tab
);
static
int
unique_indexes
(
Ndb
*
,
const
NdbDictionary
::
Table
*
tab
);
static
int
ordered_indexes
(
Ndb
*
,
const
NdbDictionary
::
Table
*
tab
);
static
int
node_restart
(
Ndb
*
,
const
NdbDictionary
::
Table
*
tab
);
static
int
system_restart
(
Ndb
*
,
const
NdbDictionary
::
Table
*
tab
);
int
main
(
int
argc
,
char
**
argv
){
NDB_INIT
(
argv
[
0
]);
const
char
*
load_default_groups
[]
=
{
"mysql_cluster"
,
0
};
load_defaults
(
"my"
,
load_default_groups
,
&
argc
,
&
argv
);
int
ho_error
;
if
((
ho_error
=
handle_options
(
&
argc
,
&
argv
,
my_long_options
,
get_one_option
)))
return
NDBT_ProgramExit
(
NDBT_WRONGARGS
);
Ndb
::
setConnectString
(
opt_connect_str
);
Ndb
*
pNdb
;
pNdb
=
new
Ndb
(
_dbname
);
pNdb
->
init
();
while
(
pNdb
->
waitUntilReady
()
!=
0
);
int
res
=
NDBT_FAILED
;
NdbDictionary
::
Dictionary
*
dict
=
pNdb
->
getDictionary
();
const
NdbDictionary
::
Table
*
pTab
=
0
;
for
(
int
i
=
0
;
i
<
(
argc
?
argc
:
g_loops
)
;
i
++
)
{
res
=
NDBT_FAILED
;
if
(
argc
==
0
)
{
pTab
=
create_random_table
(
pNdb
);
}
else
{
dict
->
dropTable
(
argv
[
i
]);
NDBT_Tables
::
createTable
(
pNdb
,
argv
[
i
]);
pTab
=
dict
->
getTable
(
argv
[
i
]);
}
if
(
pTab
==
0
)
{
ndbout
<<
"Failed to create table"
<<
endl
;
ndbout
<<
dict
->
getNdbError
()
<<
endl
;
break
;
}
if
(
transactions
(
pNdb
,
pTab
))
break
;
if
(
unique_indexes
(
pNdb
,
pTab
))
break
;
if
(
ordered_indexes
(
pNdb
,
pTab
))
break
;
if
(
node_restart
(
pNdb
,
pTab
))
break
;
if
(
system_restart
(
pNdb
,
pTab
))
break
;
dict
->
dropTable
(
pTab
->
getName
());
res
=
NDBT_OK
;
}
if
(
res
!=
NDBT_OK
&&
pTab
)
{
dict
->
dropTable
(
pTab
->
getName
());
}
delete
pNdb
;
return
NDBT_ProgramExit
(
res
);
}
static
const
NdbDictionary
::
Table
*
create_random_table
(
Ndb
*
pNdb
)
{
return
0
;
}
static
int
transactions
(
Ndb
*
pNdb
,
const
NdbDictionary
::
Table
*
tab
)
{
return
0
;
}
static
int
unique_indexes
(
Ndb
*
pNdb
,
const
NdbDictionary
::
Table
*
tab
)
{
return
0
;
}
static
int
ordered_indexes
(
Ndb
*
pNdb
,
const
NdbDictionary
::
Table
*
tab
)
{
return
0
;
}
static
int
node_restart
(
Ndb
*
pNdb
,
const
NdbDictionary
::
Table
*
tab
)
{
return
0
;
}
static
int
system_restart
(
Ndb
*
pNdb
,
const
NdbDictionary
::
Table
*
tab
)
{
return
0
;
}
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