-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDEV-35852 : ASAN heap-use-after-free in WSREP_DEBUG after INSERT DEL…
…AYED Problem was that in case of INSERT DELAYED thd->query() is freed before we call trans_rollback where WSREP_DEBUG could access thd->query() in wsrep_thd_query(). Fix is to reset thd->query() to NULL in delayed_insert destructor after it is freed. There is already null guard at wsrep_thd_query().
- Loading branch information
1 parent
a6ab0e6
commit 5bacb09
Showing
6 changed files
with
33 additions
and
6 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,8 @@ | ||
connection node_2; | ||
connection node_1; | ||
CREATE TABLE t (a INT) ENGINE=InnoDB; | ||
INSERT DELAYED INTO t VALUES (); | ||
ERROR HY000: DELAYED option not supported for table 't' | ||
DROP TABLE t; | ||
INSERT DELAYED t1 () VALUES (); | ||
ERROR 42S02: Table 'test.t1' doesn't exist |
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,4 @@ | ||
!include ../galera_2nodes.cnf | ||
|
||
[mysqld] | ||
wsrep-debug=1 |
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,9 @@ | ||
--source include/galera_cluster.inc | ||
|
||
CREATE TABLE t (a INT) ENGINE=InnoDB; | ||
--error ER_DELAYED_NOT_SUPPORTED | ||
INSERT DELAYED INTO t VALUES (); | ||
DROP TABLE t; | ||
|
||
--error ER_NO_SUCH_TABLE | ||
INSERT DELAYED t1 () VALUES (); |
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* Copyright 2018-2024 Codership Oy <[email protected]> | ||
/* Copyright 2018-2025 Codership Oy <[email protected]> | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
|
@@ -86,7 +86,9 @@ extern "C" const char *wsrep_thd_query(const THD *thd) | |
return "SET PASSWORD"; | ||
/* fallthrough */ | ||
default: | ||
{ | ||
return (thd->query() ? thd->query() : "NULL"); | ||
} | ||
} | ||
return "NULL"; | ||
} | ||
|
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