ID:               40006
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
 Bug Type:         Sybase (dblib) related
 Operating System: CentOS 4
 PHP Version:      5CVS-2007-01-03 (CVS)
 New Comment:

Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Dupe of #39058


Previous Comments:
------------------------------------------------------------------------

[2007-01-03 08:13:09] [EMAIL PROTECTED]

Description:
------------
Calling sybase_query() for a SELECT query that returns multiple rows
causes the memory limit to be hit or, in the case where the memory
manager isn't compiled in, memory usage to increase until the PHP
process is killed. I'm running Sybase ASE 15.0 on CentOS 4. The problem
seems to occur both with PHP_5_2 CVS and also PHP 4.4.4. PHP was
compiled with --with-sybase=/usr/local/sybase; /usr/local/sybase being
the installation directory for ASE on the box in question.

This looks quite similar to bug #39508, but that's using sybase-ct
instead of straight sybase.

Reproduce code:
---------------
<?php
$db = sybase_connect('LOCALHOST', 'sa', 'password') or die("Error
connecting to ASE.\n");
sybase_select_db('test', $db) or die("Error selecting database.\n");
if (sybase_query("CREATE TABLE phptest (a integer)", $db))
    echo "Table created.\n";
else
    echo "Error creating table.\n";
sybase_query("INSERT INTO phptest VALUES (1)", $db) or print("Error
inserting record.\n");
sybase_query("INSERT INTO phptest VALUES (2)", $db) or print("Error
inserting record.\n");
echo "Records inserted, attempting select...\n";
if (sybase_query('SELECT a FROM phptest WHERE a = 1', $db))
    echo "Single row select complete.\n";
else
    echo "Single row select failed.\n";
if (sybase_query('SELECT a FROM phptest WHERE a > 0', $db))
    echo "Multiple row select complete.\n";
else
    echo "Multiple row select failed.\n";
sybase_query('DROP TABLE phptest', $db) or print("Error dropping
table.\n");
sybase_close($db) or die("Error closing connection.\n");
?>

Expected result:
----------------
Table created.
Records inserted, attempting select...
Single row select complete.
Multiple row select complete.

Actual result:
--------------
Table created.
Records inserted, attempting select...
Single row select complete.

Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to
allocate 3434496 bytes) in /tmp/test-sybase.php on line 15


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40006&edit=1

Reply via email to