* Fetch the next row from the given result object, in object form.
* Fields can be retrieved with $row->fieldname, with fields acting like
* member variables.
+ * If no more rows are available, false is returned.
*
* @param $res ResultWrapper|object as returned from DatabaseBase::query(), etc.
- * @return Row object
+ * @return object|bool
* @throws DBUnexpectedError Thrown if the database returns an error
*/
function fetchObject( $res );
/**
* Fetch the next row from the given result object, in associative array
* form. Fields are retrieved with $row['fieldname'].
+ * If no more rows are available, false is returned.
*
* @param $res ResultWrapper result object as returned from DatabaseBase::query(), etc.
- * @return Row object
+ * @return array|bool
* @throws DBUnexpectedError Thrown if the database returns an error
*/
function fetchRow( $res );
*/
final public static function factory( $dbType, $p = array() ) {
$canonicalDBTypes = array(
- 'mysql', 'postgres', 'sqlite', 'oracle', 'mssql', 'ibm_db2'
+ 'mysql', 'postgres', 'sqlite', 'oracle', 'mssql'
);
$dbType = strtolower( $dbType );
$class = 'Database' . ucfirst( $dbType );
if ( $this->mTrxLevel ) { // implicit commit
if ( !$this->mTrxAutomatic ) {
- // We want to warn about inadvertently nested begin/commit pairs, but not about auto-committing
- // implicit transactions that were started by query() because DBO_TRX was set.
-
- wfWarn( "$fname: Transaction already in progress (from {$this->mTrxFname}), " .
- " performing implicit commit!" );
+ // We want to warn about inadvertently nested begin/commit pairs, but not about
+ // auto-committing implicit transactions that were started by query() via DBO_TRX
+ $msg = "$fname: Transaction already in progress (from {$this->mTrxFname}), " .
+ " performing implicit commit!";
+ wfWarn( $msg );
+ wfLogDBError( $msg );
} else {
// if the transaction was automatic and has done write operations,
// log it if $wgDebugDBTransactions is enabled.
-
if ( $this->mTrxDoneWrites && $wgDebugDBTransactions ) {
- wfDebug( "$fname: Automatic transaction with writes in progress (from {$this->mTrxFname}), " .
- " performing implicit commit!\n" );
+ wfDebug( "$fname: Automatic transaction with writes in progress" .
+ " (from {$this->mTrxFname}), performing implicit commit!\n" );
}
}