r89114 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r89113‎ | r89114 | r89115 >
Date:15:43, 29 May 2011
Author:raymond
Status:resolved (Comments)
Tags:
Comment:
Fix a regression from r63144: "Fixed bizarre $time comparison (compared display time and a UNIX const time)"
That's not correct: Timestamps in table logging are stored as yyyymmddhhmmss
Modified paths:
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LogEventsList.php
@@ -505,8 +505,9 @@
506506 # Fall back to a blue contributions link
507507 $revert = $this->skin->userToolLinks( 1, $title->getDBkey() );
508508 }
509 - $ts = wfTimestamp( TS_UNIX, $row->log_timestamp );
510 - if( $ts < '20080129000000' ) {
 509+ #$ts = wfTimestamp( TS_UNIX, $row->log_timestamp );
 510+ var_dump( wfTimestamp( TS_UNIX, '20080129000000' ) );
 511+ if( $row->log_timestamp < '20080129000000' ) {
511512 # Suppress $comment from old entries (before 2008-01-29),
512513 # not needed and can contain incorrect links
513514 $comment = '';

Follow-up revisions

RevisionCommit summaryAuthorDate
r89115Followup r89114: Ctrl-S is your friend...raymond15:45, 29 May 2011
r89129Fix for r89114: handle other DBMSesaaron19:18, 29 May 2011
r896771.17: MFT r88492, r88870, r88871, r89003, r89108, r89114, r89115, r89129, r89...catrope19:14, 7 June 2011
r92330REL1_18 MFT r88750, r88870, r88871, r89003, r89005, r89114, r89115, r89129, r...reedy22:56, 15 July 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63144* Split up logLine() with helper functions...aaron22:47, 1 March 2010

Comments

#Comment by Aaron Schulz (talk | contribs)   15:49, 29 May 2011

What about Postgres?

#Comment by Raymond (talk | contribs)   15:53, 29 May 2011

Ouch... Would

 $ts = wfTimestamp( TS_UNIX, $row->log_timestamp );
 if( $row->log_timestamp < '1201564800' ) { // Unix timestamp equivalent for '20080129000000'

work for all DBMSs?

#Comment by Catrope (talk | contribs)   15:38, 1 June 2011

That, or convert to TS_MW and compare to '20080129000000' . Anything is fine as long as you make no assumptions about the internal timestamp format in the DB and convert timestamps from the DB to the format you need.

Status & tagging log