Commit d2fafd92 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

Cherrypick fix for -DWITH_SSL=system by Marc Alff (Bug#50513)

parent 888cbbbd
...@@ -16,8 +16,10 @@ wait/synch/mutex/sql/LOCK_delayed_insert YES YES ...@@ -16,8 +16,10 @@ wait/synch/mutex/sql/LOCK_delayed_insert YES YES
wait/synch/mutex/sql/LOCK_delayed_status YES YES wait/synch/mutex/sql/LOCK_delayed_status YES YES
select * from performance_schema.SETUP_INSTRUMENTS select * from performance_schema.SETUP_INSTRUMENTS
where name like 'Wait/Synch/Rwlock/sql/%' where name like 'Wait/Synch/Rwlock/sql/%'
order by name limit 10; and name not in ('wait/synch/mutex/sql/CRYPTO_dynlock_value::lock')
order by name limit 10;
NAME ENABLED TIMED NAME ENABLED TIMED
wait/synch/rwlock/sql/CRYPTO_dynlock_value::lock YES YES
wait/synch/rwlock/sql/LOCK_dboptions YES YES wait/synch/rwlock/sql/LOCK_dboptions YES YES
wait/synch/rwlock/sql/LOCK_grant YES YES wait/synch/rwlock/sql/LOCK_grant YES YES
wait/synch/rwlock/sql/LOCK_system_variables_hash YES YES wait/synch/rwlock/sql/LOCK_system_variables_hash YES YES
......
...@@ -36,8 +36,11 @@ select * from performance_schema.SETUP_INSTRUMENTS ...@@ -36,8 +36,11 @@ select * from performance_schema.SETUP_INSTRUMENTS
and name not in ('wait/synch/mutex/sql/DEBUG_SYNC::mutex') and name not in ('wait/synch/mutex/sql/DEBUG_SYNC::mutex')
order by name limit 10; order by name limit 10;
# CRYPTO_dynlock_value::lock is dependent on the build (SSL)
select * from performance_schema.SETUP_INSTRUMENTS select * from performance_schema.SETUP_INSTRUMENTS
where name like 'Wait/Synch/Rwlock/sql/%' where name like 'Wait/Synch/Rwlock/sql/%'
and name not in ('wait/synch/mutex/sql/CRYPTO_dynlock_value::lock')
order by name limit 10; order by name limit 10;
# COND_handler_count is dependent on the build (Windows only) # COND_handler_count is dependent on the build (Windows only)
......
...@@ -319,6 +319,10 @@ static PSI_thread_key key_thread_handle_con_sockets; ...@@ -319,6 +319,10 @@ static PSI_thread_key key_thread_handle_con_sockets;
#ifdef __WIN__ #ifdef __WIN__
static PSI_thread_key key_thread_handle_shutdown; static PSI_thread_key key_thread_handle_shutdown;
#endif /* __WIN__ */ #endif /* __WIN__ */
#if defined (HAVE_OPENSSL) && !defined(HAVE_YASSL)
static PSI_rwlock_key key_rwlock_openssl;
#endif
#endif /* HAVE_PSI_INTERFACE */ #endif /* HAVE_PSI_INTERFACE */
/* the default log output is log tables */ /* the default log output is log tables */
...@@ -1541,7 +1545,7 @@ static void clean_up_mutexes() ...@@ -1541,7 +1545,7 @@ static void clean_up_mutexes()
mysql_mutex_destroy(&LOCK_des_key_file); mysql_mutex_destroy(&LOCK_des_key_file);
#ifndef HAVE_YASSL #ifndef HAVE_YASSL
for (int i= 0; i < CRYPTO_num_locks(); ++i) for (int i= 0; i < CRYPTO_num_locks(); ++i)
rwlock_destroy(&openssl_stdlocks[i].lock); mysql_rwlock_destroy(&openssl_stdlocks[i].lock);
OPENSSL_free(openssl_stdlocks); OPENSSL_free(openssl_stdlocks);
#endif #endif
#endif #endif
...@@ -3730,7 +3734,7 @@ static int init_thread_environment() ...@@ -3730,7 +3734,7 @@ static int init_thread_environment()
openssl_stdlocks= (openssl_lock_t*) OPENSSL_malloc(CRYPTO_num_locks() * openssl_stdlocks= (openssl_lock_t*) OPENSSL_malloc(CRYPTO_num_locks() *
sizeof(openssl_lock_t)); sizeof(openssl_lock_t));
for (int i= 0; i < CRYPTO_num_locks(); ++i) for (int i= 0; i < CRYPTO_num_locks(); ++i)
my_rwlock_init(&openssl_stdlocks[i].lock, NULL); mysql_rwlock_init(key_rwlock_openssl, &openssl_stdlocks[i].lock);
CRYPTO_set_dynlock_create_callback(openssl_dynlock_create); CRYPTO_set_dynlock_create_callback(openssl_dynlock_create);
CRYPTO_set_dynlock_destroy_callback(openssl_dynlock_destroy); CRYPTO_set_dynlock_destroy_callback(openssl_dynlock_destroy);
CRYPTO_set_dynlock_lock_callback(openssl_lock); CRYPTO_set_dynlock_lock_callback(openssl_lock);
...@@ -3784,7 +3788,7 @@ static unsigned long openssl_id_function() ...@@ -3784,7 +3788,7 @@ static unsigned long openssl_id_function()
static openssl_lock_t *openssl_dynlock_create(const char *file, int line) static openssl_lock_t *openssl_dynlock_create(const char *file, int line)
{ {
openssl_lock_t *lock= new openssl_lock_t; openssl_lock_t *lock= new openssl_lock_t;
my_rwlock_init(&lock->lock, NULL); mysql_rwlock_init(key_rwlock_openssl, &lock->lock);
return lock; return lock;
} }
...@@ -3792,7 +3796,7 @@ static openssl_lock_t *openssl_dynlock_create(const char *file, int line) ...@@ -3792,7 +3796,7 @@ static openssl_lock_t *openssl_dynlock_create(const char *file, int line)
static void openssl_dynlock_destroy(openssl_lock_t *lock, const char *file, static void openssl_dynlock_destroy(openssl_lock_t *lock, const char *file,
int line) int line)
{ {
rwlock_destroy(&lock->lock); mysql_rwlock_destroy(&lock->lock);
delete lock; delete lock;
} }
...@@ -3818,16 +3822,16 @@ static void openssl_lock(int mode, openssl_lock_t *lock, const char *file, ...@@ -3818,16 +3822,16 @@ static void openssl_lock(int mode, openssl_lock_t *lock, const char *file,
switch (mode) { switch (mode) {
case CRYPTO_LOCK|CRYPTO_READ: case CRYPTO_LOCK|CRYPTO_READ:
what = "read lock"; what = "read lock";
err = rw_rdlock(&lock->lock); err= mysql_rwlock_rdlock(&lock->lock);
break; break;
case CRYPTO_LOCK|CRYPTO_WRITE: case CRYPTO_LOCK|CRYPTO_WRITE:
what = "write lock"; what = "write lock";
err = rw_wrlock(&lock->lock); err= mysql_rwlock_wrlock(&lock->lock);
break; break;
case CRYPTO_UNLOCK|CRYPTO_READ: case CRYPTO_UNLOCK|CRYPTO_READ:
case CRYPTO_UNLOCK|CRYPTO_WRITE: case CRYPTO_UNLOCK|CRYPTO_WRITE:
what = "unlock"; what = "unlock";
err = rw_unlock(&lock->lock); err= mysql_rwlock_unlock(&lock->lock);
break; break;
default: default:
/* Unknown locking mode. */ /* Unknown locking mode. */
...@@ -7965,6 +7969,9 @@ PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger, ...@@ -7965,6 +7969,9 @@ PSI_rwlock_key key_rwlock_LOCK_grant, key_rwlock_LOCK_logger,
static PSI_rwlock_info all_server_rwlocks[]= static PSI_rwlock_info all_server_rwlocks[]=
{ {
#if defined (HAVE_OPENSSL) && !defined(HAVE_YASSL)
{ &key_rwlock_openssl, "CRYPTO_dynlock_value::lock", 0},
#endif
{ &key_rwlock_LOCK_grant, "LOCK_grant", PSI_FLAG_GLOBAL}, { &key_rwlock_LOCK_grant, "LOCK_grant", PSI_FLAG_GLOBAL},
{ &key_rwlock_LOCK_logger, "LOGGER::LOCK_logger", 0}, { &key_rwlock_LOCK_logger, "LOGGER::LOCK_logger", 0},
{ &key_rwlock_LOCK_sys_init_connect, "LOCK_sys_init_connect", PSI_FLAG_GLOBAL}, { &key_rwlock_LOCK_sys_init_connect, "LOCK_sys_init_connect", PSI_FLAG_GLOBAL},
......
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