From 6a491373c28f0c83bc69f2bff2c6d6c8c84c082b Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 24 May 2011 15:20:13 +0200 Subject: [PATCH] Pagination support in Oracle (bug #3306828) --- adminer/drivers/oracle.inc.php | 5 ++++- adminer/select.inc.php | 3 +++ changes.txt | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/adminer/drivers/oracle.inc.php b/adminer/drivers/oracle.inc.php index 1844e084..878d5e3c 100644 --- a/adminer/drivers/oracle.inc.php +++ b/adminer/drivers/oracle.inc.php @@ -153,7 +153,10 @@ if (isset($_GET["oracle"])) { } function limit($query, $where, $limit, $offset = 0, $separator = " ") { - return " $query$where" . (isset($limit) ? ($where ? " AND" : $separator . "WHERE") . ($offset ? " rownum > $offset AND" : "") . " rownum <= " . ($limit + $offset) : ""); + return ($offset ? " * FROM (SELECT t.*, rownum AS rnum FROM (SELECT $query$where) t WHERE rownum <= " . ($limit + $offset) . ") WHERE rnum > $offset" + : (isset($limit) ? " * FROM (SELECT $query$where) WHERE rownum <= " . ($limit + $offset) + : " $query$where" + )); } function limit1($query, $where) { diff --git a/adminer/select.inc.php b/adminer/select.inc.php index d30c2bad..30d1561b 100644 --- a/adminer/select.inc.php +++ b/adminer/select.inc.php @@ -230,6 +230,9 @@ if (!$columns) { echo "
\n"; $rows = array(); while ($row = $result->fetch_assoc()) { + if ($page && $jush == "oracle") { + unset($row["RNUM"]); + } $rows[] = $row; } // use count($rows) without LIMIT, COUNT(*) without grouping, FOUND_ROWS otherwise (slowest) diff --git a/changes.txt b/changes.txt index c1963956..8dc7681c 100644 --- a/changes.txt +++ b/changes.txt @@ -3,7 +3,9 @@ Use Esc to disable in-place edit Highlight SQL code in textarea Append new index with auto index selection (bug #3282127) Bit type default value +Pagination support (Oracle) Autocomplete for big foreign keys (Editor) +Display name of the referenced record in PostgreSQL (Editor) Customizable favicon (customization) Method name can return a link (customization)