diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index a06cb2408..af5571161 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -4476,18 +4476,34 @@ void admin_session_handler(MySQL_Session *sess, void *_pa, PtrSize_t *pkt) { if (!strncasecmp("SELECT @@version", query_no_space, strlen("SELECT @@version"))) { l_free(query_length,query); char *q=(char *)"SELECT '%s' AS '@@version'"; - query_length=strlen(q)+20+strlen(PROXYSQL_VERSION); + if (GloMyLdapAuth == nullptr) { + query_length=strlen(q)+20+strlen(PROXYSQL_VERSION); + } else { + query_length=strlen(q)+20+strlen(PROXYSQL_VERSION)+strlen(" Enterprise"); + } query=(char *)l_alloc(query_length); - sprintf(query,q,PROXYSQL_VERSION); + if (GloMyLdapAuth == nullptr) { + sprintf(query, q, PROXYSQL_VERSION); + } else { + sprintf(query, q, PROXYSQL_VERSION" Enterprise"); + } goto __run_query; } if (!strncasecmp("SELECT version()", query_no_space, strlen("SELECT version()"))) { l_free(query_length,query); char *q=(char *)"SELECT '%s' AS 'version()'"; - query_length=strlen(q)+20+strlen(PROXYSQL_VERSION); + if (GloMyLdapAuth == nullptr) { + query_length=strlen(q)+20+strlen(PROXYSQL_VERSION); + } else { + query_length=strlen(q)+20+strlen(PROXYSQL_VERSION)+strlen(" Enterprise"); + } query=(char *)l_alloc(query_length); - sprintf(query,q,PROXYSQL_VERSION); + if (GloMyLdapAuth == nullptr) { + sprintf(query, q, PROXYSQL_VERSION); + } else { + sprintf(query, q, PROXYSQL_VERSION" Enterprise"); + } goto __run_query; } diff --git a/lib/ProxySQL_Cluster.cpp b/lib/ProxySQL_Cluster.cpp index 767013cd4..160ed607b 100644 --- a/lib/ProxySQL_Cluster.cpp +++ b/lib/ProxySQL_Cluster.cpp @@ -114,8 +114,9 @@ void * ProxySQL_Cluster_Monitor_thread(void *args) { bool same_version = false; while ((row = mysql_fetch_row(result))) { if (row[0]) { - if (strcmp(row[0], PROXYSQL_VERSION)==0) { - proxy_info("Cluster: clustering with peer %s:%d . Remote version: %s . Self version: %s\n", node->hostname, node->port, row[0], PROXYSQL_VERSION); + const char* PROXYSQL_VERSION_ = GloMyLdapAuth == nullptr ? PROXYSQL_VERSION : PROXYSQL_VERSION" Enterprise"; + if (strcmp(row[0], PROXYSQL_VERSION_)==0) { + proxy_info("Cluster: clustering with peer %s:%d . Remote version: %s . Self version: %s\n", node->hostname, node->port, row[0], PROXYSQL_VERSION_); same_version = true; std::string q = "PROXYSQL CLUSTER_NODE_UUID "; q += GloVars.uuid; @@ -126,7 +127,7 @@ void * ProxySQL_Cluster_Monitor_thread(void *args) { proxy_info("Cluster: sending CLUSTER_NODE_UUID %s to peer %s:%d\n", GloVars.uuid, node->hostname, node->port); rc_query = mysql_query(conn, q.c_str()); } else { - proxy_warning("Cluster: different ProxySQL version with peer %s:%d . Remote: %s . Self: %s\n", node->hostname, node->port, row[0], PROXYSQL_VERSION); + proxy_warning("Cluster: different ProxySQL version with peer %s:%d . Remote: %s . Self: %s\n", node->hostname, node->port, row[0], PROXYSQL_VERSION_); } } }