~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/include/dict0dict.ic

  • Committer: Stewart Smith
  • Author(s): Jimmy Yang, Stewart Smith
  • Date: 2010-12-03 03:58:24 UTC
  • mto: (2021.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1986.
  • Revision ID: stewart@flamingspork.com-20101203035824-tb3kvq1pvgzwox2r
Merge Revision revid:jimmy.yang@oracle.com-20100804103744-vbpeghipkz6pyc9z from MySQL InnoDB

Original revid:jimmy.yang@oracle.com-20100804103744-vbpeghipkz6pyc9z

Original Authors: Jimmy Yang <jimmy.yang@oracle.com>
Original commit message:
Fix bug #54678, InnoDB, TRUNCATE, ALTER, I_S SELECT, crash or deadlock

rb://399 approved by Sunny Bains

Show diffs side-by-side

added added

removed removed

Lines of Context:
491
491
        return(dict_table_flags_to_zip_size(table->flags));
492
492
}
493
493
 
 
494
/*********************************************************************//**
 
495
Obtain exclusive locks on all index trees of the table. This is to prevent
 
496
accessing index trees while InnoDB is updating internal metadata for
 
497
operations such as truncate tables. */
 
498
UNIV_INLINE
 
499
void
 
500
dict_table_x_lock_indexes(
 
501
/*======================*/
 
502
        dict_table_t*   table)  /*!< in: table */
 
503
{
 
504
        dict_index_t*   index;
 
505
 
 
506
        ut_a(table);
 
507
        ut_ad(mutex_own(&(dict_sys->mutex)));
 
508
 
 
509
        /* Loop through each index of the table and lock them */
 
510
        for (index = dict_table_get_first_index(table);
 
511
             index != NULL;
 
512
             index = dict_table_get_next_index(index)) {
 
513
                rw_lock_x_lock(dict_index_get_lock(index));
 
514
        }
 
515
}
 
516
 
 
517
/*********************************************************************//**
 
518
Release the exclusive locks on all index tree. */
 
519
UNIV_INLINE
 
520
void
 
521
dict_table_x_unlock_indexes(
 
522
/*========================*/
 
523
        dict_table_t*   table)  /*!< in: table */
 
524
{
 
525
        dict_index_t*   index;
 
526
 
 
527
        ut_a(table);
 
528
        ut_ad(mutex_own(&(dict_sys->mutex)));
 
529
 
 
530
        for (index = dict_table_get_first_index(table);
 
531
             index != NULL;
 
532
             index = dict_table_get_next_index(index)) {
 
533
                rw_lock_x_unlock(dict_index_get_lock(index));
 
534
        }
 
535
}
494
536
/********************************************************************//**
495
537
Gets the number of fields in the internal representation of an index,
496
538
including fields added by the dictionary system.