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

ZIGLIO, Frediano, VF-IT Frediano.Ziglio at vodafone.com
Tue Jun 13 08:58:30 EDT 2006


> > 
> > ---contents of prepare.php---
> > $conn = odbc_connect('FreeTDS','sqlr','sqlr');
> > $query = 'select 1;';
> > sleep (10) ;
> > # shutdown database
> > $s = @odbc_prepare($conn,$query); # odbc_do in do.php
> > echo "----------------\n";
> > if($e=odbc_error())
> > {
> >         echo "state = $e\n";
> >         echo "msg = ".odbc_errormsg($conn)."\n";
> > }
> > ----------------------------------------
> > 
> > I could find the patch file mentioned above in the mailing 
> > list archive .
> >  It might be more convenient  if patch files reside with 
> > source tarballs at
> > FTP site.
> > 
> 
> Currently you can find patch at 
> http://freetds.sourceforge.net/ (post 0.63 patch)
> In this case there is a sligth difference between what patch 
> fix and what you want. The patch catch error that server 
> returns preparing statement while the broken connection error 
> is not sended by server but detected by library. I don't know 
> if 0.63 or 0.64 can handle this situation... I'll try to 
> reproduce the problem...
> 

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.

freddy77




More information about the FreeTDS mailing list