Index: trunk/phase3/includes/db/DatabaseOracle.php |
— | — | @@ -950,11 +950,6 @@ |
951 | 951 | return $s; |
952 | 952 | } |
953 | 953 | |
954 | | - /* For now, does nothing */ |
955 | | - function selectDB( $db ) { |
956 | | - return true; |
957 | | - } |
958 | | - |
959 | 954 | function selectRow( $table, $vars, $conds, $fname = 'DatabaseOracle::selectRow', $options = array(), $join_conds = array() ) { |
960 | 955 | if (is_array($table)) |
961 | 956 | foreach ($table as $tab) |
— | — | @@ -1052,11 +1047,6 @@ |
1053 | 1048 | // @todo fixme no-op |
1054 | 1049 | } |
1055 | 1050 | |
1056 | | - function ping() { |
1057 | | - wfDebug( "Function ping() not written for DatabaseOracle.php yet"); |
1058 | | - return true; |
1059 | | - } |
1060 | | - |
1061 | 1051 | /** |
1062 | 1052 | * How lagged is this slave? |
1063 | 1053 | * |
Index: trunk/phase3/includes/db/DatabasePostgres.php |
— | — | @@ -1324,11 +1324,6 @@ |
1325 | 1325 | return '"' . preg_replace( '/"/', '""', $s) . '"'; |
1326 | 1326 | } |
1327 | 1327 | |
1328 | | - /* For now, does nothing */ |
1329 | | - function selectDB( $db ) { |
1330 | | - return true; |
1331 | | - } |
1332 | | - |
1333 | 1328 | /** |
1334 | 1329 | * Postgres specific version of replaceVars. |
1335 | 1330 | * Calls the parent version in Database.php |
— | — | @@ -1396,11 +1391,6 @@ |
1397 | 1392 | // @todo fixme no-op |
1398 | 1393 | } |
1399 | 1394 | |
1400 | | - function ping() { |
1401 | | - wfDebug( "Function ping() not written for DatabasePostgres.php yet"); |
1402 | | - return true; |
1403 | | - } |
1404 | | - |
1405 | 1395 | /** |
1406 | 1396 | * How lagged is this slave? |
1407 | 1397 | * |
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php |
— | — | @@ -1463,15 +1463,6 @@ |
1464 | 1464 | } |
1465 | 1465 | |
1466 | 1466 | /** |
1467 | | - * Does nothing |
1468 | | - * @param object $db |
1469 | | - * @return bool true |
1470 | | - */ |
1471 | | - public function selectDB( $db ) { |
1472 | | - return true; |
1473 | | - } |
1474 | | - |
1475 | | - /** |
1476 | 1467 | * Returns an SQL expression for a simple conditional. |
1477 | 1468 | * Uses CASE on DB2 |
1478 | 1469 | * |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -360,7 +360,10 @@ |
361 | 361 | * |
362 | 362 | * @return Bool operation success. true if already closed. |
363 | 363 | */ |
364 | | - abstract function close(); |
| 364 | + function close() { |
| 365 | + # Stub, should probably be overridden |
| 366 | + return true; |
| 367 | + } |
365 | 368 | |
366 | 369 | /** |
367 | 370 | * @param $error String: fallback error message, used if none is given by MySQL |
— | — | @@ -637,7 +640,10 @@ |
638 | 641 | * Free a result object |
639 | 642 | * @param $res Mixed: A SQL result |
640 | 643 | */ |
641 | | - abstract function freeResult( $res ); |
| 644 | + function freeResult( $res ) { |
| 645 | + # Stub. Might not really need to be overridden, since results should |
| 646 | + # be freed by PHP when the variable goes out of scope anyway. |
| 647 | + } |
642 | 648 | |
643 | 649 | /** |
644 | 650 | * Fetch the next row from the given result object, in object form. |
— | — | @@ -1252,8 +1258,16 @@ |
1253 | 1259 | |
1254 | 1260 | /** |
1255 | 1261 | * Change the current database |
| 1262 | + * |
| 1263 | + * @return bool Success or failure |
1256 | 1264 | */ |
1257 | | - abstract function selectDB( $db ); |
| 1265 | + function selectDB( $db ) { |
| 1266 | + # Stub. Shouldn't cause serious problems if it's not overridden, but |
| 1267 | + # if your database engine supports a concept similar to MySQL's |
| 1268 | + # databases you may as well. TODO: explain what exactly will fail if |
| 1269 | + # this is not overridden. |
| 1270 | + return true; |
| 1271 | + } |
1258 | 1272 | |
1259 | 1273 | /** |
1260 | 1274 | * Get the current DB name |
— | — | @@ -1921,8 +1935,13 @@ |
1922 | 1936 | |
1923 | 1937 | /** |
1924 | 1938 | * Ping the server and try to reconnect if it there is no connection |
| 1939 | + * |
| 1940 | + * @return bool Success or failure |
1925 | 1941 | */ |
1926 | | - abstract function ping(); |
| 1942 | + function ping() { |
| 1943 | + # Stub. Not essential to override. |
| 1944 | + return true; |
| 1945 | + } |
1927 | 1946 | |
1928 | 1947 | /** |
1929 | 1948 | * Get slave lag. |
Index: trunk/phase3/includes/db/DatabaseMssql.php |
— | — | @@ -935,11 +935,6 @@ |
936 | 936 | */ |
937 | 937 | public function setTimeout($timeout) { return; } |
938 | 938 | |
939 | | - function ping() { |
940 | | - wfDebug("Function ping() not written for MSSQL yet"); |
941 | | - return true; |
942 | | - } |
943 | | - |
944 | 939 | /** |
945 | 940 | * How lagged is this slave? |
946 | 941 | */ |
Index: trunk/phase3/includes/db/DatabaseSqlite.php |
— | — | @@ -390,29 +390,11 @@ |
391 | 391 | function quote_ident($s) { return $s; } |
392 | 392 | |
393 | 393 | /** |
394 | | - * Not possible in SQLite |
395 | | - * We have ATTACH_DATABASE but that requires database selectors before the |
396 | | - * table names and in any case is really a different concept to MySQL's USE |
397 | | - */ |
398 | | - function selectDB($db) { |
399 | | - if ( $db != $this->mName ) { |
400 | | - throw new MWException( 'selectDB is not implemented in SQLite' ); |
401 | | - } |
402 | | - } |
403 | | - |
404 | | - /** |
405 | 394 | * not done |
406 | 395 | */ |
407 | 396 | public function setTimeout($timeout) { return; } |
408 | 397 | |
409 | 398 | /** |
410 | | - * No-op for a non-networked database |
411 | | - */ |
412 | | - function ping() { |
413 | | - return true; |
414 | | - } |
415 | | - |
416 | | - /** |
417 | 399 | * How lagged is this slave? |
418 | 400 | */ |
419 | 401 | public function getLag() { |