~ubuntu-branches/ubuntu/oneiric/mysql-5.1/oneiric-updates

« back to all changes in this revision

Viewing changes to sql/ha_partition.h

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2011-07-25 00:07:54 UTC
  • mfrom: (1.2.5 upstream) (2.1.19 sid)
  • Revision ID: james.westby@ubuntu.com-20110725000754-o11teq2kcrrsmanz
Tags: 5.1.58-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  + debian/control:
     * Update maintainer according to spec.
     * Move section from "misc" to "database".
     * Added libmysqlclient16-dev an empty transitional package. 
     * Added mysql-client-core-5.1 package.
     * Suggest mailx for mysql-server-5.1
     * Add mysql-testsuite package so you can run the testsuite seperately.
  + debian/additions/my.cnf:
    * Remove language options. Error message files are located in a 
      different directory in Mysql 5.0. Setting the language option 
      to use /usr/share/mysql/english breaks Mysql 5.0. Both 5.0
      and 5.1 use a different value that works. (LP: #316974)
  + Add apparmor profile:
    * debian/apparmor-profile: apparmor-profile
    * debian/rules, debian/mysql-server-5.1.files: install apparmor profile
    * debian/mysql-server-5.1.dirs: add etc/apparmor.d/fore-complain
    * debian/mysql-server-5.1.postrm: remove symlink in force-complain/ on purge.
    * debian/mysql-server-5.1.README.Debian: add apparmor documentation.
    * debian/additions/my.cnf: Add warning about apparmor. (LP: #201799)
    * debian/mysql-server-5.1.postinst: reload apparmor profiles
  + Convert the package from sysvinit to upstart:
    * debian/mysql-server-5.1.mysql.upstart: Add upstart script.
    * debian/mysql-server-5.1.mysql.init: Dropped, unused now with upstart.
    * debian/additions/mysqld_safe_syslog.cnf: Dropped, unused now with upstart.
    * debian/additons/my.cnf: Remove pid declaration and setup error 
      logging to /var/log/mysql since we're not piping 
      anything around logger anymore.
    * debian/rules, debian/mysql-server-5.1.logcheck.ignore.{paranoid,worstation},
      debian/mysql-server-5.1.logcheck.ignore.server: : Remove references to mysqld_safe
    * debian/patches/38_scripts_mysqld_safe.sh_signals.dpatch: Dropped
  + Added -fno-strict-aliasing to CFLAGS to get around mysql testsuite 
    build failures
  + Add Apport hook (LP: #354188):
    * debian/mysql-server-5.1.py: apport package hook
    * debian/rules: Make it installable
  + debian/mysql-server-5.1.mysql-server.logrotate: Check to see if mysql 
    is running before running logrotate. (LP: #513135)
  + debian/mysql-server-5.1.preinst: Set mysql user's home directory
    to /nonexistent to protect against having the /var/lib/mysql
    user-writeable. If an attacker can trick mysqld into creating
    dot files in the home directory, he could do .rhost-like attacks
    on the system. (LP: #293258)
  + debian/control: mysql-client-5.1 should depend on mysql-core-client-5.1.
    (LP: #590952)
  + debian/mysql-server.5.1.postinst: Specify the mysql user when installing 
    the mysql databases. (LP: #591875)
  + Installing mysql_config_pic in /usr/bin so users of libmysqld-pic
    can extract the appropriate compile flags. (LP: #605021)

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
                                        HA_DUPLICATE_POS | \
56
56
                                        HA_CAN_SQL_HANDLER | \
57
57
                                        HA_CAN_INSERT_DELAYED)
 
58
 
 
59
/* First 4 bytes in the .par file is the number of 32-bit words in the file */
 
60
#define PAR_WORD_SIZE 4
 
61
/* offset to the .par file checksum */
 
62
#define PAR_CHECKSUM_OFFSET 4
 
63
/* offset to the total number of partitions */
 
64
#define PAR_NUM_PARTS_OFFSET 8
 
65
/* offset to the engines array */
 
66
#define PAR_ENGINES_OFFSET 12
 
67
 
58
68
class ha_partition :public handler
59
69
{
60
70
private:
71
81
  /* Data for the partition handler */
72
82
  int  m_mode;                          // Open mode
73
83
  uint m_open_test_lock;                // Open test_if_locked
74
 
  char *m_file_buffer;                  // Buffer with names
 
84
  char *m_file_buffer;                  // Content of the .par file 
75
85
  char *m_name_buffer_ptr;              // Pointer to first partition name
76
86
  plugin_ref *m_engine_array;           // Array of types of the handlers
77
87
  handler **m_file;                     // Array of references to handler inst.
133
143
  bool m_is_sub_partitioned;             // Is subpartitioned
134
144
  bool m_ordered_scan_ongoing;
135
145
 
 
146
  /* 
 
147
    If set, this object was created with ha_partition::clone and doesn't
 
148
    "own" the m_part_info structure.
 
149
  */
 
150
  ha_partition *m_is_clone_of;
 
151
  MEM_ROOT *m_clone_mem_root;
 
152
  
136
153
  /*
137
154
    We keep track if all underlying handlers are MyISAM since MyISAM has a
138
155
    great number of extra flags not needed by other handlers.
169
186
  PARTITION_SHARE *share;               /* Shared lock info */
170
187
#endif
171
188
 
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
189
  bool auto_increment_lock;             /**< lock reading/updating auto_inc */
178
190
  /**
179
191
    Flag to keep the auto_increment lock through out the statement.
186
198
  /** used for prediction of start_bulk_insert rows */
187
199
  enum_monotonicity_info m_part_func_monotonicity_info;
188
200
public:
189
 
  handler *clone(MEM_ROOT *mem_root);
 
201
  handler *clone(const char *name, MEM_ROOT *mem_root);
190
202
  virtual void set_part_info(partition_info *part_info)
191
203
  {
192
204
     m_part_info= part_info;
205
217
  */
206
218
    ha_partition(handlerton *hton, TABLE_SHARE * table);
207
219
    ha_partition(handlerton *hton, partition_info * part_info);
 
220
    ha_partition(handlerton *hton, TABLE_SHARE *share,
 
221
                 partition_info *part_info_arg,
 
222
                 ha_partition *clone_arg,
 
223
                 MEM_ROOT *clone_mem_root_arg);
208
224
   ~ha_partition();
209
225
  /*
210
226
    A partition handler has no characteristics in itself. It only inherits
275
291
    And one method to read it in.
276
292
  */
277
293
  bool create_handler_file(const char *name);
278
 
  bool get_from_handler_file(const char *name, MEM_ROOT *mem_root);
 
294
  bool setup_engine_array(MEM_ROOT *mem_root);
 
295
  bool read_par_file(const char *name);
 
296
  bool get_from_handler_file(const char *name, MEM_ROOT *mem_root,
 
297
                             bool is_clone);
279
298
  bool new_handlers_from_part_info(MEM_ROOT *mem_root);
280
299
  bool create_handlers(MEM_ROOT *mem_root);
281
300
  void clear_handler_file();