#41457 [NEW]: Quoted fields come back corrupted, using GROUP BY
| From: | troelskn at gmail dot com | Date: | Mon, 21 May 2007 13:17:54 +0000 |
| Subject: | #41457 [NEW]: Quoted fields come back corrupted, using GROUP BY | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-112904@lists.php.net to get a copy of this message | ||
From: troelskn at gmail dot com
Operating system: windows xp
PHP version: 5.2.2
PHP Bug Type: SQLite related
Bug description: Quoted fields come back corrupted, using GROUP BY
Description:
------------
When executing a query, where field names are quoted, and using GROUP BY,
the field names are returned with quotes around.
This error may very well be in sqlite, and not with PHP, but I have no way
of verifying that hunch.
Using SQLite:
SQLite support => enabled
PECL Module version => 2.0-dev $Id: sqlite.c,v 1.166.2.13.2.7 2007/03/06
02:17:13 stas Exp $
SQLite Library => 2.8.17
SQLite Encoding => iso8859
Reproduce code:
---------------
<?php
$db = sqlite_open(":memory:");
sqlite_query($db, '
CREATE TABLE test (
id INTEGER PRIMARY KEY
)
');
sqlite_query($db, "INSERT INTO test (id) VALUES (1)");
$result = sqlite_query($db, 'SELECT "id" FROM "test" GROUP BY
"id"');
var_dump(sqlite_fetch_array($result, SQLITE_ASSOC));
Expected result:
----------------
array(1) {
["id"]=>
string(1) "1"
}
Actual result:
--------------
array(1) {
[""id""]=>
string(1) "1"
}
--
Edit bug report at http://bugs.php.net/?id=41457&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41457&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41457&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41457&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41457&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41457&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41457&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41457&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41457&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41457&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41457&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41457&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41457&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41457&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41457&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41457&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41457&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41457&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41457&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41457&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41457&r=mysqlcfg