issue-#49 fixes in SqlOdbc/3

Post Reply
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

issue-#49 fixes in SqlOdbc/3

Post by Josef Templ »

This issue is about necessary fixes in the ODBC drivers SqlOdbc and SqlOdbc3.
Since both drivers need the same kind of fixes, they are combined within a single issue.

The fixes are subtle and only relevant for users of SQL databases, which seems to be a minority
because otherwise the issue would have been raised much earlier.
I am about to prepare the changes for this issue as proposed in CPC 1.7 rc5.

- Josef
User avatar
Josef Templ
Posts: 2047
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#49 fixes in SqlOdbc/3

Post by Josef Templ »

The changes as proposed in CPC 1.7 rc5 are now in topic branch issue-#49.

For the diffs see http://redmine.blackboxframework.org/pr ... 34d7033c50.

The changes can be summarized as follows:
1. ReadString/ReadVarString use SQL wide chars for supporting both ASCII and Unicode strings.
However, the buffer size passed to the ODBC read function must be specified in bytes, i.e. number of characters * SIZE(CHAR).

2. when reading a truncated string in ReadString it is required to read sequentially until the end of the string
in order to release an internal lock set by ODBC. This lock prevents any further ODBC operation except
reading until the end of the string.

- Josef
Post Reply