Two minor patches

Code patches written by our users to solve certain "problems" that were not solved, yet.

Moderators: gto, cipto_kh, EgonHugeist, mdaems

Post Reply
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 786
Joined: 18.11.2018, 17:37
Location: Hungary

Two minor patches

Post by aehimself »

Hello,

I sent two minor patches on GitHub as separate commits as the second one can affect all connections so it's easier to revert if something is wrong.

1, Unsupported ping should not cause disconnect!
This is kind of self-explanatory: if a .Ping operation is not supported by a specific driver, the connection must remain connected.

2, Fix SQL versioning (15.0.2000 -> 15.2.0)
When I connected to a SQL Server 2019 database it reported 15.0.2000 as it's version number. There were two issues here:
- ZDbcDBLib assembled the version by itself (and wrongly, I might add) in SQLServerProductToHostVersion, not by using the generic method EncodeSQLVersioning
- since we multiplied minor version by 100, subversion 2000 became minor version 2, causing ZConnection.ServerVersionStr to return 15.2.0

As long as a library is using the generic methods to encode and decode the version number, all is fine. Problems can arise if one is not using these methods... those should be re-written to do so anyway. According to my quick search MySQL, Oracle, SQLIte, PostgreSQL, Interbase (and now DBLib -> MSSQL) is using this so I'm not that worried.
Delphi 12.1, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmariadb.dll 3.3.8
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.13
- MSSQL 2012, 2019; sybdb.dll FreeTDS_2435
- SQLite 3.45.2
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1935
Joined: 17.01.2011, 14:17

Re: Two minor patches

Post by marsupilami »

I applied the patches to trunk. If they don't raise any problems, I will merge them to 8.0-patches.
Thank you and best regards,

Jan
Post Reply