Index: trunk/phase3/includes/Block.php |
— | — | @@ -849,25 +849,12 @@ |
850 | 850 | |
851 | 851 | /** |
852 | 852 | * Get a value to insert into expiry field of the database when infinite expiry |
853 | | - * is desired. In principle this could be DBMS-dependant, but currently all |
854 | | - * supported DBMS's support the string "infinity", so we just use that. |
| 853 | + * is desired |
855 | 854 | * |
856 | 855 | * @return String |
857 | 856 | */ |
858 | 857 | public static function infinity() { |
859 | | - # This is a special keyword for timestamps in PostgreSQL, and |
860 | | - # works with CHAR(14) as well because "i" sorts after all numbers. |
861 | | - |
862 | | - # BEGIN DatabaseMssql hack |
863 | | - # Since MSSQL doesn't recognize the infinity keyword, set date manually. |
864 | | - # TO-DO: Refactor for better DB portability and remove magic date |
865 | | - $dbr = wfGetDB( DB_SLAVE ); |
866 | | - if ( $dbr->getType() == 'mssql' ) { |
867 | | - return '3000-01-31 00:00:00.000'; |
868 | | - } |
869 | | - # End DatabaseMssql hack |
870 | | - |
871 | | - return 'infinity'; |
| 858 | + return wfGetDB( DB_SLAVE )->getInfinity(); |
872 | 859 | } |
873 | 860 | |
874 | 861 | /** |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -2664,6 +2664,17 @@ |
2665 | 2665 | } |
2666 | 2666 | |
2667 | 2667 | /** |
| 2668 | + * Find out when 'infinity' is. Most DBMSes support this. This is a special |
| 2669 | + * keyword for timestamps in PostgreSQL, and works with CHAR(14) as well |
| 2670 | + * because "i" sorts after all numbers. |
| 2671 | + * |
| 2672 | + * @return String |
| 2673 | + */ |
| 2674 | + public function getInfinity() { |
| 2675 | + return 'infinity'; |
| 2676 | + } |
| 2677 | + |
| 2678 | + /** |
2668 | 2679 | * Allow or deny "big selects" for this session only. This is done by setting |
2669 | 2680 | * the sql_big_selects session variable. |
2670 | 2681 | * |
Index: trunk/phase3/includes/db/DatabaseMssql.php |
— | — | @@ -1040,6 +1040,14 @@ |
1041 | 1041 | return "SearchMssql"; |
1042 | 1042 | } |
1043 | 1043 | |
| 1044 | + /** |
| 1045 | + * Since MSSQL doesn't recognize the infinity keyword, set date manually. |
| 1046 | + * @todo Remove magic date |
| 1047 | + */ |
| 1048 | + public function getInfinity() { |
| 1049 | + return '3000-01-31 00:00:00.000'; |
| 1050 | + } |
| 1051 | + |
1044 | 1052 | } // end DatabaseMssql class |
1045 | 1053 | |
1046 | 1054 | /** |