|
@@ 260-276 (lines=17) @@
|
| 257 |
|
return $this->nested_transactions_count; |
| 258 |
|
} |
| 259 |
|
|
| 260 |
|
public function commit($all=false) { |
| 261 |
|
if ($this->nested_transactions && $this->serverVersion() < '5.5') { |
| 262 |
|
return $this->nonSQLError("Nested transactions are only available on MySQL 5.5 and greater. You are using MySQL " . $this->serverVersion()); |
| 263 |
|
} |
| 264 |
|
|
| 265 |
|
if ($this->nested_transactions && $this->nested_transactions_count > 0) |
| 266 |
|
$this->nested_transactions_count--; |
| 267 |
|
|
| 268 |
|
if (!$this->nested_transactions || $all || $this->nested_transactions_count == 0) { |
| 269 |
|
$this->nested_transactions_count = 0; |
| 270 |
|
$this->query('COMMIT'); |
| 271 |
|
} else { |
| 272 |
|
$this->query("RELEASE SAVEPOINT LEVEL{$this->nested_transactions_count}"); |
| 273 |
|
} |
| 274 |
|
|
| 275 |
|
return $this->nested_transactions_count; |
| 276 |
|
} |
| 277 |
|
|
| 278 |
|
public function rollback($all=false) { |
| 279 |
|
if ($this->nested_transactions && $this->serverVersion() < '5.5') { |
|
@@ 278-294 (lines=17) @@
|
| 275 |
|
return $this->nested_transactions_count; |
| 276 |
|
} |
| 277 |
|
|
| 278 |
|
public function rollback($all=false) { |
| 279 |
|
if ($this->nested_transactions && $this->serverVersion() < '5.5') { |
| 280 |
|
return $this->nonSQLError("Nested transactions are only available on MySQL 5.5 and greater. You are using MySQL " . $this->serverVersion()); |
| 281 |
|
} |
| 282 |
|
|
| 283 |
|
if ($this->nested_transactions && $this->nested_transactions_count > 0) |
| 284 |
|
$this->nested_transactions_count--; |
| 285 |
|
|
| 286 |
|
if (!$this->nested_transactions || $all || $this->nested_transactions_count == 0) { |
| 287 |
|
$this->nested_transactions_count = 0; |
| 288 |
|
$this->query('ROLLBACK'); |
| 289 |
|
} else { |
| 290 |
|
$this->query("ROLLBACK TO SAVEPOINT LEVEL{$this->nested_transactions_count}"); |
| 291 |
|
} |
| 292 |
|
|
| 293 |
|
return $this->nested_transactions_count; |
| 294 |
|
} |
| 295 |
|
|
| 296 |
|
protected function formatTableName($table) { |
| 297 |
|
$table = trim($table, '`'); |