Permalink
Browse files

Pagination support in Oracle (bug #3306828)

  • Loading branch information...
1 parent baf2172 commit 6a491373c28f0c83bc69f2bff2c6d6c8c84c082b @vrana committed May 24, 2011
Showing with 9 additions and 1 deletion.
  1. +4 −1 adminer/drivers/oracle.inc.php
  2. +3 −0 adminer/select.inc.php
  3. +2 −0 changes.txt
@@ -153,7 +153,10 @@ function get_databases() {
}
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) {
View
@@ -230,6 +230,9 @@
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)
View
@@ -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)

0 comments on commit 6a49137

Please sign in to comment.