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
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.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 23:01:28 2024 UTC