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

« back to all changes in this revision

Viewing changes to storage/innodb_plugin/ibuf/ibuf0ibuf.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-02-22 08:30:45 UTC
  • mfrom: (1.4.1)
  • Revision ID: package-import@ubuntu.com-20120222083045-2rd53r4bnyx7qus4
Tags: 5.1.61-0ubuntu0.11.04.1
* SECURITY UPDATE: Update to 5.1.61 to fix multiple security issues
  (LP: #937869)
  - http://www.oracle.com/technetwork/topics/security/cpujan2012-366304.html
  - CVE-2011-2262
  - CVE-2012-0075
  - CVE-2012-0112
  - CVE-2012-0113
  - CVE-2012-0114
  - CVE-2012-0115
  - CVE-2012-0116
  - CVE-2012-0117
  - CVE-2012-0118
  - CVE-2012-0119
  - CVE-2012-0120
  - CVE-2012-0484
  - CVE-2012-0485
  - CVE-2012-0486
  - CVE-2012-0487
  - CVE-2012-0488
  - CVE-2012-0489
  - CVE-2012-0490
  - CVE-2012-0491
  - CVE-2012-0492
  - CVE-2012-0493
  - CVE-2012-0494
  - CVE-2012-0495
  - CVE-2012-0496

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 1997, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 1997, 2011, Oracle and/or its affiliates. All Rights Reserved.
4
4
 
5
5
This program is free software; you can redistribute it and/or modify it under
6
6
the terms of the GNU General Public License as published by the Free Software
356
356
        block = buf_page_get(
357
357
                IBUF_SPACE_ID, 0, FSP_IBUF_TREE_ROOT_PAGE_NO, RW_X_LATCH, mtr);
358
358
 
359
 
        buf_block_dbg_add_level(block, SYNC_TREE_NODE);
 
359
        buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE);
360
360
 
361
361
        return(buf_block_get_frame(block));
362
362
}
496
496
                block = buf_page_get(
497
497
                        IBUF_SPACE_ID, 0, FSP_IBUF_TREE_ROOT_PAGE_NO,
498
498
                        RW_X_LATCH, &mtr);
499
 
                buf_block_dbg_add_level(block, SYNC_TREE_NODE);
 
499
                buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE);
500
500
 
501
501
                root = buf_block_get_frame(block);
502
502
        }
1766
1766
                block = buf_page_get(
1767
1767
                        IBUF_SPACE_ID, 0, page_no, RW_X_LATCH, &mtr);
1768
1768
 
1769
 
                buf_block_dbg_add_level(block, SYNC_TREE_NODE_NEW);
1770
 
 
 
1769
                ibuf_enter();
 
1770
 
 
1771
                mutex_enter(&ibuf_mutex);
 
1772
 
 
1773
                root = ibuf_tree_root_get(&mtr);
 
1774
 
 
1775
                buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE_NEW);
1771
1776
 
1772
1777
                page = buf_block_get_frame(block);
1773
1778
        }
1774
1779
 
1775
 
        ibuf_enter();
1776
 
 
1777
 
        mutex_enter(&ibuf_mutex);
1778
 
 
1779
 
        root = ibuf_tree_root_get(&mtr);
1780
 
 
1781
1780
        /* Add the page to the free list and update the ibuf size data */
1782
1781
 
1783
1782
        flst_add_last(root + PAGE_HEADER + PAGE_BTR_IBUF_FREE_LIST,
1878
1877
        fseg_free_page(header_page + IBUF_HEADER + IBUF_TREE_SEG_HEADER,
1879
1878
                       IBUF_SPACE_ID, page_no, &mtr);
1880
1879
 
1881
 
#ifdef UNIV_DEBUG_FILE_ACCESSES
 
1880
#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
1882
1881
        buf_page_reset_file_page_was_freed(IBUF_SPACE_ID, page_no);
1883
 
#endif
 
1882
#endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
1884
1883
 
1885
1884
        ibuf_enter();
1886
1885
 
1897
1896
                block = buf_page_get(
1898
1897
                        IBUF_SPACE_ID, 0, page_no, RW_X_LATCH, &mtr);
1899
1898
 
1900
 
                buf_block_dbg_add_level(block, SYNC_TREE_NODE);
1901
 
 
 
1899
                buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE);
1902
1900
 
1903
1901
                page = buf_block_get_frame(block);
1904
1902
        }
1922
1920
        ibuf_bitmap_page_set_bits(
1923
1921
                bitmap_page, page_no, zip_size, IBUF_BITMAP_IBUF, FALSE, &mtr);
1924
1922
 
1925
 
#ifdef UNIV_DEBUG_FILE_ACCESSES
 
1923
#if defined UNIV_DEBUG_FILE_ACCESSES || defined UNIV_DEBUG
1926
1924
        buf_page_set_file_page_was_freed(IBUF_SPACE_ID, page_no);
1927
 
#endif
 
1925
#endif /* UNIV_DEBUG_FILE_ACCESSES || UNIV_DEBUG */
1928
1926
        mtr_commit(&mtr);
1929
1927
 
1930
1928
        mutex_exit(&ibuf_mutex);
2408
2406
                block = buf_page_get(
2409
2407
                        IBUF_SPACE_ID, 0, prev_page_no, RW_X_LATCH, mtr);
2410
2408
 
2411
 
                buf_block_dbg_add_level(block, SYNC_TREE_NODE);
 
2409
                buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE);
2412
2410
 
2413
2411
 
2414
2412
                prev_page = buf_block_get_frame(block);
2482
2480
                block = buf_page_get(
2483
2481
                        IBUF_SPACE_ID, 0, next_page_no, RW_X_LATCH, mtr);
2484
2482
 
2485
 
                buf_block_dbg_add_level(block, SYNC_TREE_NODE);
 
2483
                buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE);
2486
2484
 
2487
2485
 
2488
2486
                next_page = buf_block_get_frame(block);
2973
2971
 
2974
2972
        ut_ad(ibuf_inside());
2975
2973
        ut_ad(dtuple_check_typed(entry));
2976
 
        ut_ad(!buf_block_align(page)->is_hashed);
 
2974
        ut_ad(!buf_block_align(page)->index);
2977
2975
 
2978
2976
        if (UNIV_UNLIKELY(dict_table_is_comp(index->table)
2979
2977
                          != (ibool)!!page_is_comp(page))) {
3248
3246
        ut_ad(!block || buf_block_get_space(block) == space);
3249
3247
        ut_ad(!block || buf_block_get_page_no(block) == page_no);
3250
3248
        ut_ad(!block || buf_block_get_zip_size(block) == zip_size);
 
3249
        ut_ad(!block || buf_block_get_io_fix(block) == BUF_IO_READ);
3251
3250
 
3252
3251
        if (srv_force_recovery >= SRV_FORCE_NO_IBUF_MERGE
3253
3252
            || trx_sys_hdr_page(space, page_no)) {
3403
3402
 
3404
3403
                ut_a(success);
3405
3404
 
3406
 
                buf_block_dbg_add_level(block, SYNC_TREE_NODE);
 
3405
                /* This is a user page (secondary index leaf page),
 
3406
                but we pretend that it is a change buffer page in
 
3407
                order to obey the latching order. This should be OK,
 
3408
                because buffered changes are applied immediately while
 
3409
                the block is io-fixed. Other threads must not try to
 
3410
                latch an io-fixed block. */
 
3411
                buf_block_dbg_add_level(block, SYNC_IBUF_TREE_NODE);
3407
3412
        }
3408
3413
 
3409
3414
        /* Position pcur in the insert buffer at the first entry for this