Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PS-3951: Fix decreasing status counters
Status counters were cleaned in THD::release_resources, before an optional thread cleanup. The cleanup could possibly perform a rollback, or other counter-increasing operations. In this case, these additions to the thread local counters were lost during the destruction of the thread, but were visible for a short time, before the thread was removed from the global thread list. This change avoids this issue by moving the global counter update to the end of the release_resources method, ensuring that possible counter-changing operation happen before it.
- Loading branch information
Showing
3 changed files
with
44 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CREATE TABLE t1 (i INTEGER); | ||
INSERT INTO t1 VALUES (1); | ||
SET AUTOCOMMIT=0; | ||
START TRANSACTION; | ||
DELETE FROM t1; | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Bug 90351: status counters decrease on thread destruction | ||
# | ||
--source include/have_innodb.inc | ||
--source include/count_sessions.inc | ||
|
||
connect (con1,localhost,root,,); | ||
|
||
connection con1; | ||
CREATE TABLE t1 (i INTEGER); | ||
INSERT INTO t1 VALUES (1); | ||
let $con1_id= `SELECT connection_id()`; | ||
SET AUTOCOMMIT=0; | ||
START TRANSACTION; | ||
DELETE FROM t1; | ||
|
||
connection default; | ||
--disable_query_log | ||
eval KILL $con1_id; | ||
--enable_query_log | ||
|
||
connection default; | ||
DROP TABLE t1; | ||
|
||
disconnect con1; | ||
--source include/wait_until_count_sessions.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters