// Create a savepoint so we can rollback a failed query. This is so we can
// mimic MySQL and SQLite transactions which don't fail if a single query
// fails. This is important for tables that are created on demand. For
// example, \Drupal\Core\Cache\DatabaseBackend.
$this->connection->
addSavepoint();
try { $stmt->
execute(NULL,
$this->queryOptions
);
if (isset($table_information->serial_fields
[0
])) { $last_insert_id =
$stmt->
fetchField();
} $this->connection->
releaseSavepoint();
} catch (\Exception
$e) { $this->connection->
rollbackSavepoint();
$this->connection->
exceptionHandler()->
handleExecutionException($e,
$stmt,
[],
$this->queryOptions
);
} // Re-initialize the values array so that we can re-use this query.
$this->insertValues =
[];
return $last_insert_id ?? NULL;
}