|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #56310 PDO/MySQL getColumnMeta() broken
Submitted: 2005-02-20 06:08 UTC Modified: 2005-02-20 18:56 UTC
From: Assigned: hholzgra (profile)
Status: Closed Package: PDO_MYSQL (PECL)
PHP Version: 5_1 CVS-2005-02-20 (dev) OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2005-02-20 06:08 UTC]
PDO/MySQL getColumnMeta() always returns bool(false) in pdo_mysql due to a bogus check

Reproduce code:
the following sourcecode:

  $dbh= new PDO('mysql:host='.$argv[1], $argv[2], $argv[3]); 

  $stmt= $dbh->prepare('select * from entries where id = :id');
  $stmt->bindParam(':id', $argv[4]);
  if (!$stmt->execute()) {

  for ($i= 0, $s= $stmt->columnCount(); $i < $s; $i++) {
    echo $i, ':: '; var_dump($stmt->getColumnMeta($i));

Expected result:
0:: array(6) {
  string(4) "LONG"
  array(2) {
    string(8) "not_null"
    string(11) "primary_key"
  string(2) "id"
1:: array(6) {
  string(10) "VAR_STRING"
  array(0) {
  string(5) "title"
[...and so on...]

Actual result:
1:: bool(false)
2:: bool(false)
[...and so on...]


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-02-20 06:15 UTC]
Patch that fixes this issue:

(also fixes #3530)

Note: I removed the comment reading

  /* FIXME where does this get freed? */

because the column name is freed in pdo_stmt.c in free_statement()
 [2005-02-20 18:56 UTC]
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on

In case this was a website problem, the change will show
up on the website in short time.
Thank you for the report, and for helping us make PECL better.

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Feb 24 14:01:29 2024 UTC