#15186 [Ana->Csd]: define/mysql_connect problem

From: Date: Fri, 13 Sep 2002 11:27:48 +0000
Subject: #15186 [Ana->Csd]: define/mysql_connect problem
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-19297@lists.php.net to get a copy of this message
ID: 15186 Updated by: iliaa@php.net Reported By: derek@bluegenesis.com -Status: Analyzed +Status: Closed Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 4.2.0-dev New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2002-01-25 06:09:56] yohgaki@php.net For now, do not make resource constant. PHP tries to delete the value twice and segfaults, if type is resource. ------------------------------------------------------------------------ [2002-01-25 01:01:45] yohgaki@php.net deifne() works like a macro somewhat is 4.0.6. It segfaults with 4.1.x and 4.2.0. This is a scripting engine problem. ------------------------------------------------------------------------ [2002-01-25 00:22:50] yuw@NO_SPAM.msj.biglobe.ne.jp The same probrem occur with PostgreSQL. This script will hang. <?php define ("DBCONN01",pg_connect("dbname=db01 user=username")); define ("DBCONN02",pg_connect("dbname=db02 user=username")); pg_exec(DBCONN01,"select * from hogehoge"); pg_exec(DBCONN02,"select * from fugafuga"); ?> RedhatLinux6.2(en) + php4.1.1 + PostgreSQL7.1.3 ------------------------------------------------------------------------ [2002-01-23 15:20:50] derek@bluegenesis.com Previous to version 4.1.1, using define() to define a handle to a MySQL connection worked fine: define(DB, mysql_connect(host,user,pass)); In PHP 4.1.1, if the above is done, then the script will hang for a long time (for a minute or so) if other mysql connections are attempted to be made. i.e.: function hang_mysql() { define(DB1, mysql_connect(host,user,pass)); define(DB2, mysql_connect(host,user,pass)); } function doesnt_hang() { $db1 = mysql_connect(host,user,pass); $db2 = mysql_connect(host,user,pass); } This wasn't a problem in PHP 4.0.6 and older versions. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=15186&edit=1

« previous php.bugs (#19297) next »