From 442c30844d4d8f855400f48824b693fa2ee33593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Canna=C3=B2?= Date: Mon, 12 Jan 2015 21:34:32 +0000 Subject: [PATCH] Implemented SHOW DATABASES (issue #141) --- lib/Standard_ProxySQL_Admin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Standard_ProxySQL_Admin.cpp b/lib/Standard_ProxySQL_Admin.cpp index 15f3f34a7..e969eb3a2 100644 --- a/lib/Standard_ProxySQL_Admin.cpp +++ b/lib/Standard_ProxySQL_Admin.cpp @@ -965,6 +965,13 @@ void admin_session_handler(MySQL_Session *sess, ProxySQL_Admin *pa, PtrSize_t *p goto __run_query; } + if (query_no_space_length==strlen("SHOW DATABASES") && !strncasecmp("SHOW DATABASES",query_no_space, query_no_space_length)) { + l_free(query_length,query); + query=l_strdup("PRAGMA DATABASE_LIST"); + query_length=strlen(query)+1; + goto __run_query; + } + if (sess->stats==true) { if ( (strncasecmp("PRAGMA",query_no_space,6)==0)