[freetds] SQLPrepare() can't arrange error infomationwhenDBshutdown occured after SQLConnect()

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Mon Jun 19 11:17:18 EDT 2006


...
> 
> I can confirm the problem... added a prepclose test
> 
>
http://freetds.cvs.sourceforge.net/freetds/freetds/src/odbc/unittests/pr
epclose.c?revision=1.1
> 
> the problem is that tds_submit_prepare returns error but do not set
any
> error. I think that correct bahavior would be to use tds_client_msg in
> (or near) tds_close_socket.
> 

Well... more on this... the problem is that odbc do not detect error
correctly. tds_submit_prepare detect connection close and call correctly
tds_client_msg as it should however odbc odbc_errmsg_handler is not able
to add error to statement cause dbc->current_statement is not set. An
easy fix would be to set current_statement before tds_submit_prepare
however this would require test of libTDS state which should be a libTDS
job... IMO a better fix would be to have the possibility to lock
connection but this would also require some sort of unlock with all
problems that brings... while unlocking can be done using a libTDS
callback and no additional data locking would require addition data (for
instance to specify statement on odbc)...

freddy77




More information about the FreeTDS mailing list