Thread:Extension talk:OdbcDatabase/PHP Stack trace result upon empty result set/reply

I'll answer my own question I guess, the patch listed below avoids complaining about there being no row to retrieve when 0 zero rows were returned by the query: --- OdbcDatabase.body.php.original	2014-12-01 18:14:08.000000000 -0500 +++ OdbcDatabase.body.php	2015-06-04 23:04:34.127805703 -0400 @@ -128,16 +128,18 @@ 		} 		$array = null; -		$row = odbc_fetch_row( $res ); -		if ( $row ) { -			$this->mRowNum++; -			$nCols = odbc_num_fields( $res ); -			for ( $i = 0; $i < $nCols; $i++ ) { -				$array[$i] = odbc_result( $res, $i+1 ); -			} -		} else if ( $this->mRowNum <= $this->mAffectedRows ) { -			if ( $this->lastErrno ) { -				throw new DBUnexpectedError( $this, wfMessage( 'odbcdatabase-fetch-row-error', $this->lastErrno, htmlspecialchars( $this->lastErro +		if ( $this->mAffectedRows > 0 ) { +			$row = odbc_fetch_row( $res ); +			if ( $row ) { +				$this->mRowNum++; +				$nCols = odbc_num_fields( $res ); +				for ( $i = 0; $i < $nCols; $i++ ) { +					$array[$i] = odbc_result( $res, $i+1 ); +				} +			} else if ( $this->mRowNum <= $this->mAffectedRows ) { +				if ( $this->lastErrno ) { +					throw new DBUnexpectedError( $this, wfMessage( 'odbcdatabase-fetch-row-error', $this->lastErrno, htmlspecialchars( $this-> +				} 			} 		} 		return $array;