1 database.inc protected DatabaseConnection_mysql::doCommit()

Do the actual commit, including a workaround for PHP 8 behaviour changes.

Return value

bool: Success or otherwise of the commit.

File

core/includes/database/mysql/database.inc, line 377
Database interface code for MySQL database servers.

Class

DatabaseConnection_mysql
MySQL database connection driver.

Code

protected function doCommit() {
  if ($this->pdo->inTransaction()) {
    return $this->pdo->commit();
  }
  else {
    // In PHP 8.0 a PDOException is thrown when a commit is attempted with no
    // transaction active. In previous PHP versions this failed silently.
    return TRUE;
  }
}