summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2017-01-10 14:20:43 +0200
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2017-01-10 14:20:43 +0200
commit4799af092574e7957d7143c7751acef74a95a495 (patch)
tree1b9e4128b54a1990acd98f923e726adbde092847
parentd00d46f4ced0d7202b30b23c19ef982324069290 (diff)
downloadmariadb-git-4799af092574e7957d7143c7751acef74a95a495.tar.gz
Fix unit test after merge from mysql 5.5.35 perfschema
The problem in MariaDB is introduced by this merge commit: c33db2cdc0ab70a874060d58710895f6dac3dea3 The merge comes from mysql and the original author comes from this commit from MySQL: ------------------------------------------------ commit 160b823d146288d66638e4a740d6d2da72f9a689 Author: Marc Alff <marc.alff@oracle.com> Date: Tue Aug 30 12:14:07 2016 +0200 Bug#22551677 SIGNAL 11 IN LF_PINBOX_PUT_PINS Backport to 5.6 ------------------------------------------------ The breaking change is in start_socket_wait_v1 where instead of using m_thread_owner, we make use of my_pthread_getspecific_ptr to fetch a thread local storage value. Unfortunately this invalidates the "m_thread_owner" member when a socket is created. The internals of the socket structure have m_thread_owner set to NULL, but when checking for ownership we actually look at the current thread's key store. This seems incorrect however it is not immediately apparent why. To not diverge from MySQL's reasoning as it is not described what the actual problem was that this commit is trying to fix, I have adjusted the unittest to account for this new behaviour. We destroy the current thread in the unit test, such that the newly created socket actually has no thread owner. The m_thread_owner is untouched in all this.
-rw-r--r--storage/perfschema/unittest/pfs-t.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/storage/perfschema/unittest/pfs-t.cc b/storage/perfschema/unittest/pfs-t.cc
index 6121fac098f..f76b1aa2e75 100644
--- a/storage/perfschema/unittest/pfs-t.cc
+++ b/storage/perfschema/unittest/pfs-t.cc
@@ -1316,6 +1316,7 @@ void test_locker_disabled()
/* Pretend the socket does not have a thread owner */
/* ---------------------------------------------- */
+ psi->delete_current_thread();
socket_class_A->m_enabled= true;
socket_A1= psi->init_socket(socket_key_A, NULL, NULL, 0);
ok(socket_A1 != NULL, "instrumented");