]> git.joonet.de Git - adminer.git/commitdiff
PostgreSQL: Display description of system variables
authorJakub Vrana <jakub@vrana.cz>
Tue, 18 Mar 2025 15:00:21 +0000 (16:00 +0100)
committerJakub Vrana <jakub@vrana.cz>
Tue, 18 Mar 2025 15:00:21 +0000 (16:00 +0100)
CHANGELOG.md
adminer/drivers/mysql.inc.php
adminer/drivers/oracle.inc.php
adminer/drivers/pgsql.inc.php
adminer/drivers/sqlite.inc.php
adminer/variables.inc.php

index e62878f58e6de732e161f5fc45f038fb37eabd30..e1143665e4ea8d43c13e45270f9187e0922d14be 100644 (file)
@@ -1,5 +1,6 @@
 ## Adminer dev
 - PostgreSQL: Display auto_increment of inserted rows
+- PostgreSQL: Display description of system variables
 - CSS: Sticky table headers (bug #918)
 - IMAP: New plugin driver created for fun
 
index 23cff3bf85cc63beb11cc8777d183b7163387fac..88d7fe05d0731bc815b4d3c413dbf53a2c2fcd00 100644 (file)
@@ -1156,10 +1156,17 @@ if (!defined('Adminer\DRIVER')) {
        }
 
        /** Get server variables
-       * @return array [$name => $value]
+       * @return array [[$name, $value]]
        */
        function show_variables() {
-               return get_key_vals("SHOW VARIABLES");
+               return get_rows("SHOW VARIABLES");
+       }
+
+       /** Get status variables
+       * @return array [[$name, $value]]
+       */
+       function show_status() {
+               return get_rows("SHOW STATUS");
        }
 
        /** Get process list
@@ -1169,13 +1176,6 @@ if (!defined('Adminer\DRIVER')) {
                return get_rows("SHOW FULL PROCESSLIST");
        }
 
-       /** Get status variables
-       * @return array [$name => $value]
-       */
-       function show_status() {
-               return get_key_vals("SHOW STATUS");
-       }
-
        /** Convert field in select and edit
        * @param array one element from fields()
        * @return string
index b22c26009b8f3594d1e5653b7115cc8a97761347..bf65a90ffaa2d40b588d762c79026a6c3dd65ffa 100644 (file)
@@ -513,7 +513,16 @@ AND c_src.TABLE_NAME = " . q($table);
        }
 
        function show_variables() {
-               return get_key_vals('SELECT name, display_value FROM v$parameter');
+               return get_rows('SELECT name, display_value FROM v$parameter');
+       }
+
+       function show_status() {
+               $return = array();
+               $rows = get_rows('SELECT * FROM v$instance');
+               foreach (reset($rows) as $key => $val) {
+                       $return[] = array($key, $val);
+               }
+               return $return;
        }
 
        function process_list() {
@@ -534,11 +543,6 @@ ORDER BY PROCESS
 ');
        }
 
-       function show_status() {
-               $rows = get_rows('SELECT * FROM v$instance');
-               return reset($rows);
-       }
-
        function convert_field($field) {
        }
 
index 65ae2b1a8ead2ac8075fc2059a9aeb1795b65d89..5fcaa091d3dcc1ac3b9d8c9a7219f168a0c0c0ba 100644 (file)
@@ -946,7 +946,7 @@ AND typelem = 0"
        }
 
        function show_variables() {
-               return get_key_vals("SHOW ALL");
+               return get_rows("SHOW ALL");
        }
 
        function process_list() {
index c0edd03766e02b5c1ee9739b1430574838d388b8..5d64a3bee68e6aa8b87615abbdd7461bcc01ac87 100644 (file)
@@ -718,8 +718,9 @@ if (isset($_GET["sqlite"])) {
                foreach (get_rows("PRAGMA pragma_list") as $row) {
                        $name = $row["name"];
                        if ($name != "pragma_list" && $name != "compile_options") {
+                               $return[$name] = array($name, '');
                                foreach (get_rows("PRAGMA $name") as $row) {
-                                       $return[$name] .= implode(", ", $row) . "\n";
+                                       $return[$name][1] .= implode(", ", $row) . "\n";
                                }
                        }
                }
@@ -729,8 +730,7 @@ if (isset($_GET["sqlite"])) {
        function show_status() {
                $return = array();
                foreach (get_vals("PRAGMA compile_options") as $option) {
-                       list($key, $val) = explode("=", $option, 2);
-                       $return[$key] = $val;
+                       $return[] = explode("=", $option, 2);
                }
                return $return;
        }
index ba3c76b917643854d532daa6ff347f310d0f8ac9..0e3bfd29d96d6a3b8a3b1faa9f22e717e7d749fb 100644 (file)
@@ -9,10 +9,13 @@ if (!$variables) {
        echo "<p class='message'>" . lang('No rows.') . "\n";
 } else {
        echo "<table>\n";
-       foreach ($variables as $key => $val) {
+       foreach ($variables as $row) {
                echo "<tr>";
+               $key = array_shift($row);
                echo "<th><code class='jush-" . JUSH . ($status ? "status" : "set") . "'>" . h($key) . "</code>";
-               echo "<td>" . nl_br(h($val));
+               foreach ($row as $val) {
+                       echo "<td>" . nl_br(h($val));
+               }
        }
        echo "</table>\n";
 }