Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3783
SpecialNewImages.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
bzimport
Nov 21 2014, 9:38 PM
2014-11-21 21:38:09 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
SpecialNewImages.patch
View Options
Index: SpecialNewimages.php
===================================================================
--- SpecialNewimages.php (revision 37805)
+++ SpecialNewimages.php (working copy)
@@ -10,7 +10,7 @@
*/
function wfSpecialNewimages( $par, $specialPage ) {
global $wgUser, $wgOut, $wgLang, $wgRequest, $wgGroupPermissions, $wgMiserMode;
-
+ global $wgDBtype;
$wpIlMatch = $wgRequest->getText( 'wpIlMatch' );
$dbr = wfGetDB( DB_SLAVE );
$sk = $wgUser->getSkin();
@@ -46,11 +46,19 @@
$image = $dbr->tableName('image');
- $sql="SELECT img_timestamp from $image";
+ if ( $wgDBtype == 'adodb' ) {
+ $sql = "SELECT TOP 1 img_timestamp from $image";
+ } else {
+ $sql="SELECT img_timestamp from $image";
+ }
if ($hidebotsql) {
$sql .= "$hidebotsql WHERE ug_group IS NULL";
}
- $sql.=' ORDER BY img_timestamp DESC LIMIT 1';
+ if ( $wgDBtype == 'adodb' ) {
+ $sql .= ' ORDER BY img_timestamp DESC';
+ } else {
+ $sql.=' ORDER BY img_timestamp DESC LIMIT 1';
+ }
$res = $dbr->query($sql, 'wfSpecialNewImages');
$row = $dbr->fetchRow($res);
if($row!==false) {
@@ -105,7 +113,10 @@
$sql.=' WHERE '.$dbr->makeList($where, LIST_AND);
}
$sql.=' ORDER BY img_timestamp '. ( $invertSort ? '' : ' DESC' );
- $sql.=' LIMIT '.($limit+1);
+ if ($wgDBtype == 'adodb') {
+ } else {
+ $sql .= ' LIMIT ' . ($limit+1);
+ }
$res = $dbr->query($sql, 'wfSpecialNewImages');
/**
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3350
Default Alt Text
SpecialNewImages.patch (1 KB)
Attached To
Mode
T11767: [DO NOT USE] Microsoft SQL Server/MSSQL support (tracking)
Attached
Detach File
Event Timeline
Log In to Comment