diff options
author | Marc Alff <marc.alff@oracle.com> | 2013-01-02 11:00:55 +0100 |
---|---|---|
committer | Marc Alff <marc.alff@oracle.com> | 2013-01-02 11:00:55 +0100 |
commit | cc2df0069dc185421dc85ce7ab4bdff5e09020a6 (patch) | |
tree | 2adf3a4f46ce6266f19b6220b419e5e08c9c00f9 /storage | |
parent | 5ff0148e3983ca30deeaca5495ace3b7218c880f (diff) | |
download | mariadb-git-cc2df0069dc185421dc85ce7ab4bdff5e09020a6.tar.gz |
Bug#16060864 SEGMENTATION FAULT IN PERFORMANCE_SCHEMA WITH HISTORY SIZE 0
Before this fix, configuring the server with:
- performance_schema_events_waits_history_size=0
- performance_schema_events_waits_history_long_size=0
could cause a crash in the performance schema.
These settings to 0 are intended to be valid and supported,
and are in fact working properly in mysql 5.6 and up already.
This fix backports the code fix and test cases from mysql 5.6
to the mysql 5.5 release.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/perfschema/pfs_events_waits.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/storage/perfschema/pfs_events_waits.cc b/storage/perfschema/pfs_events_waits.cc index b6cadf9e61c..a941f815dca 100644 --- a/storage/perfschema/pfs_events_waits.cc +++ b/storage/perfschema/pfs_events_waits.cc @@ -93,6 +93,9 @@ static inline void copy_events_waits(PFS_events_waits *dest, */ void insert_events_waits_history(PFS_thread *thread, PFS_events_waits *wait) { + if (unlikely(events_waits_history_per_thread == 0)) + return; + uint index= thread->m_waits_history_index; /* @@ -120,6 +123,9 @@ void insert_events_waits_history(PFS_thread *thread, PFS_events_waits *wait) */ void insert_events_waits_history_long(PFS_events_waits *wait) { + if (unlikely(events_waits_history_long_size == 0)) + return; + uint index= PFS_atomic::add_u32(&events_waits_history_long_index, 1); index= index % events_waits_history_long_size; |