- Patch #301049 by Damien Tournoud: fix InsertQuery.

merge-requests/26/head
Dries Buytaert 2009-01-17 12:47:43 +00:00
parent 1dd9ab7739
commit a6f64e65f3
1 changed files with 2 additions and 1 deletions

View File

@ -408,11 +408,12 @@ class InsertQuery extends Query {
foreach ($this->insertValues as $insert_values) {
$last_insert_id = $this->connection->query($sql, $insert_values, $this->queryOptions);
}
$transaction->commit();
// Re-initialize the values array so that we can re-use this query.
$this->insertValues = array();
// Transaction commits here where $transaction looses scope.
return $last_insert_id;
}