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
4ff14f6c
Commit
4ff14f6c
authored
Nov 07, 2004
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wl2240 - ndb partitioning
Added create table hook for NDB API test framework
parent
b593c0cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
6 deletions
+17
-6
ndb/test/include/NDBT_Tables.hpp
ndb/test/include/NDBT_Tables.hpp
+4
-2
ndb/test/src/NDBT_Tables.cpp
ndb/test/src/NDBT_Tables.cpp
+13
-4
No files found.
ndb/test/include/NDBT_Tables.hpp
View file @
4ff14f6c
...
...
@@ -23,11 +23,13 @@
#include <NdbDictionary.hpp>
#include <NDBT_Table.hpp>
typedef
int
(
*
NDBT_CreateTableHook
)(
Ndb
*
,
NdbDictionary
::
Table
&
,
int
when
);
class
NDBT_Tables
{
public:
static
int
createTable
(
Ndb
*
pNdb
,
const
char
*
_name
,
bool
_temp
=
false
,
bool
existsOK
=
false
);
bool
existsOK
=
false
,
NDBT_CreateTableHook
=
0
);
static
int
createAllTables
(
Ndb
*
pNdb
,
bool
_temp
,
bool
existsOK
=
false
);
static
int
createAllTables
(
Ndb
*
pNdb
);
...
...
ndb/test/src/NDBT_Tables.cpp
View file @
4ff14f6c
...
...
@@ -820,21 +820,25 @@ NDBT_Tables::createAllTables(Ndb* pNdb){
int
NDBT_Tables
::
createTable
(
Ndb
*
pNdb
,
const
char
*
_name
,
bool
_temp
,
bool
existsOk
){
bool
existsOk
,
NDBT_CreateTableHook
f
){
const
NdbDictionary
::
Table
*
tab
=
NDBT_Tables
::
getTable
(
_name
);
if
(
tab
==
NULL
){
ndbout
<<
"Could not create table "
<<
_name
<<
", it doesn't exist in list of tables "
\
"that NDBT_Tables can create!"
<<
endl
;
"that NDBT_Tables can create!"
<<
endl
;
return
NDBT_WRONGARGS
;
}
int
r
=
0
;
do
{
NdbDictionary
::
Table
tmpTab
(
*
tab
);
tmpTab
.
setStoredTable
(
_temp
?
0
:
1
);
if
(
f
!=
0
&&
f
(
pNdb
,
tmpTab
,
0
))
{
ndbout
<<
"Failed to create table"
<<
endl
;
return
NDBT_FAILED
;
}
r
=
pNdb
->
getDictionary
()
->
createTable
(
tmpTab
);
if
(
r
==
-
1
){
if
(
!
existsOk
){
...
...
@@ -883,6 +887,11 @@ NDBT_Tables::createTable(Ndb* pNdb, const char* _name, bool _temp,
}
}
}
if
(
f
!=
0
&&
f
(
pNdb
,
tmpTab
,
1
))
{
ndbout
<<
"Failed to create table"
<<
endl
;
return
NDBT_FAILED
;
}
}
while
(
false
);
return
r
;
...
...
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