Issue Details (XML | Word | Printable)

Key: ODBC-112
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Potapchenko
Reporter: Martin J. Evans
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
ODBC Driver

SQL_TYPE_TIMESTAMP columns reported as display size of 24 but then the driver returns 29 characters

Created: 06/Mar/11 04:17 PM   Updated: 03/Jun/11 07:49 PM
Component/s: None
Affects Version/s: 2.0
Fix Version/s: 2.0

Firebird ODBC driver version 02.00.0150
Linux Ubuntu 10.10
Perl 5.10.1
Perl DBI 1.616
Perl DBD::ODBC 1.27
Issue Links:

 Description  « Hide
If you create a timestamp column and call SQLDescribeCol the display size is returned as 24 but the driver can return 29 characters for some dates:

1998-05-15 00:01:00.100000000

The tests in DBD::ODBC fail because DBD::ODBC believes that 24 and bind with a column length of 25 but then they get data truncation error. I had to work around the problem in DBD::ODBC by adding the following to dbdimp.c:

        /* Workaround bug in Firebird driver that reports timestamps are
           display size 24 when in fact it can return the longer
           e.g., 1998-05-15 00:01:00.100000000 */
        if ((imp_dbh->driver_type == DT_FIREBIRD) &&
            (fbh->ColSqlType == SQL_TYPE_TIMESTAMP)) {
            fbh->ColDisplaySize = 30;

which you can find in the subversion trunk for DBD::ODBC.

The display size should be set to 29 or you should not be returning all those digits for the fractional seconds - I cannot say which as I don't really know Firebird.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.