#49856 [NEW]: SHOW COLUMNS FROM... return weird result set
| From: | joao at jjmf dot com | Date: | Tue, 13 Oct 2009 02:23:02 +0000 |
| Subject: | #49856 [NEW]: SHOW COLUMNS FROM... return weird result set | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-143510@lists.php.net to get a copy of this message | ||
From: joao at jjmf dot com
Operating system: CentOS 5.3
PHP version: 5.3.0
PHP Bug Type: PDO related
Bug description: SHOW COLUMNS FROM... return weird result set
Description:
------------
When executing the query "SHOW COLUMNS FROM table" it returns weird
results.
Database: MySQL.
I think it's something related to CentOS 5.3 since I got this problem
after migrating from Ubuntu. This never happened in Ubuntu.
Reproduce code:
---------------
---
From manual page: pdostatement.fetch#Descrição
---
$pdo = new PDO(
'mysql:host=localhost;dbname=MYDB', 'MYUSER', 'MYPASS',
array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8")
);
$sql = "SHOW COLUMNS FROM tablename";
$sth = $pdo->prepare($sql);
$sth->execute();
/* Exercise PDOStatement::fetch styles */
print("PDO::FETCH_ASSOC: ");
print("Return next row as an array indexed by column name\n");
$result = $sth->fetch(PDO::FETCH_ASSOC);
print_r($result);
print("\n");
Expected result:
----------------
For each column an array like:
[Field] => 'id_user'
[Type] => 'int(11) unsigned'
[Null] => 'NO'
[Key] => 'PRI'
[Default] => null
[Extra] => 'auto_increment'
Actual result:
--------------
For each column an array like:
[Field] => id_user
[COLUMN_TYPE] => int(11) unsigned
[COLUMNS] => NO
[] =>
[def] => auto_increment
--
Edit bug report at http://bugs.php.net/?id=49856&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49856&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49856&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49856&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49856&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49856&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49856&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49856&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49856&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49856&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49856&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49856&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49856&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49856&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49856&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49856&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49856&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49856&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49856&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49856&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49856&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49856&r=mysqlcfg