~ubuntu-branches/ubuntu/saucy/mysql-5.5/saucy-security

« back to all changes in this revision

Viewing changes to storage/innobase/handler/i_s.cc

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2013-10-22 15:14:10 UTC
  • mfrom: (1.1.14)
  • Revision ID: package-import@ubuntu.com-20131022151410-5xj09x9slxhqa0fx
Tags: 5.5.34-0ubuntu0.13.10.1
* SECURITY UPDATE: Update to 5.5.34 to fix security issues (LP: #1243253)
  - http://www.oracle.com/technetwork/topics/security/cpuoct2013-1899837.html
  - CVE-2013-3839
  - CVE-2013-5807

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*****************************************************************************
2
2
 
3
 
Copyright (c) 2007, 2009, Innobase Oy. All Rights Reserved.
 
3
Copyright (c) 2007, 2013, Innobase Oy. 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
11
11
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
12
 
13
13
You should have received a copy of the GNU General Public License along with
14
 
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
15
 
Place, Suite 330, Boston, MA 02111-1307 USA
 
14
this program; if not, write to the Free Software Foundation, Inc., 
 
15
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
*****************************************************************************/
18
18
 
24
24
*******************************************************/
25
25
 
26
26
#include <mysqld_error.h>
27
 
#include <sql_acl.h>                            // PROCESS_ACL
 
27
#include <sql_acl.h>
28
28
 
29
29
#include <m_ctype.h>
30
30
#include <hash.h>
37
37
 
38
38
extern "C" {
39
39
#include "btr0types.h"
40
 
#include "buf0buddy.h" /* for i_s_cmpmem */
41
 
#include "buf0buf.h" /* for buf_pool and PAGE_ZIP_MIN_SIZE */
 
40
#include "buf0buddy.h"
 
41
#include "buf0buf.h"
 
42
#include "ibuf0ibuf.h"
42
43
#include "dict0mem.h"
43
44
#include "dict0types.h"
44
 
#include "ha_prototypes.h" /* for innobase_convert_name() */
45
 
#include "srv0start.h" /* for srv_was_started */
 
45
#include "dict0boot.h"
 
46
#include "ha_prototypes.h"
 
47
#include "srv0start.h"
46
48
#include "trx0i_s.h"
47
 
#include "trx0trx.h" /* for TRX_QUE_STATE_STR_MAX_LEN */
 
49
#include "trx0trx.h"
48
50
#include "btr0btr.h"
49
51
#include "page0zip.h"
50
52
#include "log0log.h"
60
62
 
61
63
typedef struct buffer_page_desc_str_struct      buf_page_desc_str_t;
62
64
 
63
 
/** Any states greater than FIL_PAGE_TYPE_LAST would be treated as unknown. */
64
 
#define I_S_PAGE_TYPE_UNKNOWN           (FIL_PAGE_TYPE_LAST + 1)
 
65
/** Change buffer B-tree page */
 
66
#define I_S_PAGE_TYPE_IBUF              (FIL_PAGE_TYPE_LAST + 1)
 
67
 
 
68
/** Any states greater than I_S_PAGE_TYPE_IBUF would be treated as
 
69
unknown. */
 
70
#define I_S_PAGE_TYPE_UNKNOWN           (I_S_PAGE_TYPE_IBUF + 1)
65
71
 
66
72
/** We also define I_S_PAGE_TYPE_INDEX as the Index Page's position
67
73
in i_s_page_type[] array */
82
88
        {"BLOB", FIL_PAGE_TYPE_BLOB},
83
89
        {"COMPRESSED_BLOB", FIL_PAGE_TYPE_ZBLOB},
84
90
        {"COMPRESSED_BLOB2", FIL_PAGE_TYPE_ZBLOB2},
 
91
        {"IBUF_INDEX", I_S_PAGE_TYPE_IBUF},
85
92
        {"UNKNOWN", I_S_PAGE_TYPE_UNKNOWN}
86
93
};
87
94
 
2788
2795
        if (page_type == FIL_PAGE_INDEX) {
2789
2796
                const page_t*   page = (const page_t*) frame;
2790
2797
 
 
2798
                page_info->index_id = btr_page_get_index_id(page);
 
2799
 
2791
2800
                /* FIL_PAGE_INDEX is a bit special, its value
2792
2801
                is defined as 17855, so we cannot use FIL_PAGE_INDEX
2793
2802
                to index into i_s_page_type[] array, its array index
2794
2803
                in the i_s_page_type[] array is I_S_PAGE_TYPE_INDEX
2795
 
                (1) */
2796
 
                page_info->page_type = I_S_PAGE_TYPE_INDEX;
2797
 
 
2798
 
                page_info->index_id = btr_page_get_index_id(page);
 
2804
                (1) for index pages or I_S_PAGE_TYPE_IBUF for
 
2805
                change buffer index pages */
 
2806
                if (page_info->index_id
 
2807
                    == static_cast<index_id_t>(DICT_IBUF_ID_MIN
 
2808
                                               + IBUF_SPACE_ID)) {
 
2809
                        page_info->page_type = I_S_PAGE_TYPE_IBUF;
 
2810
                } else {
 
2811
                        page_info->page_type = I_S_PAGE_TYPE_INDEX;
 
2812
                }
2799
2813
 
2800
2814
                page_info->data_size = (ulint)(page_header_get_field(
2801
2815
                        page, PAGE_HEAP_TOP) - (page_is_comp(page)
2804
2818
                        - page_header_get_field(page, PAGE_GARBAGE));
2805
2819
 
2806
2820
                page_info->num_recs = page_get_n_recs(page);
2807
 
        } else if (page_type >= I_S_PAGE_TYPE_UNKNOWN) {
 
2821
        } else if (page_type > FIL_PAGE_TYPE_LAST) {
2808
2822
                /* Encountered an unknown page type */
2809
2823
                page_info->page_type = I_S_PAGE_TYPE_UNKNOWN;
2810
2824
        } else {
2876
2890
 
2877
2891
                page_info->freed_page_clock = bpage->freed_page_clock;
2878
2892
 
 
2893
                switch (buf_page_get_io_fix(bpage)) {
 
2894
                case BUF_IO_NONE:
 
2895
                case BUF_IO_WRITE:
 
2896
                case BUF_IO_PIN:
 
2897
                        break;
 
2898
                case BUF_IO_READ:
 
2899
                        page_info->page_type = I_S_PAGE_TYPE_UNKNOWN;
 
2900
                        return;
 
2901
                }
 
2902
 
2879
2903
                if (page_info->page_state == BUF_BLOCK_FILE_PAGE) {
2880
2904
                        const buf_block_t*block;
2881
2905