Bug #72175 [NEW]: Impossibility of creatiing multiple connections to Interbase with php 7.0

From: Date: Mon, 09 May 2016 07:23:29 +0000
Subject: Bug #72175 [NEW]: Impossibility of creatiing multiple connections to Interbase with php 7.0
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-200949@lists.php.net to get a copy of this message
From:             netvicious at gmail dot com
Operating system: Ubuntu 16.04 LTS
PHP version:      7.0.6
Package:          InterBase related
Bug Type:         Bug
Bug description:Impossibility of creatiing multiple connections to Interbase with php 7.0

Description:
------------
If you have one open link to an Interbase/Firebird database and you open
**another** one to the same database the first link it's closed.

On my php.ini I have this (exactly the same than on PHP 5.6):

    ibase.allow_persistent = 1

    ; Maximum number of persistent links. -1 means no limit.
    ibase.max_persistent = -1

    ; Maximum number of links (persistent + non-persistent). -1 means no
limit.
    ibase.max_links = -1

The same script below was running perfectly on PHP 5.6

NikiC on StackOverflow writed this:
In particular, I don't think this line is correct:
lxr.php.net/xref/PHP_MASTER/ext/interbase/interbase.c#943 This
zend_list_close should probably be a zend_list_delete, otherwise it will
simply always destroy the resource.

Already posted to:
http://stackoverflow.com/questions/37049534/multiple-connections-to-interbase-with-php-7-0
https://bugs.launchpad.net/ubuntu/+source/php7.0/+bug/1578600

Regards,

Test script:
---------------
// DB_xxx are defined variables with the users, password, ..... of the
database.

// We have the same problem if we use ibase_pconnect or ibase_connect

$conx = ibase_connect(DB_HOST . ":" .
DB_NAME,DB_USER,DB_PWD,DB_CHARACTER) or die(ibase_errcode() . ' ' .
ibase_errmsg()); 

$conx2 = ibase_connect(DB_HOST . ":" .
DB_NAME,DB_USER,DB_PWD,DB_CHARACTER) or die(ibase_errcode() . ' ' .
ibase_errmsg()); 

$sql = 'SELECT something from somewhere';

$query = ibase_query($conx, $sql);

while ($row = ibase_fetch_assoc($query)) {
    echo $row['something'];
}

Expected result:
----------------
$conx should keep the database connection instead of be closed.

Actual result:
--------------
The test script should not write nothing, but on the error log you will
see something like:

supplied resource is not a valid Firebird/InterBase link resource in
....

    ibase_fetch_assoc(): Dynamic SQL Error SQL error code = -504 Invalid
cursor reference Cursor is not open ....

It seems $conx has been closed when creating the $conx2 connection.

-- 
Edit bug report at https://bugs.php.net/bug.php?id=72175&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=72175&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=72175&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=72175&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=72175&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=72175&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=72175&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=72175&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=72175&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=72175&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=72175&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=72175&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=72175&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=72175&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72175&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=72175&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=72175&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=72175&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72175&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=72175&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=72175&r=mysqlcfg



Thread (32 messages)

« previous php.bugs (#200949) next »