From:             pumuckel at metropolis dot de
Operating system: Linux
PHP version:      4.3.7
PHP Bug Type:     OCI8 related
Bug description:  multiple OCIBindByName on same placeholder eats memory

Description:
------------
Calling OCIBindByName on the same placeholder (same statement) does eat
memory. The expected behaviour should be to just replace the old
placeholder variable with the new one, without any new memory allocation
needed.

Reproduce code:
---------------
<?
  //
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96584/oci05bnd.htm#421792
  ob_end_flush();
  ob_implicit_flush(1);

  $conn = OCILogon("scott", "tiger", "database");
  $stmt = OCIParse($conn, "SELECT DUMMY FROM DUAL WHERE DUMMY=:DUMMY");
  $i = 1;
  while($i++) {
    OCIBindByName($stmt, ":DUMMY", &$dummy, 1);
    if ($i%500 == 0)
    echo "\rMEM -send $i: ".memory_get_usage();
  }
?>


Expected result:
----------------
The memory usage shouldn't grow.
A second call to ocibindbyname on the same placeholder should free/replace
the old php internal bind variable (in oci8.c) for this placeholder...

Actual result:
--------------
actual a new bind place holder is allocated and added to the list of bind
variables.

./bug.php
MEM -send 122500: 8387128
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate 20 bytes) in /user/bug.php on line 16


-- 
Edit bug report at http://bugs.php.net/?id=28978&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28978&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28978&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28978&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28978&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28978&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28978&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28978&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28978&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28978&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28978&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28978&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28978&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28978&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28978&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28978&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28978&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28978&r=float

Reply via email to