DBLib .ClientVersion
Posted: 14.12.2021, 15:51
Hello,
As it turns out, dblib exports a function called "dbversion" which returns the client engine version in use as a string. I managed to implement it to Zeos, so now for example "freetds v1.4.dev.20211204" properly returns "1.4" if we call ZConnection.ClientVersionStr.
As FreeTDS is being used for other than MSSQL I'm a bit hesitant to send it as a patch, plus I have no idea if all FreeTDS editions will actually return their version in this format...?
In theory I safeguarded it with a string start check, otherwise I simply return 0 so it should be fine, but...
I'm also sure that performance wise my implementation is suboptimal - PAnsiChars can be accessed with pointer magic which I'm not experienced with.
What do you guys think? Just send it and we'll adjust based on the long run?
As it turns out, dblib exports a function called "dbversion" which returns the client engine version in use as a string. I managed to implement it to Zeos, so now for example "freetds v1.4.dev.20211204" properly returns "1.4" if we call ZConnection.ClientVersionStr.
As FreeTDS is being used for other than MSSQL I'm a bit hesitant to send it as a patch, plus I have no idea if all FreeTDS editions will actually return their version in this format...?
In theory I safeguarded it with a string start check, otherwise I simply return 0 so it should be fine, but...
I'm also sure that performance wise my implementation is suboptimal - PAnsiChars can be accessed with pointer magic which I'm not experienced with.
What do you guys think? Just send it and we'll adjust based on the long run?