Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:846 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 92946 invoked from network); 11 Apr 2003 06:44:14 -0000 Received: from unknown (HELO wmeler.t1.gda.wp-sa.pl) (212.77.105.136) by pb1.pair.com with SMTP; 11 Apr 2003 06:44:14 -0000 Received: (from wmeler@localhost) by wmeler.t1.gda.wp-sa.pl (8.11.6/8.11.6) id h3B6i0j10731 for internals@lists.php.net; Fri, 11 Apr 2003 08:44:00 +0200 X-Authentication-Warning: wmeler.t1.gda.wp-sa.pl: wmeler set sender to wmeler@wp-sa.pl using -f Date: Fri, 11 Apr 2003 08:44:00 +0200 To: internals@lists.php.net Message-ID: <20030411084400.G3814@wp-sa.pl> Reply-To: wmeler@wp-sa.pl Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="WhfpMioaduB5tiZL" Content-Disposition: inline User-Agent: Mutt/1.2.5i Subject: MySQL thread safety issue From: wmeler@wp-sa.pl (Wojtek Meler) --WhfpMioaduB5tiZL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Current ext/mysql uses libmysqclient.so if you give it path to libraries. In ZTS it should use libmysqlclient_r.so which is reentrant version of MySQL library (I have SIGSEGV with libmysqlclient.so). I've made a patch on config.m4. See attached file. regards, Wojtek --WhfpMioaduB5tiZL Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="mysqlclient_r.patch" diff -urN php/ext/mysql/config.m4 php-mysqlclient_r/ext/mysql/config.m4 --- php/ext/mysql/config.m4 Mon Oct 21 04:46:12 2002 +++ php-mysqlclient_r/ext/mysql/config.m4 Fri Apr 11 08:29:57 2003 @@ -8,7 +8,7 @@ sinclude(libmysql/mysql.m4) AC_DEFUN(MYSQL_LIB_CHK, [ - str="$MYSQL_DIR/$1/libmysqlclient.*" + str="$MYSQL_DIR/$1/lib$MYSQL_LIBNAME.*" for j in `echo $str`; do if test -r $j; then MYSQL_LIB_DIR=$MYSQL_DIR/$1 @@ -95,6 +95,12 @@ MYSQL_TYPE_CHECKS + if test "$ZEND_EXPERIMENTAL_ZTS" != "no"; then + MYSQL_LIBNAME=mysqlclient_r + else + MYSQL_LIBNAME=mysqlclient + fi + PHP_NEW_EXTENSION(mysql, php_mysql.c, $ext_shared) for i in $PHP_MYSQL; do @@ -118,14 +124,14 @@ done if test -z "$MYSQL_LIB_DIR"; then - AC_MSG_ERROR(Cannot find mysqlclient library under $MYSQL_DIR) + AC_MSG_ERROR(Cannot find $MYSQL_LIBNAME library under $MYSQL_DIR) fi - PHP_CHECK_LIBRARY(mysqlclient, mysql_close, [ ], + PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_close, [ ], [ if test "$PHP_ZLIB_DIR" != "no"; then PHP_ADD_LIBRARY_WITH_PATH(z, $PHP_ZLIB_DIR, MYSQL_SHARED_LIBADD) - PHP_CHECK_LIBRARY(mysqlclient, mysql_error, [], [ + PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_error, [], [ AC_MSG_ERROR([mysql configure failed. Please check config.log for more information.]) ], [ -L$PHP_ZLIB_DIR/lib -L$MYSQL_LIB_DIR @@ -133,7 +139,7 @@ MYSQL_LIBS="-L$PHP_ZLIB_DIR/lib -lz" else PHP_ADD_LIBRARY(z,, MYSQL_SHARED_LIBADD) - PHP_CHECK_LIBRARY(mysqlclient, mysql_errno, [], [ + PHP_CHECK_LIBRARY($MYSQL_LIBNAME, mysql_errno, [], [ AC_MSG_ERROR([Try adding --with-zlib-dir=. Please check config.log for more information.]) ], [ -L$MYSQL_LIB_DIR @@ -144,8 +150,8 @@ -L$MYSQL_LIB_DIR ]) - PHP_ADD_LIBRARY_WITH_PATH(mysqlclient, $MYSQL_LIB_DIR, MYSQL_SHARED_LIBADD) - MYSQL_LIBS="-L$MYSQL_LIB_DIR -lmysqlclient $MYSQL_LIBS" + PHP_ADD_LIBRARY_WITH_PATH($MYSQL_LIBNAME, $MYSQL_LIB_DIR, MYSQL_SHARED_LIBADD) + MYSQL_LIBS="-L$MYSQL_LIB_DIR -l$MYSQL_LIBNAME $MYSQL_LIBS" PHP_ADD_INCLUDE($MYSQL_INC_DIR) MYSQL_INCLUDE=-I$MYSQL_INC_DIR --WhfpMioaduB5tiZL--