Commit 30553aa3 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-15914: Fast path for rw_trx_hash::find()

rw_trx_hash_t::find(): Implement a fast path for looking up
the current transaction. This helps transactions that visit
rows modified by themselves.
parent 6e42d19f
......@@ -627,6 +627,12 @@ class rw_trx_hash_t
*/
if (!trx_id)
return NULL;
if (caller_trx && caller_trx->id == trx_id)
{
if (do_ref_count)
caller_trx->reference();
return caller_trx;
}
trx_t *trx= 0;
LF_PINS *pins= caller_trx ? get_pins(caller_trx) : lf_hash_get_pins(&hash);
......
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