r79345 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79344‎ | r79345 | r79346 >
Date:16:29, 31 December 2010
Author:catrope
Status:ok (Comments)
Tags:
Comment:
Remove now-unused SQL timestamp conversion functions added in r77231. They were made obsolete by the querypage-work2 branch merge in r78786
Modified paths:
  • /trunk/phase3/includes/db/Database.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseMssql.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseMysql.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseOracle.php (modified) (history)
  • /trunk/phase3/includes/db/DatabaseSqlite.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/DatabaseMysql.php
@@ -478,9 +478,6 @@
479479 $this->query( "SET sql_big_selects=$encValue", __METHOD__ );
480480 }
481481
482 - public function unixTimestamp( $field ) {
483 - return "UNIX_TIMESTAMP($field)";
484 - }
485482
486483 /**
487484 * Determines if the last failure was due to a deadlock
Index: trunk/phase3/includes/db/DatabaseOracle.php
@@ -839,10 +839,6 @@
840840 return 'SELECT * ' . ( $all ? '':'/* UNION_UNIQUE */ ' ) . 'FROM (' . implode( $glue, $sqls ) . ')' ;
841841 }
842842
843 - public function unixTimestamp( $field ) {
844 - return "((trunc($field) - to_date('19700101','YYYYMMDD')) * 86400)";
845 - }
846 -
847843 function wasDeadlock() {
848844 return $this->lastErrno() == 'OCI-00060';
849845 }
Index: trunk/phase3/includes/db/Database.php
@@ -2045,16 +2045,6 @@
20462046 }
20472047
20482048 /**
2049 - * Convert a field to an unix timestamp
2050 - *
2051 - * @param $field String: field name
2052 - * @return String: SQL statement
2053 - */
2054 - public function unixTimestamp( $field ) {
2055 - return "EXTRACT(epoch FROM $field)";
2056 - }
2057 -
2058 - /**
20592049 * Determines if the last failure was due to a deadlock
20602050 * STUB
20612051 */
Index: trunk/phase3/includes/db/DatabaseMssql.php
@@ -787,10 +787,6 @@
788788 return false;
789789 }
790790
791 - public function unixTimestamp( $field ) {
792 - return "DATEDIFF(s,CONVERT(datetime,'1/1/1970'),$field)";
793 - }
794 -
795791 /**
796792 * Begin a transaction, committing any previously open transaction
797793 */
Index: trunk/phase3/includes/db/DatabaseSqlite.php
@@ -431,10 +431,6 @@
432432 return implode( $glue, $sqls );
433433 }
434434
435 - public function unixTimestamp( $field ) {
436 - return $field;
437 - }
438 -
439435 function wasDeadlock() {
440436 return $this->lastErrno() == 5; // SQLITE_BUSY
441437 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r79748SocialProfile: revert r77339 because Database::unixTimestamp was removed in r...ashley19:31, 6 January 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r77231Moved switches in Special:Unusedimages and Special:Ancientpages to extract a ...ialex15:40, 24 November 2010
r78786Merge querypage-work2 branch from trunk. The most relevant changes are:...catrope14:16, 22 December 2010

Comments

#Comment by Reedy (talk | contribs)   02:37, 6 January 2011

Do we 1.17 this..? I suppose it doesn't matter much

#Comment by Catrope (talk | contribs)   12:44, 6 January 2011

No, because this depends on most of the QueryPage refactoring to make these functions obsolete in the first place.

Status & tagging log