#46533 [Asn->WFx]: PDOStatement::getColumnMeta lacks some information regarding aliases

From: Date: Mon, 17 Nov 2008 17:32:18 +0000
Subject: #46533 [Asn->WFx]: PDOStatement::getColumnMeta lacks some information regarding aliases
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-131042@lists.php.net to get a copy of this message
ID: 46533 Updated by: johannes@php.net Reported By: taco at procurios dot nl -Status: Assigned +Status: Wont fix Bug Type: PDO related Operating System: Linux PHP Version: 5.2.6 Assigned To: mysql New Comment: This won't be fixed till we get a PDO2 (or whatever there will be in future) as there is no specification about naming of custom elements. Adding them randomly in one driver isn't good for an "abstraction layer". Previous Comments: ------------------------------------------------------------------------ [2008-11-10 10:09:12] taco at procurios dot nl Description: ------------ When using aliases for tables and/or columns in a MySQL query. The method PDOStatement::getColumnMeta() will not tell you anything about the original table / column name. In the MySQLi extension the information about the original table / column name was represented as 'orgtable' and 'orgname' this would be a very nice addition to the PDO extension. Reproduce code: --------------- SQL: CREATE TABLE foobar ( bar varchar(255) default NULL ) ENGINE=MEMORY; PHP: print_r( $PDO->query("SELECT foo.bar as baz FROM foobar foo") ->getColumnMeta(0) ); Expected result: ---------------- Array ( [native_type] => VAR_STRING [flags] => Array ( ) [table] => foo [orgtable] => foobar [name] => baz [orgname] => bar [len] => 255 [precision] => 0 [pdo_type] => 2 ) Actual result: -------------- Array ( [native_type] => VAR_STRING [flags] => Array ( ) [table] => foo [name] => baz [len] => 255 [precision] => 0 [pdo_type] => 2 ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46533&edit=1

« previous php.bugs (#131042) next »