Issue Details (XML | Word | Printable)

Key: ODBC-180
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Potapchenko
Reporter: Jojakim Stahl
Votes: 0
Watchers: 0
Operations

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

Character set conversion errors in SQLGetData when reading BLOB SUB_TYPE 1

Created: 03/Nov/14 11:28 AM   Updated: 18/Jul/17 11:04 AM
Component/s: None
Affects Version/s: 2.0.2
Fix Version/s: 2.0.5, 2.1 Beta

File Attachments: 1. Text File bug-180.patch (6 kB)

Environment: Win32,Fb2.5


 Description  « Hide
When reading a charachter type BLOB as LONG(W)VARCHAR, no/wrong charset conversion is performed.
When char BLOB is bound to SQL_C_WCHAR, mbstowcs conversion cannot be applied to each chuck returned from the DB seperately, but must be done in advance for the complete BLOB. Imagine i.e. a 3-byte UTF8 sequence cut split over 2 chunks. Impossible to convert correctly, therefore need to convert all at once in advance.


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jojakim Stahl added a comment - 03/Nov/14 11:36 AM
Uploaded patch resolving the issue.

The implementation could be enhanced further regarding memory usage by searching correct chucking points and garding unconverted left over bytes of the chunk for the next retrieval. but this would involve some additional logic in the conversion function which is not implemented yet. Therefore I left with fetching the complete BLOB and conversion in advance.

Alexander Potapchenko added a comment - 02/Jan/17 01:20 PM
Fixed in CVS