#38328 [NEW]: When using collate no result set returned
| From: | bogdan dot enache at intersat-telecom dot ro | Date: | Fri, 04 Aug 2006 13:31:32 +0000 |
| Subject: | #38328 [NEW]: When using collate no result set returned | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-100337@lists.php.net to get a copy of this message | ||
From: bogdan dot enache at intersat-telecom dot ro
Operating system: Windows XP
PHP version: 5.1.4
PHP Bug Type: MySQLi related
Bug description: When using collate no result set returned
Description:
------------
A query like:
SELECT * FROM view_cl_all WHERE cl_name LIKE '%ab%'
is working both in Query Browser and PHP. BUT,
SELECT * FROM view_cl_all WHERE cl_name LIKE '%ab%' COLLATE
utf8_general_ci
works (5 results) in Query Browser. If I run the same query in PHP, query
fails (returns NULL resultset).
Table type: InnoDB, charset: UTF8, collation: utf8_romanian_ci
Reproduce code:
---------------
So I have this PHP code:
if ($dbc->query($s)){
$ret = array();
if($res = $dbc->store_result()){
$no = $res->num_rows;
for($i = 0; $i < $no; $i++){
$ret[$i] = $res->fetch_assoc();
}
if($res){
$res->close();
}
return $ret;
}
}
else{
echo 'Query failed: '; var_dump($s);
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
}
exit;
return FALSE;
}
IF I set
$s="SELECT * FROM view_cl_all WHERE (cl_name LIKE '%al%' )"
it's working, i get a number of results.
But if
$s="SELECT * FROM view_cl_all WHERE (cl_name LIKE '%al%' COLLATE
utf8_general_ci)"
then query silently fails, no error, but NULL resultset.
--
Edit bug report at http://bugs.php.net/?id=38328&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38328&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38328&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38328&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38328&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=38328&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38328&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38328&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38328&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38328&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38328&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=38328&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=38328&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38328&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38328&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38328&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38328&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38328&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38328&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38328&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38328&r=mysqlcfg