Skip to content

Commit

Permalink
Merge pull request #59 from jjthiessen/mariadb-compat
Browse files Browse the repository at this point in the history
Add MariaDB client library compatibility
  • Loading branch information
ibrarahmad committed Jun 24, 2015
2 parents dd4bd04 + 70ed6dc commit b158c93
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,23 @@ MYSQL_CONFIG = mysql_config
SHLIB_LINK := $(shell $(MYSQL_CONFIG) --libs)
PG_CPPFLAGS := $(shell $(MYSQL_CONFIG) --include)

# In Debian based distros, libmariadbclient-dev provides mariadbclient (rather than mysqlclient)
ifneq ($(findstring mariadbclient,$(SHLIB_LINK)),)
MYSQL_LIB = mariadbclient
else
MYSQL_LIB = mysqlclient
endif

UNAME = uname
OS := $(shell $(UNAME))
ifeq ($(OS), Darwin)
DLSUFFIX = .dylib
else
DLSUFFIX = .so
endif

PG_CPPFLAGS += -D _MYSQL_LIBNAME=\"lib$(MYSQL_LIB)$(DLSUFFIX)\"

ifdef USE_PGXS
PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs)
Expand Down
6 changes: 0 additions & 6 deletions mysql_fdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,6 @@ static void mysqlEstimateCosts(PlannerInfo *root, RelOptInfo *baserel, Cost *sta

static bool mysql_is_column_unique(Oid foreigntableid);

#ifdef __APPLE__
#define _MYSQL_LIBNAME "libmysqlclient.dylib"
#else
#define _MYSQL_LIBNAME "libmysqlclient.so"
#endif

void* mysql_dll_handle = NULL;
static int wait_timeout = WAIT_TIMEOUT;
static int interactive_timeout = INTERACTIVE_TIMEOUT;
Expand Down

0 comments on commit b158c93

Please sign in to comment.