}
/* Transaction stays in the ERROR state until rolled back */
if ( $this->mTrxLevel ) {
- $this->rollback( __METHOD__ );
+ // Throw away the transaction state, then raise the error as normal.
+ // Note that if this connection is managed by LBFactory, it's already expected
+ // that the other transactions LBFactory manages will be rolled back.
+ $this->rollback( __METHOD__, self::FLUSHING_INTERNAL );
}
parent::reportQueryError( $error, $errno, $sql, $fname, false );
}
return false;
}
+ public function serverIsReadOnly() {
+ $res = $this->query( "SHOW default_transaction_read_only", __METHOD__ );
+ $row = $this->fetchObject( $res );
+
+ return $row ? ( strtolower( $row->default_transaction_read_only ) === 'on' ) : false;
+ }
+
/**
* @param string $lockName
* @return string Integer