~stewart/drizzle/update-innobase-1.0.11

« back to all changes in this revision

Viewing changes to plugin/innobase/btr/btr0sea.c

  • Committer: Stewart Smith
  • Author(s): Jimmy Yang, Stewart Smith
  • Date: 2010-11-11 02:30:31 UTC
  • Revision ID: stewart@flamingspork.com-20101111023031-pvv8v4q03qnftoat
Merge Revision revid:jimmy.yang@oracle.com-20100701050601-i58b3e1c1o78w8ou from MySQL InnoDB

Original revid:jimmy.yang@oracle.com-20100701050601-i58b3e1c1o78w8ou

Original Authors: Jimmy Yang <jimmy.yang@oracle.com>
Original commit message:
Port fix for bug #54311 from mysql-trunk-innodb to mysql-5.1-innodb codeline.
Bug #54311: Crash on CHECK PARTITION after concurrent LOAD DATA
and adaptive_hash_index=OFF

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
/** Flag: has the search system been enabled?
47
47
Protected by btr_search_latch and btr_search_enabled_mutex. */
48
 
UNIV_INTERN bool                btr_search_enabled      = TRUE;
 
48
UNIV_INTERN bool                btr_search_enabled = TRUE;
 
49
UNIV_INTERN ibool               btr_search_fully_disabled = FALSE;
49
50
 
50
51
/** Mutex protecting btr_search_enabled */
51
52
static mutex_t                  btr_search_enabled_mutex;
201
202
        mutex_enter(&btr_search_enabled_mutex);
202
203
        rw_lock_x_lock(&btr_search_latch);
203
204
 
 
205
        /* Disable access to hash index, also tell ha_insert_for_fold()
 
206
        stop adding new nodes to hash index, but still allow updating
 
207
        existing nodes */
204
208
        btr_search_enabled = FALSE;
205
209
 
206
210
        /* Clear all block->is_hashed flags and remove all entries
207
211
        from btr_search_sys->hash_index. */
208
212
        buf_pool_drop_hash_index();
209
213
 
 
214
        /* hash index has been cleaned up, disallow any operation to
 
215
        the hash index */
 
216
        btr_search_fully_disabled = TRUE;
 
217
 
210
218
        /* btr_search_enabled_mutex should guarantee this. */
211
219
        ut_ad(!btr_search_enabled);
212
220
 
225
233
        rw_lock_x_lock(&btr_search_latch);
226
234
 
227
235
        btr_search_enabled = TRUE;
 
236
        btr_search_fully_disabled = FALSE;
228
237
 
229
238
        rw_lock_x_unlock(&btr_search_latch);
230
239
        mutex_exit(&btr_search_enabled_mutex);
1363
1372
 
1364
1373
        rw_lock_x_lock(&btr_search_latch);
1365
1374
 
1366
 
        if (UNIV_UNLIKELY(!btr_search_enabled)) {
 
1375
        if (UNIV_UNLIKELY(btr_search_fully_disabled)) {
1367
1376
                goto exit_func;
1368
1377
        }
1369
1378