php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36700 getColumnMeta() crashes
Submitted: 2006-03-12 00:07 UTC Modified: 2006-03-14 12:23 UTC
From: mauroi at digbang dot com Assigned:
Status: Closed Package: PDO related
PHP Version: 5CVS-2006-03-11 (snap) OS: Win XP SP2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mauroi at digbang dot com
New email:
PHP Version: OS:

 

 [2006-03-12 00:07 UTC] mauroi at digbang dot com
Description:
------------
I have this problem with pdo_pgsql.
Whenever I try to call getColumnMeta on a "strange" query I get a crash.

Reproduce code:
---------------
<?
$conn = new PDO('pgsql:host=10.1.1.15;port=5432;dbname=zzz;user=xxx;password=yyy');
$stmt = $conn->prepare('SHOW SERVER_ENCODING');
$stmt->execute();
var_dump($stmt->getColumnMeta(0));
?>

Expected result:
----------------
As the documentation says, I would expect the associative array without the 'driver:decl_type' position.

Actual result:
--------------
Crash

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-03-12 00:09 UTC] mauroi at digbang dot com
Forgot to mention: only php_pdo.dll and php_pdo_pgsql.dll are loaded.

Thanks in advance.
 [2006-03-12 00:14 UTC] mauroi at digbang dot com
Sorry for the various comments.
I found that if you fetch one row before executing getColumnMeta, everything works fine.
 [2006-03-14 12:23 UTC] edink@php.net
Just tried current snap, 5.1.3-dev and your example works fine so I guess the problem has been fixed in the meanwhile. The output I get is:

array(6) {
  ["pgsql:oid"]=>
  int(25)
  ["native_type"]=>
  string(4) "text"
  ["name"]=>
  string(15) "server_encoding"
  ["len"]=>
  int(-1)
  ["precision"]=>
  int(-1)
  ["pdo_type"]=>
  int(2)
}
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun May 11 17:01:27 2025 UTC