Added SHOW PGSQL VARIABLES support

v2.x_pg_PrepStmtBase_240714
Rahim Kanji 2 years ago
parent 5bf5963ecb
commit 6faa1b11c0

@ -3469,6 +3469,21 @@ void admin_session_handler(Client_Session<T> 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);

@ -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" },

Loading…
Cancel
Save