use Psr\Log\LoggerAwareInterface;
use Psr\Log\LoggerInterface;
use Wikimedia\ScopedCallback;
+use Wikimedia\Rdbms\TransactionProfiler;
/**
* Relational database abstraction object
if ( false === $ret ) {
# Deadlocks cause the entire transaction to abort, not just the statement.
- # http://dev.mysql.com/doc/refman/5.7/en/innodb-error-handling.html
+ # https://dev.mysql.com/doc/refman/5.7/en/innodb-error-handling.html
# https://www.postgresql.org/docs/9.1/static/explicit-locking.html
if ( $this->wasDeadlock() ) {
if ( $this->explicitTrxActive() || $priorWritesPending ) {
}
$table = $this->tableName( $table );
- $old = $this->ignoreErrors( true );
- $res = $this->query( "SELECT 1 FROM $table LIMIT 1", $fname );
- $this->ignoreErrors( $old );
+ $ignoreErrors = true;
+ $res = $this->query( "SELECT 1 FROM $table LIMIT 1", $fname, $ignoreErrors );
return (bool)$res;
}
$selectOptions );
if ( is_array( $srcTable ) ) {
- $srcTable = implode( ',', array_map( [ &$this, 'tableName' ], $srcTable ) );
+ $srcTable = implode( ',', array_map( [ $this, 'tableName' ], $srcTable ) );
} else {
$srcTable = $this->tableName( $srcTable );
}
return $this->mTrxLevel && ( $this->mTrxAtomicLevels || !$this->mTrxAutomatic );
}
- /**
- * Creates a new table with structure copied from existing table
- * Note that unlike most database abstraction functions, this function does not
- * automatically append database prefix, because it works at a lower
- * abstraction level.
- * The table names passed to this function shall not be quoted (this
- * function calls addIdentifierQuotes when needed).
- *
- * @param string $oldName Name of table whose structure should be copied
- * @param string $newName Name of table to be created
- * @param bool $temporary Whether the new table should be temporary
- * @param string $fname Calling function name
- * @throws RuntimeException
- * @return bool True if operation was successful
- */
- public function duplicateTableStructure( $oldName, $newName, $temporary = false,
- $fname = __METHOD__
+ public function duplicateTableStructure(
+ $oldName, $newName, $temporary = false, $fname = __METHOD__
) {
throw new RuntimeException( __METHOD__ . ' is not implemented in descendant class' );
}