rdbms: move assertOpen() call near the top of Database::query

This should be done before bothering with begin() calls or setting
the value of fields like "trxDoneWrites" or "lastWriteTime".

Change-Id: Ieace2870f5496fcf230c5c8381baca4b8038db1d
This commit is contained in:
Aaron Schulz 2018-04-05 13:49:55 -07:00
parent ea62a9780c
commit 62c45d54a4

View file

@ -1061,6 +1061,9 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
public function query( $sql, $fname = __METHOD__, $tempIgnore = false ) {
$this->assertTransactionStatus( $sql, $fname );
# Avoid fatals if close() was called
$this->assertOpen();
$priorWritesPending = $this->writesOrCallbacksPending();
$this->lastQuery = $sql;
@ -1111,9 +1114,6 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
$this->queryLogger->debug( "{$this->dbName} {$commentedSql}" );
}
# Avoid fatals if close() was called
$this->assertOpen();
# Send the query to the server and fetch any corresponding errors
$ret = $this->doProfiledQuery( $sql, $commentedSql, $isNonTempWrite, $fname );
$lastError = $this->lastError();