]> git.joonet.de Git - adminer.git/commitdiff
Pagination support in Oracle (bug #3306828)
authorJakub Vrana <jakub@vrana.cz>
Tue, 24 May 2011 13:20:13 +0000 (15:20 +0200)
committerJakub Vrana <jakub@vrana.cz>
Tue, 24 May 2011 13:20:13 +0000 (15:20 +0200)
adminer/drivers/oracle.inc.php
adminer/select.inc.php
changes.txt

index 1844e084b81c887469de99e0f7f10a7fce3f2e19..878d5e3c9f31f8f4a7091a6a35cdc3c344d38bd7 100644 (file)
@@ -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) {
index d30c2bad696c2b010b68f1f73dd79581d413b4e4..30d1561b828db915ab007072bd9543a3bc98ff72 100644 (file)
@@ -230,6 +230,9 @@ if (!$columns) {
                echo "<form action='' method='post' enctype='multipart/form-data'>\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)
index c196395690ba4b0224234d484ac0077135ae488d..8dc7681c250d1af3d4b83fe540c94fe180c86d47 100644 (file)
@@ -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)