projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
tests: fix clients tests
[awesomized/libmemcached]
/
libtest
/
drizzled.cc
diff --git
a/libtest/drizzled.cc
b/libtest/drizzled.cc
index 49fe29699f2843984988d8c8ec56515f8afd41f6..3a93b6664817e6131349d88e72ce63b88719dc1b 100644
(file)
--- a/
libtest/drizzled.cc
+++ b/
libtest/drizzled.cc
@@
-34,7
+34,7
@@
*
*/
*
*/
-#include
<config.h>
+#include
"libtest/yatlcon.h"
#include <libtest/common.h>
#include <libtest/drizzled.h>
#include <libtest/common.h>
#include <libtest/drizzled.h>
@@
-62,7
+62,7
@@
using namespace libtest;
#endif
#if defined(HAVE_LIBDRIZZLE) && HAVE_LIBDRIZZLE
#endif
#if defined(HAVE_LIBDRIZZLE) && HAVE_LIBDRIZZLE
-#
include <libdrizzle-1.0
/drizzle_client.h>
+#
include <libdrizzle-5.1
/drizzle_client.h>
#endif
using namespace libtest;
#endif
using namespace libtest;
@@
-72,31
+72,25
@@
bool ping_drizzled(const in_port_t _port)
{
(void)(_port);
#if defined(HAVE_LIBDRIZZLE) && HAVE_LIBDRIZZLE
{
(void)(_port);
#if defined(HAVE_LIBDRIZZLE) && HAVE_LIBDRIZZLE
+ if (HAVE_LIBDRIZZLE)
{
{
- drizzle_st *drizzle= drizzle_create(NULL);
+ drizzle_st *drizzle= drizzle_create(getenv("MYSQL_SERVER"),
+ getenv("MYSQL_PORT") ? atoi("MYSQL_PORT") : DRIZZLE_DEFAULT_TCP_PORT,
+ getenv("MYSQL_USER"),
+ getenv("MYSQL_PASSWORD"),
+ getenv("MYSQL_SCHEMA"), 0);
if (drizzle == NULL)
{
return false;
}
if (drizzle == NULL)
{
return false;
}
- drizzle_con_st *con;
-
- if ((con= drizzle_con_create(drizzle, NULL)) == NULL)
- {
- drizzle_free(drizzle);
- return false;
- }
-
- drizzle_con_set_tcp(con, "localhost", _port);
- drizzle_con_set_auth(con, "root", 0);
-
bool success= false;
drizzle_return_t rc;
bool success= false;
drizzle_return_t rc;
- if ((rc= drizzle_con
_connect(con
)) == DRIZZLE_RETURN_OK)
+ if ((rc= drizzle_con
nect(drizzle
)) == DRIZZLE_RETURN_OK)
{
{
- drizzle_result_st *result= drizzle_ping(
con, NULL
, &rc);
+ drizzle_result_st *result= drizzle_ping(
drizzle
, &rc);
success= bool(result);
drizzle_result_free(result);
}
success= bool(result);
drizzle_result_free(result);
}
@@
-108,8
+102,7
@@
bool ping_drizzled(const in_port_t _port)
Error << drizzle_error(drizzle) << " localhost:" << _port;
}
Error << drizzle_error(drizzle) << " localhost:" << _port;
}
- drizzle_con_free(con);
- drizzle_free(drizzle);
+ drizzle_quit(drizzle);
return success;
}
return success;
}
@@
-182,16
+175,17
@@
public:
{
if (arg > 0)
{
{
if (arg > 0)
{
- char buffer[1024];
- snprintf(buffer, sizeof(buffer), "--drizzle-protocol.port=%d", int(arg));
- app.add_option(buffer);
+ libtest::vchar_t buffer;
+ buffer.resize(1024);
+ snprintf(&buffer[1024], buffer.size(), "--drizzle-protocol.port=%d", int(arg));
+ app.add_option(&buffer[1024]);
}
}
}
}
- bool build(
size_t argc, const char *argv[]
);
+ bool build();
};
};
-bool Drizzle::build(
size_t argc, const char *argv[]
)
+bool Drizzle::build()
{
if (getuid() == 0 or geteuid() == 0)
{
{
if (getuid() == 0 or geteuid() == 0)
{
@@
-203,11
+197,6
@@
bool Drizzle::build(size_t argc, const char *argv[])
add_option("--datadir=var/drizzle");
#endif
add_option("--datadir=var/drizzle");
#endif
- for (size_t x= 0 ; x < argc ; x++)
- {
- add_option(argv[x]);
- }
-
return true;
}
return true;
}