#32013 [NEW]: MySQLi bind_result causes fatal error: memory limit reached
| From: | mhe at ltcgroup dot de | Date: | Thu, 17 Feb 2005 18:32:14 +0000 |
| Subject: | #32013 [NEW]: MySQLi bind_result causes fatal error: memory limit reached | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-74244@lists.php.net to get a copy of this message | ||
From: mhe at ltcgroup dot de
Operating system: Debian Woody
PHP version: 5.0.3
PHP Bug Type: MySQLi related
Bug description: MySQLi bind_result causes fatal error: memory limit reached
Description:
------------
submit a prepared query to mysqli ext using method prepare().
if i use bind_result to bind a column to a variable php crashes with fatal
error: memory limit, if the column in database is mediumtext. if you alter
this to text, everything works fine.
using mysqld 4.1.10
--output: php5 -v
micronium:~/phpn# php5 -v
PHP 5.0.3-1.dotdeb.0 (cli) (built: Dec 16 2004 13:08:20)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v2.0.3, Copyright (c) 1998-2004 Zend Technologies
-- mysql:
CREATE TABLE tt (
ID_ITEM INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
TITLE VARCHAR(255) NULL,
DESCRIPTION MEDIUMTEXT NULL,
PRIMARY KEY(ID_ITEM)
);
-- php:
$query = "
select
DESCRIPTION
from
tt
";
$stmt = $db->prepare($query);
$stmt->execute();
$stmt->bind_result($DESCRIPTION); //-- this is line 63
-- output:
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate 16777216 bytes) in /root/phpn/run.php on line 63
Allowed memory size of 8388608 bytes exhausted (tried to allocate 256
bytes)
-- mysql:
ALTER TABLE
tt CHANGE DESCRIPTION DESCRIPTION TEXT
-- php:
$query = "
select
DESCRIPTION
from
tt
";
$stmt = $db->prepare($query);
$stmt->execute();
$stmt->bind_result($ID_ITEM); //-- this is line 63
-- output:
::: everything is ok, no crahs, can go on
Reproduce code:
---------------
try to bind a MEDIUM text column to a variable, and php will crash ..
--
Edit bug report at http://bugs.php.net/?id=32013&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32013&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32013&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32013&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32013&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32013&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32013&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32013&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32013&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32013&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32013&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32013&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32013&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32013&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32013&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32013&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32013&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32013&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32013&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32013&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32013&r=mysqlcfg