Commit 4799af09 authored by Vicențiu Ciorbaru's avatar Vicențiu Ciorbaru

Fix unit test after merge from mysql 5.5.35 perfschema

The problem in MariaDB is introduced by this merge commit:
c33db2cd

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.
parent d00d46f4
...@@ -1316,6 +1316,7 @@ void test_locker_disabled() ...@@ -1316,6 +1316,7 @@ void test_locker_disabled()
/* Pretend the socket does not have a thread owner */ /* Pretend the socket does not have a thread owner */
/* ---------------------------------------------- */ /* ---------------------------------------------- */
psi->delete_current_thread();
socket_class_A->m_enabled= true; socket_class_A->m_enabled= true;
socket_A1= psi->init_socket(socket_key_A, NULL, NULL, 0); socket_A1= psi->init_socket(socket_key_A, NULL, NULL, 0);
ok(socket_A1 != NULL, "instrumented"); ok(socket_A1 != NULL, "instrumented");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment