From 4ad7eb0b70a375e5c1b7670dbcd838ff767e120e Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Fri, 15 Aug 2025 23:43:25 +0200 Subject: [PATCH] PostgreSQL: Fix calling functions returing table --- CHANGELOG.md | 1 + adminer/call.inc.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cf849a2..0236296f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ - PostgreSQL: Shorten values in hstore columns - PostgreSQL: Quote edit value with interval operator - PostgreSQL: Fix calling functions with name-less parameters +- PostgreSQL: Fix calling functions returing table - PostgreSQL 11-: Avoid duplicate oid in table status (bug #1089) - Elasticsearch: Support dropping aliases - Plugins: Methods afterConnect(), processList() and killProcess() diff --git a/adminer/call.inc.php b/adminer/call.inc.php index e6279c27..4658e661 100644 --- a/adminer/call.inc.php +++ b/adminer/call.inc.php @@ -36,7 +36,7 @@ if (!$error && $_POST) { } } - $query = (isset($_GET["callf"]) ? "SELECT" : "CALL") . " " . table($PROCEDURE) . "(" . implode(", ", $call) . ")"; + $query = (isset($_GET["callf"]) ? "SELECT " : "CALL ") . ($routine["returns"]["type"] == "record" ? "* FROM " : "") . table($PROCEDURE) . "(" . implode(", ", $call) . ")"; $start = microtime(true); $result = connection()->multi_query($query); $affected = connection()->affected_rows; // getting warnings overwrites this