php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36128 Interbase PDO
Submitted: 2006-01-23 02:21 UTC Modified: 2007-10-30 22:35 UTC
Votes:5
Avg. Score:4.6 ± 0.5
Reproduced:5 of 5 (100.0%)
Same Version:2 (40.0%)
Same OS:3 (60.0%)
From: michael at bluemoon dot com Assigned:
Status: Closed Package: PDO related
PHP Version: 5.1.2 OS: Linux/Windows
Private report: No CVE-ID: None
 [2006-01-23 02:21 UTC] michael at bluemoon dot com
Description:
------------
Exception thrown when issuing SELECT query using PDO driver 
for Firebird/Interbase. Database Server runs Interbase 7.5.x 
(Linux).

Problem occurs with PHP 5.1.2 running in both Linux/Apache 2 
and Windows 2000/IIS environments.

Tried running PHP alternately with Interbase 6 and 7.5 Run-
time Client Libraries on each platform; same problem.

Native PHP Firebird/Interbase functions (e.g., ibase_connect
(), etc.) functions work fine in same environments used to 
test PDO functions.

Confirmed DSN string used in my PDO connection function is 
correct by testing PDO::ATTR_CONNECTION_STATUS attribute; 
value returned is 1.

Reproduce code:
---------------
try {
  $dbh = new PDO($dsn, $user, $password, array(
    PDO::ATTR_PERSISTENT => true
  ));

  $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

  $stmt = $dbh->prepare("SELECT Count(*) FROM MY_TABLE");
  $stmt->execute();

  $row = $stmt->fetch(PDO::FETCH_NUM);

  $stmt = null;

  echo $row[0];
}
catch (PDOException $e) {
  die $e->getMessage();
}

Expected result:
----------------
Should output integer value result from SELECT query to screen

Actual result:
--------------
Outputs the following error:

SQLSTATE[HY000]: General error: -804 Dynamic SQL Error SQL 
error code = -804 Incorrect values within SQLDA structure

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-23 10:51 UTC] sniper@php.net
Assigned to the maintainer.
 [2006-01-25 17:08 UTC] michael at bluemoon dot com
To amend my earlier problem description, it appears that I CAN issue the SELECT query shown in my previous example successfully.  However, it appears that I cannot retrieve values from TIMESTAMP-type columns.

If I substitute "SELECT MY_TIMESTAMP_FIELD FROM MY_TABLE" for the query in my original code, it will execute without throwing an exception, but the value returned is empty (null).  The result I am expecting is an integer (Unix timestamp) value.

I don't know if this constitutes a 'bug' or if I am simply not going about this the right way.  I have tried many of the various permutations for fetching results as shown in the PDO documentation, but nothing seems to work.

Is there a way to fetch TIMESTAMP values using the Firebird/Interbase PDO driver?
 [2006-04-09 07:48 UTC] wez@php.net
Looking for a firebird maintainer.
 [2007-10-30 22:35 UTC] lwe@php.net
Fixed in PHP_5_3 branch
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Dec 07 22:01:24 2019 UTC