diff --git a/configure.in b/configure.in index 989aa978690..444a2d957b6 100644 --- a/configure.in +++ b/configure.in @@ -1736,6 +1736,12 @@ AC_ARG_WITH(client-ldflags, [CLIENT_EXTRA_LDFLAGS=]) AC_SUBST(CLIENT_EXTRA_LDFLAGS) +AC_ARG_WITH(mysqld-libs, + [ --with-mysqld-libs Extra libraries to link with for mysqld], + [MYSQLD_EXTRA_LIBS=$withval], + [MYSQLD_EXTRA_LIBS=]) +AC_SUBST(MYSQLD_EXTRA_LIBS) + AC_ARG_WITH(lib-ccflags, [ --with-lib-ccflags Extra CC options for libraries], [LIB_EXTRA_CCFLAGS=$withval], diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index 26d761bf6fd..7ac663480c8 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -590,7 +590,7 @@ void *create_embedded_thd(int client_flag) thd->set_time(); thd->init_for_queries(); thd->client_capabilities= client_flag; - thd->real_id= (pthread_t) thd; + thd->real_id= (pthread_t)thd->thread_id; thd->db= NULL; thd->db_length= 0; diff --git a/sql/Makefile.am b/sql/Makefile.am index 9be3bf93746..59adddaae2a 100644 --- a/sql/Makefile.am +++ b/sql/Makefile.am @@ -43,7 +43,7 @@ mysqld_LDADD = @MYSQLD_EXTRA_LDFLAGS@ \ @innodb_system_libs@ \ @ndbcluster_libs@ @ndbcluster_system_libs@ \ $(LDADD) $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ \ - $(yassl_libs) $(openssl_libs) + $(yassl_libs) $(openssl_libs) @MYSQLD_EXTRA_LIBS@ noinst_HEADERS = item.h item_func.h item_sum.h item_cmpfunc.h \ item_strfunc.h item_timefunc.h item_uniq.h \ diff --git a/sql/item_func.cc b/sql/item_func.cc index 580d19fbd4e..d220a9d2a18 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3578,7 +3578,7 @@ longlong Item_func_release_lock::val_int() else { #ifdef EMBEDDED_LIBRARY - if (ull->locked && pthread_equal(current_thd->real_id,ull->thread)) + if (ull->locked && (current_thd->real_id == ull->thread)) #else if (ull->locked && pthread_equal(pthread_self(),ull->thread)) #endif