Index: trunk/phase3/includes/specials/SpecialUnusedimages.php |
— | — | @@ -22,13 +22,17 @@ |
23 | 23 | function isSyndicated() { return false; } |
24 | 24 | |
25 | 25 | function getSQL() { |
26 | | - global $wgCountCategorizedImagesAsUsed; |
| 26 | + global $wgCountCategorizedImagesAsUsed, $wgDBtype; |
27 | 27 | $dbr = wfGetDB( DB_SLAVE ); |
28 | 28 | |
| 29 | + $epoch = $wgDBtype == 'mysql' ? |
| 30 | + 'UNIX_TIMESTAMP(img_timestamp)' : |
| 31 | + 'EXTRACT(epoch FROM img_timestamp)'; |
| 32 | + |
29 | 33 | if ( $wgCountCategorizedImagesAsUsed ) { |
30 | 34 | list( $page, $image, $imagelinks, $categorylinks ) = $dbr->tableNamesN( 'page', 'image', 'imagelinks', 'categorylinks' ); |
31 | 35 | |
32 | | - return "SELECT 'Unusedimages' as type, 6 as namespace, img_name as title, img_timestamp as value, |
| 36 | + return "SELECT 'Unusedimages' as type, 6 as namespace, img_name as title, $epoch as value, |
33 | 37 | img_user, img_user_text, img_description |
34 | 38 | FROM ((($page AS I LEFT JOIN $categorylinks AS L ON I.page_id = L.cl_from) |
35 | 39 | LEFT JOIN $imagelinks AS P ON I.page_title = P.il_to) |
— | — | @@ -37,14 +41,14 @@ |
38 | 42 | } else { |
39 | 43 | list( $image, $imagelinks ) = $dbr->tableNamesN( 'image','imagelinks' ); |
40 | 44 | |
41 | | - return "SELECT 'Unusedimages' as type, 6 as namespace, img_name as title, img_timestamp as value, |
| 45 | + return "SELECT 'Unusedimages' as type, 6 as namespace, img_name as title, $epoch as value, |
42 | 46 | img_user, img_user_text, img_description |
43 | 47 | FROM $image LEFT JOIN $imagelinks ON img_name=il_to WHERE il_to IS NULL "; |
44 | 48 | } |
45 | 49 | } |
46 | 50 | |
47 | 51 | function getPageHeader() { |
48 | | - return wfMsgExt( 'unusedimagestext', array( 'parse') ); |
| 52 | + return wfMsgExt( 'unusedimagestext', array( 'parse' ) ); |
49 | 53 | } |
50 | 54 | |
51 | 55 | } |
Index: trunk/phase3/includes/QueryPage.php |
— | — | @@ -204,7 +204,7 @@ |
205 | 205 | * Clear the cache and save new results |
206 | 206 | */ |
207 | 207 | function recache( $limit, $ignoreErrors = true ) { |
208 | | - $fname = get_class($this) . '::recache'; |
| 208 | + $fname = get_class( $this ) . '::recache'; |
209 | 209 | $dbw = wfGetDB( DB_MASTER ); |
210 | 210 | $dbr = wfGetDB( DB_SLAVE, array( $this->getName(), 'QueryPage::recache', 'vslow' ) ); |
211 | 211 | if ( !$dbw || !$dbr ) { |
— | — | @@ -222,9 +222,9 @@ |
223 | 223 | $dbw->delete( 'querycache', array( 'qc_type' => $this->getName() ), $fname ); |
224 | 224 | # Do query |
225 | 225 | $sql = $this->getSQL() . $this->getOrder(); |
226 | | - if ($limit !== false) |
227 | | - $sql = $dbr->limitResult($sql, $limit, 0); |
228 | | - $res = $dbr->query($sql, $fname); |
| 226 | + if ( $limit !== false ) |
| 227 | + $sql = $dbr->limitResult( $sql, $limit, 0 ); |
| 228 | + $res = $dbr->query( $sql, $fname ); |
229 | 229 | $num = false; |
230 | 230 | if ( $res ) { |
231 | 231 | $num = $dbr->numRows( $res ); |
— | — | @@ -238,7 +238,7 @@ |
239 | 239 | $insertSql .= ','; |
240 | 240 | } |
241 | 241 | if ( isset( $row->value ) ) { |
242 | | - $value = $row->value; |
| 242 | + $value = intval( $row->value ); // @bug 14414 |
243 | 243 | } else { |
244 | 244 | $value = 0; |
245 | 245 | } |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -117,6 +117,7 @@ |
118 | 118 | other users. |
119 | 119 | * Add an ID if 'missingsummary' is triggered to allow styling of the summary |
120 | 120 | line |
| 121 | + |
121 | 122 | === Bug fixes in 1.15 === |
122 | 123 | * (bug 16968) Special:Upload no longer throws useless warnings. |
123 | 124 | * (bug 17000) Special:RevisionDelete now checks if the database is locked |
— | — | @@ -213,6 +214,8 @@ |
214 | 215 | * (bug 1061) CSS-added icons next to links display through the text and makes |
215 | 216 | it unreadable in RTL |
216 | 217 | * Special:Wantedtemplates now works on PostgreSQL |
| 218 | +* (bug 14414) maintenance/updateSpecialPages.php no longer throws error with |
| 219 | + PostgreSQL |
217 | 220 | |
218 | 221 | == API changes in 1.15 == |
219 | 222 | * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions |