chore: rework implicit commit checks
Add in some more "reset" queries - begin - start Also check *after* resetting Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
58b8b26b93
commit
f9b9184223
1 changed files with 3 additions and 2 deletions
|
|
@ -375,11 +375,12 @@ class Database:
|
|||
"""Raises exception if more than 200,000 `INSERT`, `UPDATE` queries are
|
||||
executed in one transaction. This is to ensure that writes are always flushed otherwise this
|
||||
could cause the system to hang."""
|
||||
self.check_implicit_commit(query, ignore_implicit_commit)
|
||||
|
||||
if query and is_query_type(query, ("commit", "rollback")):
|
||||
if query and is_query_type(query, ("start", "begin", "commit", "rollback")):
|
||||
self.transaction_writes = 0
|
||||
|
||||
self.check_implicit_commit(query, ignore_implicit_commit)
|
||||
|
||||
if query[:6].lower() in ("update", "insert", "delete"):
|
||||
self.transaction_writes += 1
|
||||
if self.transaction_writes > self.MAX_WRITES_PER_TRANSACTION:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue