Mantis - Quercus
Viewing Issue Advanced Details
3202 minor always 12-29-08 11:32 07-18-23 02:09
lzymll  
 
normal  
new 3.1.8  
open  
none    
none  
0003202: Mysql PDO fetch bug
when query "select id,majorname as name from category"

$array = $PDO->fetch(PDO::fetch_assoc)

can't find $array["name"], still is original table column name. and column name case won't change.


Notes
(0003684)
lzymll   
12-29-08 16:11   
Fixed,Using MySQL Connector/J 5.0

MySQL Connector/J 5.1 is not working
(0005099)
jamesdlow   
03-01-11 19:55   
Using 5.0 fixed it for me. I remember having this problem even when just using JDBC from within Java with some versions of MySQL connector.
(0005100)
jamesdlow   
03-01-11 20:11   
This link shows what changed between 5.0 and 5.1:
http://bugs.mysql.com/bug.php?id=48947 [^]

It seems that getColumnName / getColumnLabel return different things in 5.1 and
com.caucho.quercus.lib.db.PDOStatement seems to use getColumnName. Maybe it should be changed to use getColumnLabel? This is what I've done in my Java only projects in the past.