ID: 37937
User updated by: ibexris at gmail dot com
Reported By: ibexris at gmail dot com
-Status: Feedback
+Status: Open
Bug Type: MySQLi related
Operating System: linux, fedora core 5
PHP Version: 5.1.4
Assigned To: georg
New Comment:
5.0.22. Also, my main machine is running php 5.0.4, but I replicated
it on another machine with 5.1.4 before submitting the bug (same
version of mysql).
Previous Comments:
------------------------------------------------------------------------
[2006-06-27 20:56:20] [EMAIL PROTECTED]
Please also tell the version of MySQL you're using.
------------------------------------------------------------------------
[2006-06-27 20:54:35] ibexris at gmail dot com
Still more info.. added a web page to test it (sorry, internal network
only) and added a bunch more x's to the concat stuff.. Getting all
kinds of interesting stuff that seems to indicate a corrupt memory
fragment. The key being that one time I got "d.8.0.4) Gecko/20060609
Firefox/1.5.0." stuffed away in the response string.
------------------------------------------------------------------------
[2006-06-27 20:30:45] ibexris at gmail dot com
Further digging shows that there are also hidden characters returned
from the query, and that they often change between executions of the
code.
------------------------------------------------------------------------
[2006-06-27 20:27:35] ibexris at gmail dot com
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 this bug report at http://bugs.php.net/?id=37937&edit=1