/**
* Get a value to insert into expiry field of the database when infinite expiry
- * is desired. In principle this could be DBMS-dependant, but currently all
- * supported DBMS's support the string "infinity", so we just use that.
+ * is desired
*
* @return String
*/
public static function infinity() {
- # This is a special keyword for timestamps in PostgreSQL, and
- # works with CHAR(14) as well because "i" sorts after all numbers.
-
- # BEGIN DatabaseMssql hack
- # Since MSSQL doesn't recognize the infinity keyword, set date manually.
- # TO-DO: Refactor for better DB portability and remove magic date
- $dbr = wfGetDB( DB_SLAVE );
- if ( $dbr->getType() == 'mssql' ) {
- return '3000-01-31 00:00:00.000';
- }
- # End DatabaseMssql hack
-
- return 'infinity';
+ return wfGetDB( DB_SLAVE )->getInfinity();
}
/**
return 'SearchEngineDummy';
}
+ /**
+ * Find out when 'infinity' is. Most DBMSes support this. This is a special
+ * keyword for timestamps in PostgreSQL, and works with CHAR(14) as well
+ * because "i" sorts after all numbers.
+ *
+ * @return String
+ */
+ public function getInfinity() {
+ return 'infinity';
+ }
+
/**
* Allow or deny "big selects" for this session only. This is done by setting
* the sql_big_selects session variable.
return "SearchMssql";
}
+ /**
+ * Since MSSQL doesn't recognize the infinity keyword, set date manually.
+ * @todo Remove magic date
+ */
+ public function getInfinity() {
+ return '3000-01-31 00:00:00.000';
+ }
+
} // end DatabaseMssql class
/**