]> git.joonet.de Git - adminer.git/commitdiff
PostgreSQL, MS SQL, Oracle: Hide table actions for information_schema
authorJakub Vrana <jakub@vrana.cz>
Mon, 3 Mar 2025 14:50:08 +0000 (15:50 +0100)
committerJakub Vrana <jakub@vrana.cz>
Mon, 3 Mar 2025 14:54:08 +0000 (15:54 +0100)
adminer/drivers/mssql.inc.php
adminer/drivers/oracle.inc.php
adminer/drivers/pgsql.inc.php
adminer/foreign.inc.php
changes.txt

index 52b3dd1535354164a8d14d009e7b95f37252a113..1d5dbcde925c924d727e1dcf90e5c5278012a3f7 100644 (file)
@@ -392,7 +392,7 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
        }
 
        function information_schema($db) {
-               return false;
+               return get_schema() == "INFORMATION_SCHEMA";
        }
 
        function error() {
index 65cb48942e8e8e80ac849b6cc34ae62e6e14dba7..f25c551cfd9e72dffc0f0843fe6548ae835e3b36 100644 (file)
@@ -346,7 +346,7 @@ ORDER BY ac.constraint_type, aic.column_position", $connection2) as $row) {
        }
 
        function information_schema($db) {
-               return false;
+               return get_schema() == "INFORMATION_SCHEMA";
        }
 
        function error() {
index 7328a603a4d9a8e898a092192e0e507324266cb4..0d05854e781b97956f117452c801446561d86130 100644 (file)
@@ -471,7 +471,7 @@ ORDER BY conkey, conname") as $row) {
        }
 
        function information_schema($db) {
-               return ($db == "information_schema");
+               return get_schema() == "information_schema";
        }
 
        function error() {
index 99caf5cbf22b8f8da4af8b585246394d30687987..7da2d551cdeaf69adc8ee884cb420b36fb6a8356 100644 (file)
@@ -64,7 +64,10 @@ $target = array_keys(fields(in_array($row["table"], $referencable) ? $row["table
 $onchange = "this.form['change-js'].value = '1'; this.form.submit();";
 echo "<p>" . lang('Target table') . ": " . html_select("table", $referencable, $row["table"], $onchange) . "\n";
 if (support("scheme")) {
-       echo lang('Schema') . ": " . html_select("ns", $adminer->schemas(), $row["ns"] != "" ? $row["ns"] : $_GET["ns"], $onchange);
+       $schemas = array_filter($adminer->schemas(), function ($schema) {
+               return !preg_match('~^information_schema$~i', $schema);
+       });
+       echo lang('Schema') . ": " . html_select("ns", $schemas, $row["ns"] != "" ? $row["ns"] : $_GET["ns"], $onchange);
        if ($row["ns"] != "") {
                set_schema($orig_schema);
        }
index e3c66f57b0ed7470ba626484e5f272f7de4fdf05..0f693f8d330a739513031826f8bbf8ab490e6f28 100644 (file)
@@ -6,6 +6,7 @@ PostgreSQL: Fix export of indexes with expressions (bug #768)
 PostgreSQL: Display ENUM types
 PostgreSQL: Export ENUM types (bug #587)
 PostgreSQL: Show accessible databases to non-owners (regression from 4.9.1)
+PostgreSQL, MS SQL, Oracle: Hide table actions for information_schema
 SQLite: Support CHECK constraint
 SQLite: Add command Check tables
 SQLite: Display all rows of variable values