Issue Details (XML | Word | Printable)

Key: CORE-2066
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Adriano dos Santos Fernandes
Reporter: Kovalenko Dmitry
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Conversion of SQL_TEXT / SQL_VARCHAR to SQL_TIMESTAMP / SQL_TYPE_TIME / SQL_TYPE_DATE

Created: 05/Sep/08 05:13 AM   Updated: 08/Nov/09 07:40 PM
Component/s: Engine
Affects Version/s: 2.0.0, 2.0.1, 2.0.2, 2.0.3, 2.5 Initial, 2.1.0, 2.0.4, 2.5 Alpha 1, 2.1.1
Fix Version/s: 2.5 Beta 1

Time Tracking:
Not Specified

File Attachments: 1. File fb_link_tests.rar (292 kB)


Planning Status: Unspecified


 Description  « Hide
Hi

I made some tests for isc_dsql_fetch and obtained the next problems

1. Column: COL_VARCHAR_32 VARCHAR(32) with string "2008-02-23 3:4:5.6789"
2. SQL: "select COL_VARCHAR_32 from <table>
3. Client Dialect == 3 [used at prepare stage]
4. Define XSQLVAR for get this value as SQL_TIMESTAMP datatype. Server should do a transformation of VARCHAR to TIMESTAMP

Get error:
Dynamic SQL Error
SQL error code = -303
arithmetic exception, numeric overflow, or string truncation

But, I can get a SQL_TIMESTAMP columns as SQL_VARYING

---
SQL: "select CAST(COL_VARCHAR_32 as TIMESTAMP) from <table>" works very good :-)

 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriano dos Santos Fernandes added a comment - 08/Sep/08 11:27 AM
Can you prepare a test-case?

Thanks.

Kovalenko Dmitry added a comment - 08/Sep/08 12:54 PM
No problem. See attach file

Binary maded in VS2005 SP1 (release 32-bit).

GDB - FB 2.1.1

Correct at BAT-file the path to fbclient.dll and path to test database

Execute from command line:

release_test_fbclient.BAT isc_stmt.011.select.VARCHAR.TIMESTAMP
release_test_fbclient.BAT isc_stmt.011.select.VARCHAR.TYPE_TIME
release_test_fbclient.BAT isc_stmt.011.select.VARCHAR.TYPE_DATE

or
release_test_fbclient.BAT isc_stmt.011.select.VARCHAR.*

Regards
Dmitry Kovalenko
www.ibprovider.com

Adriano dos Santos Fernandes added a comment - 08/Sep/08 01:18 PM
Can you confirm a thing?

Does the error occur when fetch are going to return no more data?

If not, can you test with embedded and verify same thing?

Kovalenko Dmitry added a comment - 08/Sep/08 01:56 PM
Sorry, I don't understand your question

>Does the error occur when fetch are going to return no more data?

Abstract:
- First fetch of EOF should return 100L
- Second fetch of EOF _can_ (must?) return "sync error"

----
In my test [ ...VARCHAR.TIMESTAMP] :
- First fetch should return data. ( But I get the error )
- Second fetch should return 100L

----
I run "isc_stmt.011.select.VARCHAR.TIMESTAMP" with embedded 2.1.0.17798 and get same error

[08.09.2008 19:55:10] ERROR: [isc.stmt|isc_stmt.011.select.VARCHAR.TIMESTAMP] Fetch Statement
Dynamic SQL Error
SQL error code = -303
arithmetic exception, numeric overflow, or string truncation