diff options
author | Sergei Golubchik <sergii@pisem.net> | 2012-09-04 19:11:06 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2012-09-04 19:11:06 +0200 |
commit | 1f92707978d411a051b2bfa46ed361f60861ff73 (patch) | |
tree | dc801467aa72568a44cef9e9f8ddfc87588cecc0 /mysys/lf_hash.c | |
parent | 0b5564b86c29d00ed3b28c9112d09214ea266d23 (diff) | |
download | mariadb-git-1f92707978d411a051b2bfa46ed361f60861ff73.tar.gz |
MDEV-481 Assertion `pins->pin[i] == 0' failed in _lf_pinbox_put_pins on concurrent OPTIMIZE TABLE and DML with Aria tables
A bug in the lock-free hash implementation!
when lsearch() has not found the key, the caller needs to unpin all the three pins,
because lsearch() was using all the three.
Diffstat (limited to 'mysys/lf_hash.c')
-rw-r--r-- | mysys/lf_hash.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/mysys/lf_hash.c b/mysys/lf_hash.c index 83cfe1a1639..38b212c65f0 100644 --- a/mysys/lf_hash.c +++ b/mysys/lf_hash.c @@ -268,8 +268,10 @@ static LF_SLIST *lsearch(LF_SLIST * volatile *head, CHARSET_INFO *cs, int res= lfind(head, cs, hashnr, key, keylen, &cursor, pins); if (res) _lf_pin(pins, 2, cursor.curr); - _lf_unpin(pins, 0); + else + _lf_unpin(pins, 2); _lf_unpin(pins, 1); + _lf_unpin(pins, 0); return res ? cursor.curr : 0; } |