Changeset: cfe614db1c43 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/cfe614db1c43
Modified Files:
clients/odbc/driver/ODBCUtil.c
clients/odbc/driver/SQLConnect.c
clients/odbc/driver/SQLExecDirect.c
clients/odbc/driver/SQLExecute.c
Branch: default
Log Message:
Correct ODBC driver for version specific code. major version is now 56 instead
of 11.
diffs (48 lines):
diff --git a/clients/odbc/driver/ODBCUtil.c b/clients/odbc/driver/ODBCUtil.c
--- a/clients/odbc/driver/ODBCUtil.c
+++ b/clients/odbc/driver/ODBCUtil.c
@@ -1232,7 +1232,7 @@ ODBCParsePV(const char *tab, const char
res[i++] = *s;
}
/* raw strings prefix syntax is only supported by servers since Jun2020
(11.37) */
- if (dbc->major == 11 && dbc->minor >= 37) {
+ if ((dbc->major >= 56) || (dbc->major == 11 && dbc->minor >= 37)){
s = "' escape r'\\'";
} else {
s = "' escape '\\\\'";
diff --git a/clients/odbc/driver/SQLConnect.c b/clients/odbc/driver/SQLConnect.c
--- a/clients/odbc/driver/SQLConnect.c
+++ b/clients/odbc/driver/SQLConnect.c
@@ -73,7 +73,7 @@ get_serverinfo(ODBCDbc *dbc)
goto end;
/* table sys.comments should exist since Mar2018 (11.29) */
- if (dbc->major == 11 && dbc->minor > 29) {
+ if ((dbc->major >= 56) || (dbc->major == 11 && dbc->minor > 29)) {
dbc->has_comment = true;
} else {
mapi_close_handle(hdl);
diff --git a/clients/odbc/driver/SQLExecDirect.c
b/clients/odbc/driver/SQLExecDirect.c
--- a/clients/odbc/driver/SQLExecDirect.c
+++ b/clients/odbc/driver/SQLExecDirect.c
@@ -52,7 +52,7 @@ ODBCExecDirect(ODBCStmt *stmt, const SQL
if (stmt->qtimeout != stmt->Dbc->qtimeout) {
char buf[48];
snprintf(buf, sizeof(buf), "call sys.%s(%" PRIu64 ")",
- (stmt->Dbc->major == 11 && stmt->Dbc->minor >= 37)
+ ((stmt->Dbc->major >= 56) || (stmt->Dbc->major == 11
&& stmt->Dbc->minor >= 37))
? "setquerytimeout" : "settimeout",
(uint64_t) stmt->qtimeout);
if (mapi_query_handle(hdl, buf) == MOK)
diff --git a/clients/odbc/driver/SQLExecute.c b/clients/odbc/driver/SQLExecute.c
--- a/clients/odbc/driver/SQLExecute.c
+++ b/clients/odbc/driver/SQLExecute.c
@@ -480,7 +480,7 @@ MNDBExecute(ODBCStmt *stmt)
}
if (stmt->qtimeout != stmt->Dbc->qtimeout) {
snprintf(query, querylen, "call sys.%s(%" PRIu64 ")",
- (stmt->Dbc->major == 11 && stmt->Dbc->minor >= 37)
+ ((stmt->Dbc->major >= 56) || (stmt->Dbc->major == 11
&& stmt->Dbc->minor >= 37))
? "setquerytimeout" : "settimeout",
(uint64_t) stmt->qtimeout);
if (mapi_query_handle(hdl, query) == MOK)
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]