From 141fd848ae803a4be14d176283b98e539ed1efb7 Mon Sep 17 00:00:00 2001 From: Marc Fournier Date: Thu, 12 Mar 2015 09:58:28 +0100 Subject: [PATCH] Revert "add a conditional for the new dbi reentrant driver interface" This reverts commit f1907a6d0775bc2ed9f2de79bd82b05e06e3e214. With @pyr's acknowledgement, thanks ! Fixes #962 --- configure.ac | 6 ------ src/dbi.c | 21 ++------------------- 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/configure.ac b/configure.ac index 2af661ef..dc61f05d 100644 --- a/configure.ac +++ b/configure.ac @@ -1751,7 +1751,6 @@ then LDFLAGS="$LDFLAGS $with_libdbi_ldflags" AC_CHECK_LIB(dbi, dbi_initialize, [with_libdbi="yes"], [with_libdbi="no (Symbol 'dbi_initialize' not found)"]) - AC_CHECK_LIB(dbi, dbi_driver_open_r, [with_libdbi_r="yes"], [with_libdbi_r="no"]) CPPFLAGS="$SAVE_CPPFLAGS" LDFLAGS="$SAVE_LDFLAGS" @@ -1764,11 +1763,6 @@ then AC_SUBST(BUILD_WITH_LIBDBI_CPPFLAGS) AC_SUBST(BUILD_WITH_LIBDBI_LDFLAGS) AC_SUBST(BUILD_WITH_LIBDBI_LIBS) - - if test "x$with_libdbi_r" = "xyes" - then - AC_DEFINE(HAVE_LIBDBI_R, 1, [Define if reentrant dbi facility is present and usable.]) - fi fi AM_CONDITIONAL(BUILD_WITH_LIBDBI, test "x$with_libdbi" = "xyes") # }}} diff --git a/src/dbi.c b/src/dbi.c index 223e159f..7fec73c5 100644 --- a/src/dbi.c +++ b/src/dbi.c @@ -32,9 +32,6 @@ #include -#ifdef HAVE_LIBDBI_R - dbi_inst inst = NULL; -#endif /* * Data types */ @@ -134,7 +131,7 @@ static int cdbi_result_get_field (dbi_result res, /* {{{ */ else if (src_type == DBI_TYPE_STRING) { const char *value; - + value = dbi_result_get_string_idx (res, index); if (value == NULL) sstrncpy (buffer, "", buffer_size); @@ -200,7 +197,7 @@ static void cdbi_database_free (cdbi_database_t *db) /* {{{ */ * * ... * - * + * * * Driver "mysql" * DriverOption "hostname" "localhost" @@ -454,11 +451,7 @@ static int cdbi_init (void) /* {{{ */ return (-1); } -#ifdef HAVE_LIBDBI_R - status = dbi_initialize_r (NULL, &inst); -#else status = dbi_initialize (NULL); -#endif if (status < 0) { ERROR ("dbi plugin: cdbi_init: dbi_initialize failed with status %i.", @@ -679,26 +672,16 @@ static int cdbi_connect_database (cdbi_database_t *db) /* {{{ */ db->connection = NULL; } -#ifdef HAVE_LIBDBI_R - driver = dbi_driver_open_r (db->driver, inst); -#else driver = dbi_driver_open (db->driver); -#endif if (driver == NULL) { ERROR ("dbi plugin: cdbi_connect_database: dbi_driver_open (%s) failed.", db->driver); INFO ("dbi plugin: Maybe the driver isn't installed? " "Known drivers are:"); -#ifdef HAVE_LIBDBI_R - for (driver = dbi_driver_list_r (NULL, inst); - driver != NULL; - driver = dbi_driver_list_r (driver, inst)) -#else for (driver = dbi_driver_list (NULL); driver != NULL; driver = dbi_driver_list (driver)) -#endif { INFO ("dbi plugin: * %s", dbi_driver_get_name (driver)); } -- 2.11.0