summaryrefslogtreecommitdiff
path: root/storage/perfschema
diff options
context:
space:
mode:
authorMarc Alff <marc.alff@oracle.com>2013-12-11 11:15:23 +0100
committerMarc Alff <marc.alff@oracle.com>2013-12-11 11:15:23 +0100
commitb734cd73ffb0c47da7155b3ac6869a64a15337a3 (patch)
tree958eb465600c8e9e804b66a961404a79dda58eca /storage/perfschema
parent9418fea133656d4d2254d533d8d21151c8dbc10b (diff)
downloadmariadb-git-b734cd73ffb0c47da7155b3ac6869a64a15337a3.tar.gz
Bug#17928281 'CHECK_PERFORMANCE_SCHEMA()' LEAVES 'CURRENT_THD' REFERRING
DESTRUCTED THD OBJ Prior to fix, function check_performance_schema() could leave behind stale pointers in thread local storage, for the following keys: - THR_THD (used by _current_thd) - THR_MALLOC (used for memory allocation) This is an unsafe practice, which can potentially cause crashes, and that can cause other bugs when code is modified during maintenance. With this fix, thread local storage keys used temporarily within function check_performance_schema() are cleaned up after use.
Diffstat (limited to 'storage/perfschema')
-rw-r--r--storage/perfschema/pfs_check.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/perfschema/pfs_check.cc b/storage/perfschema/pfs_check.cc
index c52be6f0da2..97b23c38065 100644
--- a/storage/perfschema/pfs_check.cc
+++ b/storage/perfschema/pfs_check.cc
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
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
@@ -55,6 +55,7 @@ void check_performance_schema()
PFS_engine_table_share::check_all_tables(thd);
+ thd->restore_globals();
delete thd;
DBUG_VOID_RETURN;
}