php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #34211 PDO_OCI: Allow for data type "TIMESTAMP(0) WITH LOCAL TIME ZONE"
Submitted: 2005-08-22 19:11 UTC Modified: 2014-01-02 13:38 UTC
Votes:12
Avg. Score:4.5 ± 1.2
Reproduced:10 of 11 (90.9%)
Same Version:3 (30.0%)
Same OS:7 (70.0%)
From: kurtb149 at yahoo dot com Assigned:
Status: Open Package: PDO OCI
PHP Version: 5.3.5 OS: Linux
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: kurtb149 at yahoo dot com
New email:
PHP Version: OS:

 

 [2005-08-22 19:11 UTC] kurtb149 at yahoo dot com
Description:
------------
In the file:

   ext/pdo_oci/oci_statement.c

the function oci_stmt_describe() does not allow for the 
data type "TIMESTAMP(0) WITH LOCAL TIME ZONE". Here is the diff of an updated oci_statement.c that would allow for the data type:

$ cvs diff oci_statement.c 
Index: oci_statement.c
===================================================================
RCS file: /repository/php-src/ext/pdo_oci/oci_statement.c,v
retrieving revision 1.16
diff -r1.16 oci_statement.c
407a408,410
> #ifdef SQLT_TIMESTAMP_LTZ
>                                       || dtype == SQLT_TIMESTAMP_LTZ
> #endif



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-05 23:32 UTC] kurtb149 at yahoo dot com
$ cvs diff oci_statement.c
Index: oci_statement.c
===================================================================
RCS file: /repository/php-src/ext/pdo_oci/oci_statement.c,v
retrieving revision 1.20
diff -r1.20 oci_statement.c
420a421,424
> #ifdef SQLT_TIMESTAMP_LTZ
>                     || dtype == SQLT_TIMESTAMP_LTZ
> #endif
>
 [2006-04-06 07:27 UTC] tony2001@php.net
Thanks for posting the patch again.
Actually I asked you to provide a small piece of PHP code I can use to test the problem you are trying to fix.
 [2006-06-09 15:24 UTC] kurtb149 at yahoo dot com
1. Create a table in Oracle that used the "timestamp(0) with local time zone" type:

   SQL> create table ltz_test(aa timestamp(0) with local time zone not null) ;

2. Insert a row into ltz_test:

   SQL> insert into ltz_test values(current_timestamp);

3. Using PDO, read the table:

<?php
    $dbh = new PDO('oci:', 'username', 'hello');
    $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
    $sth = $dbh->prepare('select aa from ltz_test');
    $sth->execute();
    $r = $sth->fetch();
    print $r[0] . "\n";
?>

The following error is produced:

Warning: PDOStatement::fetch(): column 0 data was too large for buffer and was truncated to fit it in ltz_test.php on line 7
 [2011-01-13 23:25 UTC] kurtb149 at yahoo dot com
This is still broken in php version 5.3.5; The fix is a really simple patch. The oci8 even has the fix, but the pdo_oci still does not.
 [2011-04-08 21:42 UTC] jani@php.net
-Package: Feature/Change Request +Package: OCI8 related -PHP Version: 6CVS-2005-08-22 (CVS) +PHP Version: 5.3.5
 [2011-11-07 23:29 UTC] sixd@php.net
-Package: OCI8 related +Package: PDO related
 [2014-01-02 13:38 UTC] felipe@php.net
-Package: PDO related +Package: PDO OCI
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 23 13:01:29 2024 UTC