From: ibexris at gmail dot com Operating system: linux, fedora core 5 PHP version: 5.1.4 PHP Bug Type: MySQLi related Bug description: bound params inside of a CONCAT do not work
Description: ------------ Like the summary says... using a bound parameter inside of a CONCAT() produces strange results. Reproduce code: --------------- <?php $dbh = mysqli_init(); $dbh->real_connect('localhost', 'dbuser', '', 'dbname'); $sh = $dbh->prepare('SELECT CONCAT("xxx", ?, "xxx"), CONCAT("xxx", "abc", "xxx")'); $sh->bind_param('s', $x); $sh->bind_result($r, $r2); $x = 'abc'; $sh->execute(); $sh->fetch(); echo "\n$r\n$r2\n\n"; $dbh->close(); Expected result: ---------------- xxxabcxxx xxxabcxxx Actual result: -------------- On my system, this prints out: xxxabcxA xxxabcxxx The "A" changes on other systems (or goes away). However, both lines *should* be the same. Change the x's around in the first field and watch the results get even stranger, or remove them completely to have it work as expected (except that I need the CONCAT for my query). -- Edit bug report at http://bugs.php.net/?id=37937&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=37937&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=37937&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=37937&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=37937&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=37937&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=37937&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=37937&r=needscript Try newer version: http://bugs.php.net/fix.php?id=37937&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=37937&r=support Expected behavior: http://bugs.php.net/fix.php?id=37937&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=37937&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=37937&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=37937&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=37937&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=37937&r=dst IIS Stability: http://bugs.php.net/fix.php?id=37937&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=37937&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=37937&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=37937&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=37937&r=mysqlcfg