-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Feature GH-12576: [mysqli] Added transaction check process #12579
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -53,6 +53,14 @@ if (!have_innodb($link)) | |||
echo $exception->getMessage() . "\n"; | ||||
} | ||||
|
||||
$link = my_mysqli_connect($host, $user, $passwd, $db, $port, $socket); | ||||
mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
should be not needed because of https://wiki.php.net/rfc/mysqli_default_errmode There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's what I thought at first, but it seems like this is a global setting. If I didn't set it like this here, I ended up in warning mode. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Warning mode is set at the beginning of this test case, and if I do not change the mode with this line, the warning mode will be inherited even if I create a new mysqli instance. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see - https://github.com/php/php-src/blob/832c30f38df/ext/mysqli/tests/connect.inc#L10 - There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. right. |
||||
try { | ||||
mysqli_rollback($link); | ||||
} catch (\mysqli_sql_exception $e) { | ||||
echo $e->getMessage() . \PHP_EOL; | ||||
} | ||||
|
||||
print "done!\n"; | ||||
?> | ||||
--CLEAN-- | ||||
|
@@ -61,4 +69,5 @@ require_once 'clean_table.inc'; | |||
?> | ||||
--EXPECT-- | ||||
mysqli object is already closed | ||||
There is no active transaction | ||||
done! |
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.
to test if the first
mysqli_begin_transaction
can still be commitThere 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.
The result is the same no matter which one you use. This is because the only errors that occur are due to the checks added this time.
Personally, I'm fine with either.