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?
DBLib .ClientVersion
Moderators: gto, cipto_kh, EgonHugeist, mdaems
DBLib .ClientVersion
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: DBLib .ClientVersion
Done, pull request is created on GitHub.
I copied the loading implementation of an other function but DBLib seems to be a mess from this perspective (what is the purpose of the _stdcall functions if we never assign them...?!) so I only can hope I did it right.
Just review before applying it, please :)
I copied the loading implementation of an other function but DBLib seems to be a mess from this perspective (what is the purpose of the _stdcall functions if we never assign them...?!) so I only can hope I did it right.
Just review before applying it, please :)
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
-
- Platinum Boarder
- Posts: 1956
- Joined: 17.01.2011, 14:17
Re: DBLib .ClientVersion
I applied the patch - without a review. Let's see what happens. I will have a look at the stdcall thing.