issue-#49 problems with SqlOdbc3 driver

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

issue-#49 problems with SqlOdbc3 driver

Post by Josef Templ »

Finally, I was able to resolve the ODBC deadlock problem in SqlOdbc and SqlOdbc3 completely!
The previous fix was a best effort (95%) work around but not a 100% fix.

Have a look at the changes at http://redmine.blackboxframework.org/pr ... ae881451b2.

When reading multiple parts of a column (ReadVarString, ReadBlob),
any DB operation must be suppressed until the column has been read completely.
Calling NEW in between can invoke the garbage collector, which in turn can finalize unused tables.
Finalization of tables has therefore been delayed by using an action.

Plus one trivial Optimization: empty and NULL VARCHAR strings reuse a common string object.

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

Re: issue-#49 revisited

Post by Josef Templ »

I fixed a crash with DB servers that have a long server name.
The crash happens in SqlOdbc3 where the name of the database server is obtained.
The string length was passed as 255 but must be LEN(str) * SIZE(CHAR) = 52.
Longer names are truncated automatically.

For the very trivial change see http://redmine.blackboxframework.org/pr ... ype=inline.

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

Re: issue-#49 revisited

Post by Josef Templ »

As the hopefully last update I fixed a bug in SqlOdbc3 with respect to return code noData.
Here is the diff: http://redmine.blackboxframework.org/pr ... e81db21945.

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

Re: issue-#49 revisited

Post by Josef Templ »

can we proceed with this issue?
User avatar
DGDanforth
Posts: 1061
Joined: Tue Sep 17, 2013 1:16 am
Location: Palo Alto, California, USA
Contact:

Re: issue-#49 revisited

Post by DGDanforth »

Just a comment. I know nothing about Sql so will probably abstain from voting on this issue.

Josef, do you want a vote created now?

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

Re: issue-#49 revisited

Post by Josef Templ »

The background of this fix is the following:
I am using my own Sql-odbc driver for my projects but I tried to
synchronize my version with the current SqlOdbc3 module
and thereby I detected this bug. The result code noDate has simply
be forgotten to be handled at some places.

From my point of view it is ready for voting.

- Josef
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#49 problems with SqlOdbc3 driver

Post by Ivan Denisov »

Post Reply