diff --git a/lib/Admin_Handler.cpp b/lib/Admin_Handler.cpp index b00075383..d0f055e4d 100644 --- a/lib/Admin_Handler.cpp +++ b/lib/Admin_Handler.cpp @@ -3469,6 +3469,21 @@ void admin_session_handler(Client_Session sess, void *_pa, PtrSize_t *pkt) { goto __run_query; } + if (query_no_space_length == strlen("SHOW PGSQL VARIABLES") && !strncasecmp("SHOW PGSQL VARIABLES", query_no_space, query_no_space_length)) { + l_free(query_length, query); + query = l_strdup("SELECT variable_name AS Variable_name, variable_value AS Value FROM global_variables WHERE variable_name LIKE 'pgsql-\%' ORDER BY variable_name"); + query_length = strlen(query) + 1; + goto __run_query; + } + + /*if (query_no_space_length == strlen("SHOW PGSQL STATUS") && !strncasecmp("SHOW PGSQL STATUS", query_no_space, query_no_space_length)) { + l_free(query_length, query); + query = l_strdup("SELECT Variable_Name AS Variable_name, Variable_Value AS Value FROM stats_pgsql_global ORDER BY variable_name"); + query_length = strlen(query) + 1; + GloAdmin->stats___mysql_global(); + goto __run_query; + }*/ + strA=(char *)"SHOW CREATE TABLE "; strB=(char *)"SELECT name AS 'table' , REPLACE(REPLACE(sql,' , ', X'2C0A20202020'),'CREATE TABLE %s (','CREATE TABLE %s ('||X'0A20202020') AS 'Create Table' FROM %s.sqlite_master WHERE type='table' AND name='%s'"; strAl=strlen(strA); diff --git a/test/tap/tests/admin_various_commands-t.cpp b/test/tap/tests/admin_various_commands-t.cpp index cbc2ea3c9..003356fc1 100644 --- a/test/tap/tests/admin_various_commands-t.cpp +++ b/test/tap/tests/admin_various_commands-t.cpp @@ -79,6 +79,7 @@ int main() { { 1 , "show VARIABLES" }, { 1 , "show ALL variables" }, { 1 , "show MYSQL variables" }, + { 1 , "SHOW PGSQL VARIABLES" }, { 1 , "SHOW admin VARIABLES" }, { 3 , "sHoW DATABASES" }, { 3 , "sHoW SCHEMAS" },