diff --git a/src/sqlodbc/dlg_specific.c b/src/sqlodbc/dlg_specific.c index a9bade4..9f96bb1 100644 --- a/src/sqlodbc/dlg_specific.c +++ b/src/sqlodbc/dlg_specific.c @@ -67,7 +67,7 @@ void makeConnectString(char *connect_string, const ConnInfo *ci, UWORD len) { ci->authtype, ci->region, ci->tunnel_host, - ci->is_serverless, + ci->is_aoss_serverless, (int)ci->use_ssl, (int)ci->verify_server, (int)ci->drivers.loglevel, @@ -136,7 +136,7 @@ BOOL copyConnAttributes(ConnInfo *ci, const char *attribute, else if (stricmp(attribute, INI_TUNNEL_HOST) == 0) STRCPY_FIXED(ci->tunnel_host, value); else if (stricmp(attribute, INI_SERVERLESS_OVERRIDE) == 0) - STRCPY_FIXED(ci->is_serverless, value); + STRCPY_FIXED(ci->is_aoss_serverless, value); else if (stricmp(attribute, INI_SSL_USE) == 0) ci->use_ssl = (char)atoi(value); else if (stricmp(attribute, INI_SSL_HOST_VERIFY) == 0) @@ -175,7 +175,7 @@ static void getCiDefaults(ConnInfo *ci) { strncpy(ci->username, DEFAULT_USERNAME, MEDIUM_REGISTRY_LEN); strncpy(ci->region, DEFAULT_REGION, MEDIUM_REGISTRY_LEN); strncpy(ci->tunnel_host, DEFAULT_TUNNEL_HOST, MEDIUM_REGISTRY_LEN); - strncpy(ci->is_serverless, DEFAULT_IS_SERVERLESS, SMALL_REGISTRY_LEN); + strncpy(ci->is_aoss_serverless, DEFAULT_IS_AOSS_SERVERLESS, SMALL_REGISTRY_LEN); ci->use_ssl = DEFAULT_USE_SSL; ci->verify_server = DEFAULT_VERIFY_SERVER; strcpy(ci->drivers.output_dir, "C:\\"); @@ -287,7 +287,7 @@ void getDSNinfo(ConnInfo *ci, const char *configDrvrname) { if (SQLGetPrivateProfileString(DSN, INI_SERVERLESS_OVERRIDE, NULL_STRING, temp, sizeof(temp), ODBC_INI) > 0) - STRCPY_FIXED(ci->is_serverless, temp); + STRCPY_FIXED(ci->is_aoss_serverless, temp); if (SQLGetPrivateProfileString(DSN, INI_SSL_USE, NULL_STRING, temp, sizeof(temp), ODBC_INI) > 0) @@ -343,7 +343,7 @@ void writeDSNinfo(const ConnInfo *ci) { SQLWritePrivateProfileString(DSN, INI_AUTH_MODE, ci->authtype, ODBC_INI); SQLWritePrivateProfileString(DSN, INI_REGION, ci->region, ODBC_INI); SQLWritePrivateProfileString(DSN, INI_TUNNEL_HOST, ci->tunnel_host, ODBC_INI); - SQLWritePrivateProfileString(DSN, INI_SERVERLESS_OVERRIDE, ci->is_serverless, ODBC_INI); + SQLWritePrivateProfileString(DSN, INI_SERVERLESS_OVERRIDE, ci->is_aoss_serverless, ODBC_INI); ITOA_FIXED(temp, ci->use_ssl); SQLWritePrivateProfileString(DSN, INI_SSL_USE, temp, ODBC_INI); ITOA_FIXED(temp, ci->verify_server); @@ -495,7 +495,7 @@ void CC_conninfo_init(ConnInfo *conninfo, UInt4 option) { strncpy(conninfo->username, DEFAULT_USERNAME, MEDIUM_REGISTRY_LEN); strncpy(conninfo->region, DEFAULT_REGION, MEDIUM_REGISTRY_LEN); strncpy(conninfo->tunnel_host, DEFAULT_TUNNEL_HOST, MEDIUM_REGISTRY_LEN); - strncpy(conninfo->is_serverless, DEFAULT_IS_SERVERLESS, SMALL_REGISTRY_LEN); + strncpy(conninfo->is_aoss_serverless, DEFAULT_IS_AOSS_SERVERLESS, SMALL_REGISTRY_LEN); conninfo->use_ssl = DEFAULT_USE_SSL; conninfo->verify_server = DEFAULT_VERIFY_SERVER; @@ -537,7 +537,7 @@ void CC_copy_conninfo(ConnInfo *ci, const ConnInfo *sci) { CORR_STRCPY(authtype); CORR_STRCPY(region); CORR_STRCPY(tunnel_host); - CORR_STRCPY(is_serverless); + CORR_STRCPY(is_aoss_serverless); NAME_TO_NAME(ci->password, sci->password); CORR_VALCPY(use_ssl); CORR_VALCPY(verify_server); diff --git a/src/sqlodbc/dlg_specific.h b/src/sqlodbc/dlg_specific.h index ff998f9..aca357e 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 "" +#define DEFAULT_IS_AOSS_SERVERLESS "" #define AUTHTYPE_NONE "NONE" #define AUTHTYPE_BASIC "BASIC" diff --git a/src/sqlodbc/opensearch_communication.cpp b/src/sqlodbc/opensearch_communication.cpp index 562b3bf..28199da 100644 --- a/src/sqlodbc/opensearch_communication.cpp +++ b/src/sqlodbc/opensearch_communication.cpp @@ -21,7 +21,7 @@ static const std::string SQL_ENDPOINT_ELASTICSEARCH = "/_opendistro/_sql"; static const std::string SQL_ENDPOINT_ERROR = "Error"; static const std::string SERVICE_NAME_DEFAULT = "es"; -static const std::string SERVICE_NAME_SERVERLESS = "aoss"; +static const std::string SERVICE_NAME_AOSS_SERVERLESS = "aoss"; static const std::string CREDENTIALS_PROFILE = "opensearchodbc"; static const std::string CREDENTIALS_PROVIDER_ALLOCATION_TAG = @@ -462,8 +462,8 @@ OpenSearchCommunication::IssueRequest( CREDENTIALS_PROFILE.c_str()); const std::string& service_name = - is_serverless - ? SERVICE_NAME_SERVERLESS + is_aoss_serverless + ? SERVICE_NAME_AOSS_SERVERLESS : SERVICE_NAME_DEFAULT; Aws::Client::AWSAuthV4Signer signer(credential_provider, @@ -577,7 +577,7 @@ bool OpenSearchCommunication::EstablishConnection() { // Set whether the connection is to OpenSearch serverless cluster. // This can be specified explicitly via a configuration option, or // determined by parsing the server URL. - SetIsServerless(); + SetIsAossServerless(); // Set the SQL endpoint to connect to. If this is a serverless connection, // the SQL endpoint can be determined directly; if not, the endpoint is @@ -585,7 +585,7 @@ bool OpenSearchCommunication::EstablishConnection() { // error. SetSqlEndpoint(); - if (is_serverless && (sql_endpoint == SQL_ENDPOINT_ERROR)) { + if (is_aoss_serverless && (sql_endpoint == SQL_ENDPOINT_ERROR)) { LogMsg(OPENSEARCH_ERROR, m_error_message.c_str()); return false; } @@ -1084,7 +1084,7 @@ std::string OpenSearchCommunication::GetClusterName() { void OpenSearchCommunication::SetSqlEndpoint() { // Serverless Elasticsearch is not supported. - if (is_serverless) { + if (is_aoss_serverless) { sql_endpoint = SQL_ENDPOINT_OPENSEARCH; return; } @@ -1103,15 +1103,15 @@ void OpenSearchCommunication::SetSqlEndpoint() { * @brief Sets flag indicating whether this is * connecting to an OpenSearch Serverless cluster. */ -void OpenSearchCommunication::SetIsServerless() { +void OpenSearchCommunication::SetIsAossServerless() { // If it is not specified in the DSN configuration, // determine whether this is connected to a serverless // cluster by parsing the server URL. - const std::string& is_serverless_config_value = m_rt_opts.conn.is_serverless; + const std::string& is_aoss_serverless_config_value = m_rt_opts.conn.is_aoss_serverless; - is_serverless = - is_serverless_config_value.empty() + is_aoss_serverless = + is_aoss_serverless_config_value.empty() ? (m_rt_opts.conn.server.find("aoss.amazonaws.com") != std::string::npos) - : std::stoi(is_serverless_config_value); + : std::stoi(is_aoss_serverless_config_value); } diff --git a/src/sqlodbc/opensearch_communication.h b/src/sqlodbc/opensearch_communication.h index feff9ec..95e3bcc 100644 --- a/src/sqlodbc/opensearch_communication.h +++ b/src/sqlodbc/opensearch_communication.h @@ -81,7 +81,7 @@ class OpenSearchCommunication { ConnErrorType error_type); void SetErrorDetails(ErrorDetails details); - void SetIsServerless(); + void SetIsAossServerless(); void SetSqlEndpoint(); // TODO #35 - Go through and add error messages on exit conditions @@ -91,7 +91,7 @@ class OpenSearchCommunication { ConnStatusType m_status; ConnErrorType m_error_type; std::shared_ptr< ErrorDetails > m_error_details; - bool is_serverless; + bool is_aoss_serverless; bool m_valid_connection_options; bool m_is_retrieving; OpenSearchResultQueue m_result_queue; diff --git a/src/sqlodbc/opensearch_connection.cpp b/src/sqlodbc/opensearch_connection.cpp index 00ab72f..5c08f36 100644 --- a/src/sqlodbc/opensearch_connection.cpp +++ b/src/sqlodbc/opensearch_connection.cpp @@ -117,7 +117,7 @@ int LIBOPENSEARCH_connect(ConnectionClass *self) { } rt_opts.conn.port.assign(self->connInfo.port); rt_opts.conn.timeout.assign(self->connInfo.response_timeout); - rt_opts.conn.is_serverless.assign(self->connInfo.is_serverless); + rt_opts.conn.is_aoss_serverless.assign(self->connInfo.is_aoss_serverless); // Authentication rt_opts.auth.auth_type.assign(self->connInfo.authtype); diff --git a/src/sqlodbc/opensearch_odbc.h b/src/sqlodbc/opensearch_odbc.h index 2fb9e48..081309d 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_aoss_serverless[SMALL_REGISTRY_LEN]; // Authentication char authtype[MEDIUM_REGISTRY_LEN]; diff --git a/src/sqlodbc/opensearch_types.h b/src/sqlodbc/opensearch_types.h index 05ce11b..7145516 100644 --- a/src/sqlodbc/opensearch_types.h +++ b/src/sqlodbc/opensearch_types.h @@ -272,7 +272,7 @@ typedef struct connection_options { std::string port; std::string timeout; std::string fetch_size; - std::string is_serverless; + std::string is_aoss_serverless; } connection_options; typedef struct runtime_options {