Commit 8d96bcda authored by Guilhem Bichot's avatar Guilhem Bichot

During Maria's checkpoint, use the proper mutex to read transaction's short_id

storage/maria/trnman.c:
  During Maria's checkpoint, we walk the list of active transactions; in this list we may find a transaction with a short_id of 0 which means "uninitialized" (is being created right now) and want to ignore this transaction. Such short_id is set under trn->state_lock, so use this mutex to reliably read short_id during checkpoint.
parent f36a9625
......@@ -682,7 +682,10 @@ my_bool trnman_collect_transactions(LEX_STRING *str_act, LEX_STRING *str_com,
*/
uint sid;
LSN rec_lsn, undo_lsn, first_undo_lsn;
if ((sid= trn->short_id) == 0)
pthread_mutex_lock(&trn->state_lock);
sid= trn->short_id;
pthread_mutex_unlock(&trn->state_lock);
if (sid == 0)
{
/*
Not even inited, has done nothing. Or it is the
......
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