~ubuntu-branches/ubuntu/maverick/mysql-5.1/maverick-proposed

« back to all changes in this revision

Viewing changes to storage/innodb_plugin/include/dict0dict.ic

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 14:16:05 UTC
  • mto: This revision was merged to the branch mainline in revision 20.
  • Revision ID: package-import@ubuntu.com-20120222141605-nxlu9yzc6attylc2
Tags: upstream-5.1.61
ImportĀ upstreamĀ versionĀ 5.1.61

Show diffs side-by-side

added added

removed removed

Lines of Context:
452
452
        return(dict_table_flags_to_zip_size(table->flags));
453
453
}
454
454
 
 
455
/*********************************************************************//**
 
456
Obtain exclusive locks on all index trees of the table. This is to prevent
 
457
accessing index trees while InnoDB is updating internal metadata for
 
458
operations such as truncate tables. */
 
459
UNIV_INLINE
 
460
void
 
461
dict_table_x_lock_indexes(
 
462
/*======================*/
 
463
        dict_table_t*   table)  /*!< in: table */
 
464
{
 
465
        dict_index_t*   index;
 
466
 
 
467
        ut_a(table);
 
468
        ut_ad(mutex_own(&(dict_sys->mutex)));
 
469
 
 
470
        /* Loop through each index of the table and lock them */
 
471
        for (index = dict_table_get_first_index(table);
 
472
             index != NULL;
 
473
             index = dict_table_get_next_index(index)) {
 
474
                rw_lock_x_lock(dict_index_get_lock(index));
 
475
        }
 
476
}
 
477
 
 
478
/*********************************************************************//**
 
479
Release the exclusive locks on all index tree. */
 
480
UNIV_INLINE
 
481
void
 
482
dict_table_x_unlock_indexes(
 
483
/*========================*/
 
484
        dict_table_t*   table)  /*!< in: table */
 
485
{
 
486
        dict_index_t*   index;
 
487
 
 
488
        ut_a(table);
 
489
        ut_ad(mutex_own(&(dict_sys->mutex)));
 
490
 
 
491
        for (index = dict_table_get_first_index(table);
 
492
             index != NULL;
 
493
             index = dict_table_get_next_index(index)) {
 
494
                rw_lock_x_unlock(dict_index_get_lock(index));
 
495
        }
 
496
}
455
497
/********************************************************************//**
456
498
Gets the number of fields in the internal representation of an index,
457
499
including fields added by the dictionary system.