From 0820b359b0be9f8556fb706d9728c610ba3be1d9 Mon Sep 17 00:00:00 2001 From: currantw Date: Fri, 15 Nov 2024 10:17:51 -0800 Subject: [PATCH] Fix small errors Signed-off-by: currantw --- src/sqlodbc/dlg_specific.c | 2 +- src/sqlodbc/dlg_specific.h | 2 +- src/sqlodbc/opensearch_communication.cpp | 2 +- src/sqlodbc/opensearch_odbc.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sqlodbc/dlg_specific.c b/src/sqlodbc/dlg_specific.c index ad0006d..ea9b37f 100644 --- a/src/sqlodbc/dlg_specific.c +++ b/src/sqlodbc/dlg_specific.c @@ -68,7 +68,7 @@ void makeConnectString(char *connect_string, const ConnInfo *ci, UWORD len) { ci->authtype, ci->region, ci->tunnel_host, - (int)ci->is_serverless, + ci->is_serverless, (int)ci->use_ssl, (int)ci->verify_server, (int)ci->drivers.loglevel, diff --git a/src/sqlodbc/dlg_specific.h b/src/sqlodbc/dlg_specific.h index 1321745..99acf0e 100644 --- a/src/sqlodbc/dlg_specific.h +++ b/src/sqlodbc/dlg_specific.h @@ -65,7 +65,7 @@ extern "C" { #define DEFAULT_DESC "" #define DEFAULT_DSN "" #define DEFAULT_VERIFY_SERVER 1 -#define DEFAULT_IS_SERVERLESS "-1" +#define DEFAULT_IS_SERVERLESS "" #define AUTHTYPE_NONE "NONE" #define AUTHTYPE_BASIC "BASIC" diff --git a/src/sqlodbc/opensearch_communication.cpp b/src/sqlodbc/opensearch_communication.cpp index ffe43ea..928efb8 100644 --- a/src/sqlodbc/opensearch_communication.cpp +++ b/src/sqlodbc/opensearch_communication.cpp @@ -1100,7 +1100,7 @@ bool OpenSearchCommunication::isServerless() { // Specified in DSN configuration const std::string& is_serverless = m_rt_opts.conn.is_serverless; - if(is_serverless != DEFAULT_IS_SERVERLESS) { + if(!is_serverless.empty()) { return std::stoi(is_serverless); } diff --git a/src/sqlodbc/opensearch_odbc.h b/src/sqlodbc/opensearch_odbc.h index 48ee0a8..2fb9e48 100644 --- a/src/sqlodbc/opensearch_odbc.h +++ b/src/sqlodbc/opensearch_odbc.h @@ -606,7 +606,7 @@ typedef struct { char port[SMALL_REGISTRY_LEN]; char response_timeout[SMALL_REGISTRY_LEN]; char fetch_size[SMALL_REGISTRY_LEN]; - char is_serverless[SMALL_REGISTRY_LEN];; + char is_serverless[SMALL_REGISTRY_LEN]; // Authentication char authtype[MEDIUM_REGISTRY_LEN];