Anonymous | Login | Signup for a new account | 12-17-2024 08:35 PST |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
0002080 | [Quercus] | minor | always | 10-17-07 18:12 | 10-18-07 09:50 | ||||
Reporter | koreth | View Status | public | ||||||
Assigned To | ferg | ||||||||
Priority | normal | Resolution | fixed | ||||||
Status | closed | Product Version | 3.1.3 | ||||||
Summary | 0002080: mysql_fetch_assoc() doesn't obey column aliases | ||||||||
Description |
$res = mysql_query($conn, "SELECT foo AS bar FROM xyzzy"); $row = mysql_fetch_assoc($res); In vanilla PHP, $row['bar'] will contain the value. In Quercus, $row['foo'] contains the value. |
||||||||
Additional Information |
Patch: --- a/modules/quercus/src/com/caucho/quercus/lib/db/JdbcResultResource.java +++ b/modules/quercus/src/com/caucho/quercus/lib/db/JdbcResultResource.java @@ -159,8 +159,12 @@ public class JdbcResultResource { if ((type & FETCH_ASSOC) != 0) { _columnNames = new Value[count]; - for (int i = 0; i < count; i++) - _columnNames[i] = env.createString(_metaData.getColumnName(i + 1)); + for (int i = 0; i < count; i++) { + String name = _metaData.getColumnLabel(i + 1); + if (name == null) + name = _metaData.getColumnName(i + 1); + _columnNames[i] = env.createString(name); + } } for (int i = 0; i < count; i++) { |
||||||||
Attached Files | |||||||||
|
Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
29 total queries executed. 26 unique queries executed. |