[php-maint] Bug#431433: Should new_link default to true when using mysql?

William Thompson wt at electro-mechanical.com
Mon Jul 2 15:03:08 UTC 2007


Package: php-db
Version: 1.7.6-2
Severity: wishlist

I had a little problem when using DB to access a mysql server.  I'm using
2 different DSNs, but has the same user/pass/server.  One of those stays
open throughout the script's life, the other does not.  The following script
shows this problem:

<?php

require_once("DB.php");

$base_dsn="mysql://user:pass@localhost";

echo "Open DB1\n";
$db1=DB::connect("$base_dsn/db1");
echo "db1=";var_dump($db1->connection);
echo "Open DB2\n";
$db2=DB::connect("$base_dsn/db2");
echo "db1=";var_dump($db1->connection);
echo "db2=";var_dump($db2->connection);
echo "Close DB2\n";
$db2->disconnect();
echo "db1=";var_dump($db1->connection);
echo "db2=";var_dump($db2->connection);

?>

Shows:
Open DB1
db1=resource(9) of type (mysql link)
Open DB2
db1=resource(9) of type (mysql link)
db2=resource(9) of type (mysql link)
Close DB2
db1=resource(9) of type (Unknown)
db2=NULL

I expected that db1, after disconnecting from db2 would still be connected.
Using new_link=true fixes this problem, but should this have to be
specified?

Or should this be reassigned to php5-mysql since mysql_close closes the
entire connection (even if more than 1 open occured)

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.12 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages php-db depends on:
ii  php-pear                      5.1.2-1    PEAR - PHP Extension and Applicati

php-db recommends no packages.

-- no debconf information




More information about the pkg-php-maint mailing list