#42756 [NEW]: getColumnMeta() flag primary_key disappears when combining JOIN and ORDER BY

From: Date: Tue, 25 Sep 2007 10:57:18 +0000
Subject: #42756 [NEW]: getColumnMeta() flag primary_key disappears when combining JOIN and ORDER BY
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-117835@lists.php.net to get a copy of this message
From: jens dot ljungblad at gmail dot com Operating system: Win XP PHP version: 5.2.4 PHP Bug Type: PDO related Bug description: getColumnMeta() flag primary_key disappears when combining JOIN and ORDER BY Description: ------------ When doing a joined query with ORDER BY, the flag 'primary_key' disappears from the getColumnMeta() data. It is available when doing a JOIN and when doing an ORDER BY, but not when you combine the two. Reproduce code: --------------- <?php $pdo = new PDO(); $pdo->query('SELECT * FROM table1 LEFT JOIN table2 ON table1.id = table2.id ORDER BY table1.id'); foreach ($pdo as $row) { for ($i=0; $meta = $pdo->getColumnMeta($i); $i++) { print_r($meta); } } ?> Expected result: ---------------- I expect columns that are primary keys to have the 'primary_key' flag: [flags] => Array ( [0] => not_null [1] => primary_key ) Actual result: -------------- The primary_key flag is missing -- Edit bug report at http://bugs.php.net/?id=42756&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42756&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42756&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42756&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42756&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42756&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42756&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=42756&r=needscript Try newer version: http://bugs.php.net/fix.php?id=42756&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42756&r=support Expected behavior: http://bugs.php.net/fix.php?id=42756&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42756&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42756&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42756&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42756&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42756&r=dst IIS Stability: http://bugs.php.net/fix.php?id=42756&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42756&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42756&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42756&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=42756&r=mysqlcfg

« previous php.bugs (#117835) next »