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
8b4a1916
Commit
8b4a1916
authored
Jan 09, 2008
by
jmiller/ndbdev@mysql.com/ndb15.mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DbUtil.hpp, DbUtil.cpp, NdbRepStress.cpp:
More code improvments
parent
4c8a2468
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
177 additions
and
165 deletions
+177
-165
storage/ndb/test/include/DbUtil.hpp
storage/ndb/test/include/DbUtil.hpp
+4
-3
storage/ndb/test/ndbapi/acrt/NdbRepStress.cpp
storage/ndb/test/ndbapi/acrt/NdbRepStress.cpp
+151
-158
storage/ndb/test/src/DbUtil.cpp
storage/ndb/test/src/DbUtil.cpp
+22
-4
No files found.
storage/ndb/test/include/DbUtil.hpp
View file @
8b4a1916
...
...
@@ -90,9 +90,10 @@ public:
int
connect
();
int
selectDb
();
int
selectDb
(
const
char
*
m_db
);
int
doQuery
(
char
*
stm
);
int
doQuery
(
const
char
*
stm
);
int
selectDb
(
const
char
*
);
int
createDb
(
BaseString
&
);
int
doQuery
(
BaseString
&
);
int
doQuery
(
const
char
*
);
int
getErrorNumber
();
unsigned
long
selectCountTable
(
const
char
*
table
);
...
...
storage/ndb/test/ndbapi/acrt/NdbRepStress.cpp
View file @
8b4a1916
This diff is collapsed.
Click to expand it.
storage/ndb/test/src/DbUtil.cpp
View file @
8b4a1916
...
...
@@ -99,6 +99,7 @@ DbUtil::databaseLogin(const char* system, const char* usr,
mysql_get_server_info
(
mysql
),
(
unsigned
long
)
mysql_get_server_version
(
mysql
));
#endif
this
->
selectDb
();
}
/* Database Connect */
...
...
@@ -132,7 +133,7 @@ DbUtil::connect()
mysql_close
(
mysql
);
return
DBU_FAILED
;
}
this
->
selectDb
();
m_connected
=
true
;
return
DBU_OK
;
}
...
...
@@ -243,15 +244,32 @@ DbUtil::selectDb(const char * m_db)
}
}
int
DbUtil
::
createDb
(
BaseString
&
m_db
)
{
BaseString
stm
;
{
if
(
mysql_select_db
(
this
->
getMysql
(),
m_db
.
c_str
())
==
DBU_OK
)
{
stm
.
assfmt
(
"DROP DATABASE %s"
,
m_db
.
c_str
());
if
(
this
->
doQuery
(
m_db
.
c_str
())
==
DBU_FAILED
)
return
DBU_FAILED
;
}
stm
.
assfmt
(
"CREATE DATABASE %s"
,
m_db
.
c_str
());
if
(
this
->
doQuery
(
m_db
.
c_str
())
==
DBU_FAILED
)
return
DBU_FAILED
;
return
DBU_OK
;
}
}
/* Run Simple Queries */
int
DbUtil
::
doQuery
(
char
*
stm
)
DbUtil
::
doQuery
(
BaseString
&
str
)
{
if
(
mysql_query
(
this
->
getMysql
(),
st
m
))
if
(
mysql_query
(
this
->
getMysql
(),
st
r
.
c_str
()
))
{
this
->
printError
(
st
m
);
this
->
printError
(
st
r
.
c_str
()
);
return
DBU_FAILED
;
}
return
DBU_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