From caf9d390356adb00ca6e8f23c6b0bce416ffa905 Mon Sep 17 00:00:00 2001 From: currantw Date: Mon, 18 Nov 2024 18:20:08 -0800 Subject: [PATCH] Add constant for OpenSearch distribution. Signed-off-by: currantw --- src/sqlodbc/opensearch_communication.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sqlodbc/opensearch_communication.cpp b/src/sqlodbc/opensearch_communication.cpp index b509dbb..562b3bf 100644 --- a/src/sqlodbc/opensearch_communication.cpp +++ b/src/sqlodbc/opensearch_communication.cpp @@ -27,6 +27,8 @@ static const std::string CREDENTIALS_PROFILE = "opensearchodbc"; static const std::string CREDENTIALS_PROVIDER_ALLOCATION_TAG = "CREDENTIAL_PROVIDER"; +static const std::string DISTRIBUTION_OPENSEARCH = "opensearch"; + static const std::string ctype = "application/json"; static const std::string ERROR_MSG_PREFIX = "[OpenSearch][SQL ODBC Driver][SQL Plugin] "; @@ -1090,7 +1092,7 @@ void OpenSearchCommunication::SetSqlEndpoint() { std::string distribution = GetServerDistribution(); if (distribution.empty()) { sql_endpoint = SQL_ENDPOINT_ERROR; - } else if (distribution == "opensearch") { + } else if (distribution == DISTRIBUTION_OPENSEARCH) { sql_endpoint = SQL_ENDPOINT_OPENSEARCH; } else { sql_endpoint = SQL_ENDPOINT_ELASTICSEARCH;