#32405 [NEW]: mysqli->fetch() is returning bad data
From: paul at thehedron dot com
Operating system: Linux (fedora core 3)
PHP version: 5.0.3
PHP Bug Type: MySQLi related
Bug description: mysqli->fetch() is returning bad data
Description:
------------
mysqli->fetch() is returning bad data on int columns. I saw this listed,
then closed as bogus (29002). I just hit it today and assure you it is
not bogus.
Here is my full setup:
-----------------------------------------------------------
CPU: AMD64
OS: Fedora Core 3 (2.6.9-1.667)
PHP: 5.0.3
libmcrypt-2.5.7
mcrypt-2.6.4
mhash-0.9.2
Apache: 1.3.33
mod_ssl-2.8.22-1.3.33
openssl-0.9.7e
MySQL: 4.1.10
GCC: 3.4.2
-----------------------------------------------------------
PHP configuration:
./configure \
--with-apxs=/www/bin/apxs \
--with-mysql=/usr/local/mysql \
--with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-mcrypt=/shared/LAMP/PHP5/libmcrypt-2.5.7 \
--enable-ftp \
--enable-trans-sid
Reproduce code:
---------------
CREATE TABLE users (
user_id INT UNSIGNED NOT NULL AUTO_INCREMENT,
lastname VARCHAR(50) NOT NULL,
PRIMARY KEY(user_id));
-----------------------------------------------------------------------
<?php
$mysqli = new mysqli('localhost', 'user', 'password',
'test');
if ($stmt = $mysqli->prepare("SELECT user_id, lastname FROM users")) {
$stmt->execute();
$stmt->bind_result($col1, $col2);
while ($stmt->fetch()) {
printf("%s %s <br />", $col1, $col2);
}
$stmt->close();
}
$mysqli->close();
?>
Expected result:
----------------
Expected results:
1 Peterson
2 Asenbach
Actual result:
--------------
Actual results:
32199691940659210 Peterson
32199691940659211 Asenbach
--
Edit bug report at http://bugs.php.net/?id=32405&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32405&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32405&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32405&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32405&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32405&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32405&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32405&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32405&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32405&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32405&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=32405&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=32405&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32405&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32405&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32405&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32405&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32405&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32405&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32405&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32405&r=mysqlcfg
Thread (7 messages)
- paul at thehedron dot com