Two minor patches
Posted: 22.03.2021, 17:28
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.
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.