Skip to content

Commit

Permalink
MFB: #37630 MySQL extensions should link against thread safe client l…
Browse files Browse the repository at this point in the history
…ibs if built with ZTS
  • Loading branch information
m6w6 committed Jun 1, 2006
1 parent 8c04c51 commit 1ba7a68
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
6 changes: 5 additions & 1 deletion ext/mysql/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,11 @@ if test "$PHP_MYSQL" != "no"; then
Note that the MySQL client library is not bundled anymore!])
fi

MYSQL_LIBNAME=mysqlclient
if test "$enable_maintainer_zts" = "yes"; then
MYSQL_LIBNAME=mysqlclient_r
else
MYSQL_LIBNAME=mysqlclient
fi
case $host_alias in
*netware*[)]
MYSQL_LIBNAME=mysql
Expand Down
13 changes: 0 additions & 13 deletions ext/mysql/php_mysql.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,6 @@ ZEND_MODULE_STARTUP_D(mysql)
REGISTER_LONG_CONSTANT("MYSQL_CLIENT_INTERACTIVE", CLIENT_INTERACTIVE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MYSQL_CLIENT_IGNORE_SPACE", CLIENT_IGNORE_SPACE, CONST_CS | CONST_PERSISTENT);


#ifdef ZTS
# if MYSQL_VERSION_ID >= 40000
mysql_thread_init();
# endif
#endif

return SUCCESS;
}
/* }}} */
Expand All @@ -400,12 +393,6 @@ ZEND_MODULE_STARTUP_D(mysql)
*/
PHP_MSHUTDOWN_FUNCTION(mysql)
{
#ifdef ZTS
# if MYSQL_VERSION_ID >= 40000
mysql_thread_end();
# endif
#endif

UNREGISTER_INI_ENTRIES();
return SUCCESS;
}
Expand Down
8 changes: 6 additions & 2 deletions ext/mysqli/config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ dnl fi
MYSQL_CONFIG=$PHP_MYSQLI
fi

MYSQL_LIB_NAME='mysqlclient'
if test "$PHP_EMBEDDED_MYSQLI" = "yes"; then
AC_DEFINE(HAVE_EMBEDDED_MYSQLI, 1, [embedded MySQL support enabled])
MYSQL_LIB_CFG='--libmysqld-libs'
elif test "$enable_maintainer_zts" = "yes"; then
MYSQL_LIB_CFG='--libs_r'
MYSQL_LIB_NAME='mysqlclient_r'
else
MYSQL_LIB_CFG='--libs'
fi
Expand All @@ -40,12 +44,12 @@ dnl fi
dnl
dnl Check the library
dnl
PHP_CHECK_LIBRARY(mysqlclient, mysql_set_server_option,
PHP_CHECK_LIBRARY($MYSQL_LIB_NAME, mysql_set_server_option,
[
PHP_EVAL_INCLINE($MYSQLI_INCLINE)
PHP_EVAL_LIBLINE($MYSQLI_LIBLINE, MYSQLI_SHARED_LIBADD)
AC_DEFINE(HAVE_MYSQLILIB,1,[ ])
PHP_CHECK_LIBRARY(mysqlclient, mysql_stmt_field_count,
PHP_CHECK_LIBRARY($MYSQL_LIB_NAME, mysql_stmt_field_count,
[ ],[
AC_MSG_ERROR([MySQLI doesn't support versions < 4.1.3 (for MySQL 4.1.x) and < 5.0.1 for (MySQL 5.0.x) anymore. Please update your libraries.])
],[$MYSQLI_LIBLINE])
Expand Down

0 comments on commit 1ba7a68

Please sign in to comment.