Re: Bug #15186 Updated: define/mysql_connect problem

From: Date: Fri, 25 Jan 2002 06:20:44 +0000
Subject: Re: Bug #15186 Updated: define/mysql_connect problem
References: 1 2 3  Groups: php.dev 
Request: Send a blank email to php-dev+get-78071@lists.php.net to get a copy of this message
Oops, sorry. I forgot to see quotes are not there :( It is creating constant resource and it segfaults. So it is still a scripting engine problem, though. -- Yasuo Ohgaki Yasuo Ohgaki wrote:
Hi Andi, I think you are interested in this bug report :) Accoding to this bug report, define() works like a macro somewhat until 4.1.x. yuw@NO_SPAM.msj.biglobe.ne.jp wrote <?php define ("DBCONN01",pg_connect("dbname=db01 user=username")); pg_exec(DBCONN01,"select * from fugafuga"); ?> it worked with 4.0.6. (I verified with 4.0.6 and it works! It segfaults with 4.2.0-dev/ZE2 and 4.2.0-dev/ZE1) I thought define() defines scaler constant in ZE1. (and array in ZE2) Is this intended behavior? -- Yasuo Ohgaki yuw@NO_SPAM.msj.biglobe.ne.jp wrote:
ID: 15186 Comment by: yuw@NO_SPAM.msj.biglobe.ne.jp Old Reported By: derek@bluegenesis.com Reported By: yuw@NO_SPAM.msj.biglobe.ne.jp Status: Open Bug Type: MySQL related Operating System: Linux PHP Version: 4.1.1 New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [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
-- Yasuo Ohgaki Please CC me when you reply to news/list messages. Do not reply only to me :)

« previous php.dev (#78071) next »