From cc3bbfc759efda123d694226a360fb2097a6ece0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jaramago=20Fern=C3=A1ndez?= Date: Mon, 15 Jun 2020 17:34:09 +0200 Subject: [PATCH] Added new command in 'Admin Module' used by 'mysqlsh' when starting in '--sql' mode --- lib/ProxySQL_Admin.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/ProxySQL_Admin.cpp b/lib/ProxySQL_Admin.cpp index d94b6df3f..213558899 100644 --- a/lib/ProxySQL_Admin.cpp +++ b/lib/ProxySQL_Admin.cpp @@ -3924,6 +3924,15 @@ void admin_session_handler(MySQL_Session *sess, void *_pa, PtrSize_t *pkt) { goto __run_query; } + if (!strncasecmp("select @@sql_mode", query_no_space, strlen("select @@sql_mode"))) { + l_free(query_length,query); + char *q = const_cast("SELECT \"\" as \"@@sql_mode\""); + query_length = strlen(q) + strlen(PROXYSQL_VERSION) + 1; + query = static_cast(l_alloc(query_length)); + sprintf(query, q, PROXYSQL_VERSION); + goto __run_query; + } + if (query_no_space_length==SELECT_DB_USER_LEN) { if (!strncasecmp(SELECT_DB_USER, query_no_space, query_no_space_length)) { l_free(query_length,query);