diff options
author | Marc Alff <marc.alff@oracle.com> | 2011-03-08 13:42:00 +0100 |
---|---|---|
committer | Marc Alff <marc.alff@oracle.com> | 2011-03-08 13:42:00 +0100 |
commit | 627707e2f8bc40c43b7f1ac04f12dbc3f65992f2 (patch) | |
tree | 3d4a101755048f040474524a86dd296cb49d2bc0 | |
parent | 984988cfbd559ee31a15b0ea1035a609ff6538c3 (diff) | |
download | mariadb-git-627707e2f8bc40c43b7f1ac04f12dbc3f65992f2.tar.gz |
Bug#11830755 - UNIT TESTS PFS_INSTR AND PFS_INSTR_CLASS CRASH IN MUTEX CALLS ON WINDOWS
Before this fix, two performance schema unit tests crashed on windows.
The problem was a missing initialization to PFS_atomics,
which caused the crash only for platform not compiled with native atomics.
This fix adds the missing initialization in the unit tests.
No production code was changed, this is a unit test bug only.
-rw-r--r-- | storage/perfschema/unittest/pfs-t.cc | 2 | ||||
-rw-r--r-- | storage/perfschema/unittest/pfs_instr-oom-t.cc | 4 | ||||
-rw-r--r-- | storage/perfschema/unittest/pfs_instr-t.cc | 4 | ||||
-rw-r--r-- | storage/perfschema/unittest/pfs_instr_class-oom-t.cc | 4 | ||||
-rw-r--r-- | storage/perfschema/unittest/pfs_instr_class-t.cc | 4 | ||||
-rw-r--r-- | storage/perfschema/unittest/pfs_timer-t.cc | 4 |
6 files changed, 22 insertions, 0 deletions
diff --git a/storage/perfschema/unittest/pfs-t.cc b/storage/perfschema/unittest/pfs-t.cc index 20e736a546f..46e02306aca 100644 --- a/storage/perfschema/unittest/pfs-t.cc +++ b/storage/perfschema/unittest/pfs-t.cc @@ -1205,6 +1205,8 @@ void test_enabled() void do_all_tests() { + /* Using initialize_performance_schema(), no partial init needed. */ + test_bootstrap(); test_bad_registration(); test_init_disabled(); diff --git a/storage/perfschema/unittest/pfs_instr-oom-t.cc b/storage/perfschema/unittest/pfs_instr-oom-t.cc index 13335326932..a00afe8b36a 100644 --- a/storage/perfschema/unittest/pfs_instr-oom-t.cc +++ b/storage/perfschema/unittest/pfs_instr-oom-t.cc @@ -199,7 +199,11 @@ void test_oom() void do_all_tests() { + PFS_atomic::init(); + test_oom(); + + PFS_atomic::cleanup(); } int main(int, char **) diff --git a/storage/perfschema/unittest/pfs_instr-t.cc b/storage/perfschema/unittest/pfs_instr-t.cc index 2ef9a5769ca..b13135aa615 100644 --- a/storage/perfschema/unittest/pfs_instr-t.cc +++ b/storage/perfschema/unittest/pfs_instr-t.cc @@ -400,10 +400,14 @@ void test_per_thread_wait() void do_all_tests() { + PFS_atomic::init(); + test_no_instruments(); test_no_instances(); test_with_instances(); test_per_thread_wait(); + + PFS_atomic::cleanup(); } int main(int, char **) diff --git a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc index 9ccaf432ba2..95dccc420d7 100644 --- a/storage/perfschema/unittest/pfs_instr_class-oom-t.cc +++ b/storage/perfschema/unittest/pfs_instr_class-oom-t.cc @@ -47,7 +47,11 @@ void test_oom() void do_all_tests() { + PFS_atomic::init(); + test_oom(); + + PFS_atomic::cleanup(); } int main(int, char **) diff --git a/storage/perfschema/unittest/pfs_instr_class-t.cc b/storage/perfschema/unittest/pfs_instr_class-t.cc index f9a1ee510b1..ac34f082fe8 100644 --- a/storage/perfschema/unittest/pfs_instr_class-t.cc +++ b/storage/perfschema/unittest/pfs_instr_class-t.cc @@ -554,6 +554,8 @@ void test_instruments_reset() void do_all_tests() { + PFS_atomic::init(); + test_no_registration(); test_mutex_registration(); test_rwlock_registration(); @@ -562,6 +564,8 @@ void do_all_tests() test_file_registration(); test_table_registration(); test_instruments_reset(); + + PFS_atomic::cleanup(); } int main(int, char **) diff --git a/storage/perfschema/unittest/pfs_timer-t.cc b/storage/perfschema/unittest/pfs_timer-t.cc index d8663c5ccda..69b554c7b31 100644 --- a/storage/perfschema/unittest/pfs_timer-t.cc +++ b/storage/perfschema/unittest/pfs_timer-t.cc @@ -105,7 +105,11 @@ void test_timers() void do_all_tests() { + PFS_atomic::init(); + test_timers(); + + PFS_atomic::cleanup(); } int main(int, char **) |