[freetds] DBOPTION structure now private
James K. Lowden
jklowden at freetds.org
Sat Jan 20 15:42:26 EST 2007
I moved the DBOPTION structure out of sybdb.h, removed the unused members,
removed the "opt" prefix from the members, and removed the bogus freeing
function that would rely on the optnext pointer if in fact we had a linked
list. (We don't; we use an array of 36 members, now at least 36 * 6 bytes
smaller with most compilers.)
Checking Sybase's sybdb.h, I see it *is* defined there, with this comment:
** DBOPTION - This structure is used to store the current dataserver
** options. This will be used if TDS version is less than 5.0.
Well, TDS 5.0 was introduced over 10 years ago. I don't mind supporting
the TDS 4.2 protocol, but I have difficulty believing there's much code
out there that relies on this structure being public, because the optnext
pointer and optstatus are useless in FreeTDS. Any code that thinks it's
traversing the DBOPTION linked list is broken, and changing that code to
use dbsetopt, dbclropt, and dbisopt is straightforward.
I imagine Sybase actually uses optnext and knows what optstatus means, and
probably has code written to use them, so I can understand why they'd
leave the structure in sybdb.h.
If you have working code that uses this structure in such a way that my
removal of it causes you pain, I would be interested in hearing about it.
I figure I'm not causing too much pain, because of course you can put it
back yourself. But if you have a lot of company, I should probably
restore it in the main tree.
More information about the FreeTDS