mariadb/mysql-test/r/assign_key_cache-5405.result
Sergei Golubchik b4dd13b519 MDEV-5405 RQG induced crash in mi_assign_to_key_cache in safe mutex unlock
if two threads were calling mi_assign_to_key_cache() for the same table,
one could change share->key_cache while the other was having
share->key_cache->op_lock locked. The other thread would crash then,
trying to unlock share->key_cache->op_lock (because it would be a different mutex).

fixed by caching the value of share->key_cache in a local variable. The thread can still
call flush_key_blocks() for an unassigned keycache, but it's harmless.
2014-01-27 12:11:04 +01:00

14 lines
516 B
Text

create table t1 (f int, key(f)) engine=myisam;
set global kc1.key_buffer_size = 65536;
set debug_sync='assign_key_cache_op_unlock wait_for op_locked';
cache index t1 in kc1;
set debug_sync='assign_key_cache_op_lock signal op_locked wait_for assigned';
cache index t1 in kc1;
Table Op Msg_type Msg_text
test.t1 assign_to_keycache status OK
set debug_sync='now signal assigned';
Table Op Msg_type Msg_text
test.t1 assign_to_keycache status OK
drop table t1;
set global kc1.key_buffer_size = 0;
set debug_sync='reset';