New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server version check #84
Conversation
The driver will now report the qualifer in the version string.
- update the defines reporting data source's scalar capabilities.
The server and driver versions will be checked to match. It's thus safe to report own version.
Check if server's and driver's versions are in sync. Refuse connection if they aren't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I left a couple of suggestions but feel free to leave for a followup if you want to merge before feature freeze.
driver/catalogue.c
Outdated
@@ -48,7 +48,7 @@ static SQLRETURN fake_answer(SQLHSTMT hstmt, const char *src, size_t cnt) | |||
{ | |||
char *dup; | |||
|
|||
if (! (dup = strdup(src))) { | |||
if (! (dup = _strdup(src))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This caters to Microsoft’s pedantry, but will make porting to Linux harder. I think an alternative is to /D_CRT_NONSTDC_NO_DEPRECATE
.
driver/connect.c
Outdated
static const wchar_t err_msg_fmt[] = L"Version mismatch between server (" | ||
WPFWP_LDESC ") and driver (" WPFWP_LDESC "). Please use a driver whose" | ||
" version matches that of your server."; | ||
/* 32: max lenght of the version strings for which the explicit message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: lenght
- also fix a comment typo
Thank you for the prompt review! Comments addressed. |
* append version qualifer to version string The driver will now report the qualifer in the version string. * update advertised function caps - update the defines reporting data source's scalar capabilities. * report own version when app is asking for DB ver. The server and driver versions will be checked to match. It's thus safe to report own version. * fix compilation warnings (x86) * check server's version against own Check if server's and driver's versions are in sync. Refuse connection if they aren't. * revert to deprecated strdup, add warning silencer - also fix a comment typo (cherry picked from commit 1c276a5)
This PR adds version checks of version strings.
If Elasticsearch'es version doesn't match own version, the connection is refused.
It also updates the reporting of the scalar functions the data source supports.