Index: trunk/phase3/includes/Article.php |
— | — | @@ -707,8 +707,8 @@ |
708 | 708 | GROUP BY rev_user, rev_user_text, user_real_name |
709 | 709 | ORDER BY timestamp DESC"; |
710 | 710 | |
711 | | - if($limit > 0) { $sql .= ' LIMIT '.$limit; } |
712 | | - if($offset > 0) { $sql .= ' OFFSET '.$offset; } |
| 711 | + if($limit > 0) |
| 712 | + $sql = $dbr->limitResult($sql, $limit, $offset); |
713 | 713 | |
714 | 714 | $sql .= ' '. $this->getSelectOptions(); |
715 | 715 | |
Index: trunk/phase3/includes/specials/SpecialRecentchangeslinked.php |
— | — | @@ -155,7 +155,9 @@ |
156 | 156 | $sql = $subsql[0]; |
157 | 157 | else { |
158 | 158 | // need to resort and relimit after union |
159 | | - $sql = "(" . implode( ") UNION (", $subsql ) . ") ORDER BY rc_timestamp DESC LIMIT {$limit}"; |
| 159 | + // unwrapped UNION block will not work in Oracle. Wrapper aded. |
| 160 | + $sql = "SELECT * FROM ((" . implode( ") UNION (", $subsql ) . ")) ORDER BY rc_timestamp DESC"; |
| 161 | + $sql = $dbr->limitResult($sql, $limit, false); |
160 | 162 | } |
161 | 163 | |
162 | 164 | $res = $dbr->query( $sql, __METHOD__ ); |
Index: trunk/phase3/includes/specials/SpecialNewimages.php |
— | — | @@ -40,7 +40,8 @@ |
41 | 41 | if ($hidebotsql) { |
42 | 42 | $sql .= "$hidebotsql WHERE ug_group IS NULL"; |
43 | 43 | } |
44 | | - $sql .= ' ORDER BY img_timestamp DESC LIMIT 1'; |
| 44 | + $sql .= ' ORDER BY img_timestamp DESC'; |
| 45 | + $sql = $dbr->limitResult($sql, 1, false); |
45 | 46 | $res = $dbr->query( $sql, __FUNCTION__ ); |
46 | 47 | $row = $dbr->fetchRow( $res ); |
47 | 48 | if( $row !== false ) { |
— | — | @@ -93,7 +94,7 @@ |
94 | 95 | $sql .= ' WHERE ' . $dbr->makeList( $where, LIST_AND ); |
95 | 96 | } |
96 | 97 | $sql.=' ORDER BY img_timestamp '. ( $invertSort ? '' : ' DESC' ); |
97 | | - $sql.=' LIMIT ' . ( $limit + 1 ); |
| 98 | + $sql = $dbr->limitResult($sql, ( $limit + 1 ), false); |
98 | 99 | $res = $dbr->query( $sql, __FUNCTION__ ); |
99 | 100 | |
100 | 101 | /** |