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.
This commit is contained in:
Marko Mäkelä 2018-04-25 08:50:56 +03:00
parent 6e42d19f25
commit 30553aa37b

View file

@ -627,6 +627,12 @@ public:
*/
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);