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

« back to all changes in this revision

Viewing changes to sql/ha_partition.h

  • 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
 
/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
 
1
/*
 
2
   Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
2
3
 
3
4
  This program is free software; you can redistribute it and/or modify
4
5
  it under the terms of the GNU General Public License as published by
11
12
 
12
13
  You should have received a copy of the GNU General Public License
13
14
  along with this program; if not, write to the Free Software
14
 
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA
 
16
*/
15
17
 
16
18
#ifdef __GNUC__
17
19
#pragma interface                               /* gcc class implementation */
55
57
                                        HA_DUPLICATE_POS | \
56
58
                                        HA_CAN_SQL_HANDLER | \
57
59
                                        HA_CAN_INSERT_DELAYED)
 
60
 
 
61
/* First 4 bytes in the .par file is the number of 32-bit words in the file */
 
62
#define PAR_WORD_SIZE 4
 
63
/* offset to the .par file checksum */
 
64
#define PAR_CHECKSUM_OFFSET 4
 
65
/* offset to the total number of partitions */
 
66
#define PAR_NUM_PARTS_OFFSET 8
 
67
/* offset to the engines array */
 
68
#define PAR_ENGINES_OFFSET 12
 
69
 
58
70
class ha_partition :public handler
59
71
{
60
72
private:
71
83
  /* Data for the partition handler */
72
84
  int  m_mode;                          // Open mode
73
85
  uint m_open_test_lock;                // Open test_if_locked
74
 
  char *m_file_buffer;                  // Buffer with names
 
86
  char *m_file_buffer;                  // Content of the .par file 
75
87
  char *m_name_buffer_ptr;              // Pointer to first partition name
76
88
  plugin_ref *m_engine_array;           // Array of types of the handlers
77
89
  handler **m_file;                     // Array of references to handler inst.
133
145
  bool m_is_sub_partitioned;             // Is subpartitioned
134
146
  bool m_ordered_scan_ongoing;
135
147
 
 
148
  /* 
 
149
    If set, this object was created with ha_partition::clone and doesn't
 
150
    "own" the m_part_info structure.
 
151
  */
 
152
  ha_partition *m_is_clone_of;
 
153
  MEM_ROOT *m_clone_mem_root;
 
154
  
136
155
  /*
137
156
    We keep track if all underlying handlers are MyISAM since MyISAM has a
138
157
    great number of extra flags not needed by other handlers.
169
188
  PARTITION_SHARE *share;               /* Shared lock info */
170
189
#endif
171
190
 
172
 
  /* 
173
 
    TRUE <=> this object was created with ha_partition::clone and doesn't
174
 
    "own" the m_part_info structure.
175
 
  */
176
 
  bool is_clone;
177
191
  bool auto_increment_lock;             /**< lock reading/updating auto_inc */
178
192
  /**
179
193
    Flag to keep the auto_increment lock through out the statement.
186
200
  /** used for prediction of start_bulk_insert rows */
187
201
  enum_monotonicity_info m_part_func_monotonicity_info;
188
202
public:
189
 
  handler *clone(MEM_ROOT *mem_root);
 
203
  handler *clone(const char *name, MEM_ROOT *mem_root);
190
204
  virtual void set_part_info(partition_info *part_info)
191
205
  {
192
206
     m_part_info= part_info;
205
219
  */
206
220
    ha_partition(handlerton *hton, TABLE_SHARE * table);
207
221
    ha_partition(handlerton *hton, partition_info * part_info);
 
222
    ha_partition(handlerton *hton, TABLE_SHARE *share,
 
223
                 partition_info *part_info_arg,
 
224
                 ha_partition *clone_arg,
 
225
                 MEM_ROOT *clone_mem_root_arg);
208
226
   ~ha_partition();
209
227
  /*
210
228
    A partition handler has no characteristics in itself. It only inherits
275
293
    And one method to read it in.
276
294
  */
277
295
  bool create_handler_file(const char *name);
278
 
  bool get_from_handler_file(const char *name, MEM_ROOT *mem_root);
 
296
  bool setup_engine_array(MEM_ROOT *mem_root);
 
297
  bool read_par_file(const char *name);
 
298
  bool get_from_handler_file(const char *name, MEM_ROOT *mem_root,
 
299
                             bool is_clone);
279
300
  bool new_handlers_from_part_info(MEM_ROOT *mem_root);
280
301
  bool create_handlers(MEM_ROOT *mem_root);
281
302
  void clear_handler_file();