|  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
Avg. Score:4.8 ± 0.6
Reproduced:10 of 10 (100.0%)
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
Have you experienced this issue?
Rate the importance of this bug to you:

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


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
>                                       || dtype == SQLT_TIMESTAMP_LTZ
> #endif


Add a Patch

Pull Requests

Add a Pull Request


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
>                     || dtype == SQLT_TIMESTAMP_LTZ
> #endif
 [2006-04-06 07:27 UTC]
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:

    $dbh = new PDO('oci:', 'username', 'hello');
    $dbh->setAttribute(PDO::ATTR_CASE, PDO::CASE_LOWER);
    $sth = $dbh->prepare('select aa from ltz_test');
    $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]
-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]
-Package: OCI8 related +Package: PDO related
 [2014-01-02 13:38 UTC]
-Package: PDO related +Package: PDO OCI
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sun Aug 14 10:05:44 2022 UTC