Detect modification in wrong DB transaction
What does this MR do and why?
Detects modification that happens in wrong database transaction
Problem
The following sequence of events should be avoided:
- Opens a DB transaction in
main:
database (BEGIN
) - Writes to
ci:
database (e.g.UPDATE
) - Rolls back in
main:
database (ROLLBACK
)
Solution
So we attempt to detect any transaction where steps 1, and 2 above have occurred
Note, we extend the existing PreventCrossDatabaseModification
query analyzer. So this analyzer now does:
- Detection of writes occurring in two databases in the same transaction
- Detection of write(s) occurring in the database that is different from the current transaction (s).
Related issue: #347368 (closed)
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Thong Kuah