Pagination support in Oracle (bug #3306828)

This commit is contained in:
Jakub Vrana 2011-05-24 15:20:13 +02:00
parent baf21724cf
commit 6a491373c2
3 changed files with 9 additions and 1 deletions

View 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) {

View 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)

View 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)