~percona-core/percona-server/5.5

« back to all changes in this revision

Viewing changes to Percona-Server/storage/innobase/include/trx0sys.ic

  • Committer: jenkins at percona
  • Date: 2013-03-26 01:40:02 UTC
  • mfrom: (450.9.2 bug1131189)
  • Revision ID: jenkins@jenkins.percona.com-20130326014002-1m2hg8pt1b27chq2
MergeĀ lp:~akopytov/percona-server/bug1131189

Show diffs side-by-side

added added

removed removed

Lines of Context:
367
367
/*==========*/
368
368
        trx_id_t        trx_id) /*!< in: trx id of the transaction */
369
369
{
370
 
        trx_t*  trx;
371
 
 
372
370
        ut_ad(mutex_own(&(kernel_mutex)));
373
371
 
374
 
        if (trx_id < trx_list_get_min_trx_id()) {
375
 
 
376
 
                return(FALSE);
377
 
        }
378
 
 
379
 
        if (UNIV_UNLIKELY(trx_id >= trx_sys->max_trx_id)) {
380
 
 
381
 
                /* There must be corruption: we return TRUE because this
382
 
                function is only called by lock_clust_rec_some_has_impl()
383
 
                and row_vers_impl_x_locked_off_kernel() and they have
384
 
                diagnostic prints in this case */
385
 
 
386
 
                return(TRUE);
387
 
        }
388
 
 
389
 
        trx = trx_get_on_id(trx_id);
390
 
        if (trx && (trx->conc_state == TRX_ACTIVE
391
 
                    || trx->conc_state == TRX_PREPARED)) {
 
372
        if (trx_find_descriptor(trx_sys->descriptors,
 
373
                                trx_sys->descr_n_used,
 
374
                                trx_id)) {
392
375
 
393
376
                return(TRUE);
394
377
        }
425
408
        return(id);
426
409
}
427
410
 
 
411
 
 
412
/*************************************************************//**
 
413
Find a slot for a given trx ID in a descriptors array.
 
414
@return: slot pointer */
 
415
UNIV_INLINE
 
416
trx_id_t*
 
417
trx_find_descriptor(
 
418
/*================*/
 
419
        const trx_id_t* descriptors,    /*!< in: descriptors array */
 
420
        ulint           n_descr,        /*!< in: array size */
 
421
        trx_id_t        trx_id)         /*!< in: trx pointer */
 
422
{
 
423
        ut_ad(descriptors != trx_sys->descriptors ||
 
424
              mutex_own(&kernel_mutex));
 
425
 
 
426
        if (UNIV_UNLIKELY(n_descr == 0)) {
 
427
 
 
428
                return(NULL);
 
429
        }
 
430
 
 
431
        return((trx_id_t *) bsearch(&trx_id, descriptors, n_descr,
 
432
                                    sizeof(trx_id_t), trx_descr_cmp));
 
433
}
428
434
#endif /* !UNIV_HOTBACKUP */