1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

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.
This commit is contained in:
Marc Alff
2013-01-02 11:00:55 +01:00
parent 5ff0148e39
commit cc2df0069d
10 changed files with 335 additions and 0 deletions

View File

@ -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;