#37937 [Opn->Asn]: bound params inside of a CONCAT do not work
| From: | tony2001@php.net | Date: | Tue, 27 Jun 2006 20:40:48 +0000 |
| Subject: | #37937 [Opn->Asn]: bound params inside of a CONCAT do not work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-98856@lists.php.net to get a copy of this message | ||
ID: 37937
Updated by: tony2001@php.net
Reported By: ibexris at gmail dot com
-Status: Open
+Status: Assigned
Bug Type: MySQLi related
Operating System: linux, fedora core 5
PHP Version: 5.1.4
-Assigned To:
+Assigned To: georg
Previous Comments:
------------------------------------------------------------------------
[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