~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/dict/dict0dict.c

  • Committer: Monty Taylor
  • Date: 2010-11-26 22:50:54 UTC
  • mfrom: (1953.1.6 build)
  • Revision ID: mordred@inaugust.com-20101126225054-sg90svw8579t5p3i
Stewart - InnoDB 1.1.1
Monty - Fixed some autoconf tests which were returning false positives.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
on the mode in trx_struct::dict_operation_lock_mode */
70
70
UNIV_INTERN rw_lock_t   dict_operation_lock;
71
71
 
 
72
/* Keys to register rwlocks and mutexes with performance schema */
 
73
#ifdef UNIV_PFS_RWLOCK
 
74
UNIV_INTERN mysql_pfs_key_t     dict_operation_lock_key;
 
75
UNIV_INTERN mysql_pfs_key_t     index_tree_rw_lock_key;
 
76
#endif /* UNIV_PFS_RWLOCK */
 
77
 
 
78
#ifdef UNIV_PFS_MUTEX
 
79
UNIV_INTERN mysql_pfs_key_t     dict_sys_mutex_key;
 
80
UNIV_INTERN mysql_pfs_key_t     dict_foreign_err_mutex_key;
 
81
#endif /* UNIV_PFS_MUTEX */
 
82
 
72
83
#define DICT_HEAP_SIZE          100     /*!< initial memory heap size when
73
84
                                        creating a table or index object */
74
85
#define DICT_POOL_PER_TABLE_HASH 512    /*!< buffer pool max size per table
81
92
 
82
93
/** array of mutexes protecting dict_index_t::stat_n_diff_key_vals[] */
83
94
#define DICT_INDEX_STAT_MUTEX_SIZE      32
84
 
mutex_t dict_index_stat_mutex[DICT_INDEX_STAT_MUTEX_SIZE];
 
95
static mutex_t  dict_index_stat_mutex[DICT_INDEX_STAT_MUTEX_SIZE];
85
96
 
86
97
/*******************************************************************//**
87
98
Tries to find column names for the index and sets the col field of the
651
662
 
652
663
        dict_sys = mem_alloc(sizeof(dict_sys_t));
653
664
 
654
 
        mutex_create(&dict_sys->mutex, SYNC_DICT);
 
665
        mutex_create(dict_sys_mutex_key, &dict_sys->mutex, SYNC_DICT);
655
666
 
656
667
        dict_sys->table_hash = hash_create(buf_pool_get_curr_size()
657
668
                                           / (DICT_POOL_PER_TABLE_HASH
663
674
 
664
675
        UT_LIST_INIT(dict_sys->table_LRU);
665
676
 
666
 
        rw_lock_create(&dict_operation_lock, SYNC_DICT_OPERATION);
 
677
        rw_lock_create(dict_operation_lock_key,
 
678
                       &dict_operation_lock, SYNC_DICT_OPERATION);
667
679
 
668
680
        dict_foreign_err_file = os_file_create_tmpfile();
669
681
        ut_a(dict_foreign_err_file);
670
682
 
671
 
        mutex_create(&dict_foreign_err_mutex, SYNC_ANY_LATCH);
 
683
        mutex_create(dict_foreign_err_mutex_key,
 
684
                     &dict_foreign_err_mutex, SYNC_ANY_LATCH);
672
685
 
673
686
        for (i = 0; i < DICT_INDEX_STAT_MUTEX_SIZE; i++) {
674
 
                mutex_create(&dict_index_stat_mutex[i], SYNC_INDEX_TREE);
 
687
          mutex_create(PFS_NOT_INSTRUMENTED,
 
688
                       &dict_index_stat_mutex[i], SYNC_INDEX_TREE);
675
689
        }
676
690
}
677
691
 
1615
1629
        new_index->stat_n_leaf_pages = 1;
1616
1630
 
1617
1631
        new_index->page = page_no;
1618
 
        rw_lock_create(&new_index->lock, SYNC_INDEX_TREE);
 
1632
        rw_lock_create(index_tree_rw_lock_key, &new_index->lock,
 
1633
                       SYNC_INDEX_TREE);
1619
1634
 
1620
1635
        if (!UNIV_UNLIKELY(new_index->type & DICT_UNIVERSAL)) {
1621
1636
 
3804
3819
        dict_foreign_t*         foreign;
3805
3820
        ibool                   success;
3806
3821
        char*                   str;
3807
 
        size_t                  len;
 
3822
        size_t                  len;
3808
3823
        const char*             ptr;
3809
3824
        const char*             id;
3810
3825
        FILE*                   ef      = dict_foreign_err_file;
3819
3834
 
3820
3835
        *constraints_to_drop = mem_heap_alloc(heap, 1000 * sizeof(char*));
3821
3836
 
3822
 
        ptr = innobase_get_stmt(trx->mysql_thd, &len);
 
3837
        ptr = innobase_get_stmt(trx->mysql_thd, &len);
3823
3838
 
3824
 
        str = dict_strip_comments(ptr, len);
 
3839
        str = dict_strip_comments(ptr, len);
3825
3840
 
3826
3841
        ptr = str;
3827
3842