r55159 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55158‎ | r55159 | r55160 >
Date:00:59, 17 August 2009
Author:demon
Status:ok (Comments)
Tags:
Comment:
(bug 20265) Special:AncientPages (and UnusedFiles) broken for SQLite.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialAncientpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUnusedimages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUnusedimages.php
@@ -32,6 +32,9 @@
3333 case 'oracle':
3434 $epoch = '((trunc(img_timestamp) - to_date(\'19700101\',\'YYYYMMDD\')) * 86400)';
3535 break;
 36+ case 'sqlite':
 37+ $epoch = 'img_timestamp';
 38+ break;
3639 default:
3740 $epoch = 'EXTRACT(epoch FROM img_timestamp)';
3841 }
Index: trunk/phase3/includes/specials/SpecialAncientpages.php
@@ -37,6 +37,9 @@
3838 case 'oracle':
3939 $epoch = '((trunc(rev_timestamp) - to_date(\'19700101\',\'YYYYMMDD\')) * 86400)';
4040 break;
 41+ case 'sqlite':
 42+ $epoch = 'rev_timestamp';
 43+ break;
4144 default:
4245 $epoch = 'EXTRACT(epoch FROM rev_timestamp)';
4346 }
Index: trunk/phase3/RELEASE-NOTES
@@ -405,6 +405,7 @@
406406 * (bug 20203) "Powered by Mediawiki" now has height/width on image tag
407407 * (bug 20273) Fix broken output when no pages are found in the content
408408 namespaces
 409+* (bug 20265) Make AncientPages and UnusedFiles work on SQLite
409410
410411 == API changes in 1.16 ==
411412

Comments

#Comment by Simetrical (talk | contribs)   01:49, 17 August 2009

This looks like it needs to be abstracted to a Database method somehow.

#Comment by Brion VIBBER (talk | contribs)   22:21, 18 August 2009

For reference; the only reason we're using unix timestamp here is to squish it into an integer column for sorting (and on Ancientages, for later display). When cached to querycache tables, it needs to be stuck into 'value'.

Hmm, I think we have a new querycache2 table that can take strings or something? Can we adapt to that?

Status & tagging log