FreeTDS/freetds

release 1.x and @@spid

Closed this issue · 7 comments

Hi:

I've been happily running freetds now for many years vs a product embedded sybase a like database (ibm's netcool omnibus if anyone cares).

With the recent release of freetds 1.x, however, code was added to login.c:tds_connect() to fetch @@spid. Unfortunately my vendor embedded db doesn't support this, and my connections all error and cannot be completed.

Short of maintaining a private fork where I excise this code, or backrevving to to older, working versions of freetds, is there a way to turn this additional @@spid query off? Are there other side effects if I do so?

Thanks,
-- Pat

Not too difficult to fix, expect a 1.00.110 version package for tomorrow!

Thanks for the quick response. I just cloned from github this morning, and recompiled. sadly, I'm still getting this error on connect:

"ERROR=Parse failure on line 1 of statement 'select @@spid ', at or near '@'"

Thoughts? Would you accept a patch (to ignore an error when sending this statement) if I were to create one?

Thanks,
-- Pat

Oh, I think just a message from the server.
Can you send TDSDUMP logs?
I'm already trying a patch to ignore the specific error, not sure if your server is fine with it

Mea culpia ! I screwed up. Sorry. While I had compiled the new version, I hadn't gotten my test client (sqsh) to properly use it. I was still using the debian provided library.

Once I properly force sqsh to use the latest git repo, it does connect. It still prints an error message, but doesn't effect it's operation at all:

pjs11@patslinux01 Desktop $ TDSDUMP=./tdsdump.log sqsh -m csv -S omnibus1-dev -U PJS11
sqsh-2.1.7 Copyright (C) 1995-2001 Scott C. Gray
Portions Copyright (C) 2004-2010 Michael Peppler
This is free software with ABSOLUTELY NO WARRANTY
For more information type '\warranty'
Password:
ERROR=Parse failure on line 1 of statement 'select @@spid ', at or near '@'
1> select top 2 * from alerts.status
2> \go
Identifier,Serial,Node,NodeAlias,Manager,Agent,AlertGroup,AlertKey,Severity,Summary,StateChange,FirstOccurrence,LastOccurrence,InternalLast,Poll,Type,Tally,Class,Grade,Location,OwnerUID,OwnerGID,Acknowledged,Flash,EventId,ExpireTime,ProcessReq,SuppressEscl,Customer,Service,PhysicalSlot,PhysicalPort,PhysicalCard,TaskList,NmosSerial,NmosObjInst,NmosCauseType,NmosDomainName,NmosEntityId,Nmos
(...)

Again, thank you for your response, and sorry for my confusion.

-- Pat

Solved

tiny_tds unfortunately cannot handle the error resulting from SELECT @@spid

@uthornbl a comment on a year old ticket about a similar issue is really useless