[freetds] _DB_GETCOLINFO whacked
James K. Lowden
jklowden at freetds.org
Sun Dec 2 13:23:21 EST 2007
I removed the _DB_GETCOLINFO macro, replacing it with a function
dbcolptr(). The macro had gotten too complicated and wasn't all that well
conceived to begin with.
In general I think it's a bad idea for macros to have side effects. This
one required two variables to be declared, so it could assign them, and
contained return statements in case its checks turned up an error. I
didn't think "get column info" suggested "exit if you can't".
The new function calls dbperror() for you and returns the error code, so
the caller can decide what to do next. It takes the address of a
TDSCOLUMN pointer, which is sets. I think it makes what's going on a
little clearer.
--jkl
More information about the FreeTDS
mailing list