-
Notifications
You must be signed in to change notification settings - Fork 52
Improve transaction behavior compatibility, add PDO-like APIs #294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5ecb8f0 to
aed66fe
Compare
dd87630 to
816e0b5
Compare
| * @var bool | ||
| */ | ||
| private $transaction_level = 0; | ||
| private $in_transaction = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice comment!
| * @see https://bugs.php.net/bug.php?id=81227 | ||
| * @see https://github.com/php/php-src/pull/14268 | ||
| */ | ||
| return $this->in_transaction; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, nice.
| * Execute the "BEGIN" or "START TRANSACTION" MySQL statement in SQLite. | ||
| */ | ||
| private function begin_user_transaction(): void { | ||
| // MySQL implicitly commits previous transaction when starting a new one. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL, really good digging
Extracting smaller chunks from #291 so we can review and merge them independently.
This PR includes the following changes:
ATTR_ERRMODEsetting.PDO::inTransaction()on PHP < 8.4, where it is not reliable (issue, PR).