#31526 [NEW]: mysqli_stmt_bind_param with SELECT crashes Apache2

From: Date: Thu, 13 Jan 2005 05:48:54 +0000
Subject: #31526 [NEW]: mysqli_stmt_bind_param with SELECT crashes Apache2
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-72050@lists.php.net to get a copy of this message
From:             wyatt dot mike at gmail dot com
Operating system: Windows XP SP2
PHP version:      5.0.3
PHP Bug Type:     MySQLi related
Bug description:  mysqli_stmt_bind_param with SELECT crashes Apache2

Description:
------------
the tables contain two fields, each with 10000 rows where the names are
just 10-digit numbers

when I use the mysqli_stmt_bind_param, I get the 'memory could not be
"read"' error, when not used I get no error

Reproduce code:
---------------
<?php
$db = new mysqli("localhost","root","","test");
$tables =
array('t_0','t_1','t_2','t_3','t_5','t_all');
foreach($tables AS $table){
	$stmt[$table] = $db->stmt_init();
	$stmt[$table]->prepare("SELECT id, name FROM " . $table . " WHERE name =
?");
	$stmt[$table]->bind_param('i',$name);
}
for($i = 0;$i < 10;$i++){
	$name = "";
	for($j = 0;$j < 10;$j++){
		$name .= rand(0,9);
	}

	foreach($tables AS $table){
		$stmt[$table]->execute();
	}
}
$db->close();
?>

Actual result:
--------------
'The instruction "0x00df82df" referenced memory at "0x0000000064". The
memory could not be "read".'

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


Thread (4 messages)

« previous php.bugs (#72050) next »