Skip to Content.
Sympa Menu

freetds - Re: Doesn't handle TDS_DONEINPROC packets correctly (known bug)

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Mark Schaal <mark AT champ.tstonramp.com>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Re: Doesn't handle TDS_DONEINPROC packets correctly (known bug)
  • Date: Wed, 21 Jun 2000 16:14:36 -0700 (PDT)


>
> Try t0032.java in the unittests directory under the CVS root. It
> gives me the following results when I run it:
>
[...]
> com.internetcds.jdbc.tds.ResultSet_base.next(ResultSet_base.java:1523)
> at t0032.main(t0032.java:41)

Oops, I thought you were having trouble with the C freetds which is
what I work with. However, Java is just C with OO, right? Can't be
that hard to figure out...

freetds pretty much treats DONEINPROC as just another end token, but
freetds_jdbc apparently doesn't. Brian has said that he thinks there
was a case where the DONEINPROC needed to be treated differently, but
wasn't able to remember details. In practice it seems to me that
DONEINPROC does need to be treated as an end token, see my trace
of an 'sp_help' query below:

TDS Query 'sp_help'
TDS Response -- Column Names (0xA0)
TDS Response -- Column Info (0xA1)
TDS Response -- Order By (0xA9)
TDS Response -- Row (0xD1)
TDS Response -- Row (0xD1)
(repeats....)
TDS Response -- Row (0xD1)
TDS Response -- Row (0xD1)
TDS Response -- Done in Process (0xFF) *** not treated as end... ***
TDS Response -- Message (0xAB)
TDS Response -- Column Names (0xA0) *** freetds_jdbc go boom ***
TDS Response -- Column Info (0xA1)
TDS Response -- Order By (0xA9)
TDS Response -- Done in Process (0xFF)
TDS Response -- Return Status (0x79)
TDS Response -- Process Done (0xFE)

I don't work on the jdbc version, but if I were to play with it
I would change the ResultSet_base.next function adding !tds.isDoneInProc()
to the while conditional:
while (!tds.isResultSet() &&
!tds.isEndOfResults() &&
!tds.isResultRow())
{
and then after the while block I would add an
else if (tds.isDoneInProc())
section that mimics the
else if (tds.isEndOfResults())
section as nearly as possible.

Alternatively you could modify tds.isEndOfResults() to accept
DONEINPROC and modify processSubPacket() to treat DONE and DONEINPROC
alike. That's a more global change which might be worse. Or better.

Sorry I can't solve your problem but that should provide a bit
to work with.

Mark
--
Mark J. Schaal Phone: (909) 620-7724
TST On Ramp Fax: (909) 620-8174
System Administrator E-Mail: mark AT tstonramp.com



  • Re: Doesn't handle TDS_DONEINPROC packets correctly (known bug), Mark Schaal, 06/21/2000

Archive powered by MHonArc 2.6.24.

Top of Page