Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL_TYPE_TIMESTAMP columns reported as display size of 24 but then the driver returns 29 characters [ODBC112] #109

Closed
firebird-automations opened this issue Mar 6, 2011 · 3 comments

Comments

@firebird-automations
Copy link

Submitted by: Martin J. Evans (bohica)

Is duplicated by ODBC83

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.

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

Link: This issue is duplicated by ODBC83 [ ODBC83 ]

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Fixed [ 1 ]

Fix Version: 2.0 [ 10044 ]

@firebird-automations
Copy link
Author

Modified by: @alexpotapchenko

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants