~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/replication/utility.h

Merged in Eric's whitespace cleanup.

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
    @param metadata_size Size of the field_metadata array
60
60
    @param null_bitmap The bitmap of fields that can be null
61
61
   */
62
 
  table_def(field_type *types, uint32_t size, unsigned char *field_metadata, 
 
62
  table_def(field_type *types, uint32_t size, unsigned char *field_metadata,
63
63
      int metadata_size, unsigned char *null_bitmap)
64
64
    : m_size(size), m_type(0), m_field_metadata_size(metadata_size),
65
65
      m_field_metadata(0), m_null_bits(0), m_memory(NULL)
81
81
      Extract the data from the table map into the field metadata array
82
82
      iff there is field metadata. The variable metadata_size will be
83
83
      0 if we are replicating from an older version server since no field
84
 
      metadata was written to the table map. This can also happen if 
 
84
      metadata was written to the table map. This can also happen if
85
85
      there were no fields in the master that needed extra metadata.
86
86
    */
87
87
    if (m_size && metadata_size)
88
 
    { 
 
88
    {
89
89
      int index= 0;
90
90
      for (unsigned int i= 0; i < m_size; i++)
91
91
      {
169
169
    table map for a given field. If there is no metadata for that field
170
170
    or there is no extra metadata at all, the function returns 0.
171
171
 
172
 
    The function returns the value for the field metadata for column at 
173
 
    position indicated by index. As mentioned, if the field was a type 
174
 
    that stores field metadata, that value is returned else zero (0) is 
175
 
    returned. This method is used in the unpack() methods of the 
176
 
    corresponding fields to properly extract the data from the binary log 
 
172
    The function returns the value for the field metadata for column at
 
173
    position indicated by index. As mentioned, if the field was a type
 
174
    that stores field metadata, that value is returned else zero (0) is
 
175
    returned. This method is used in the unpack() methods of the
 
176
    corresponding fields to properly extract the data from the binary log
177
177
    in the event that the master's field is smaller than the slave.
178
178
  */
179
179
  uint16_t field_metadata(uint32_t index) const
192
192
  bool maybe_null(uint32_t index) const
193
193
  {
194
194
    assert(index < m_size);
195
 
    return ((m_null_bits[(index / 8)] & 
 
195
    return ((m_null_bits[(index / 8)] &
196
196
            (1 << (index % 8))) == (1 << (index %8)));
197
197
  }
198
198
 
199
199
  /*
200
200
    This function returns the field size in raw bytes based on the type
201
 
    and the encoded field data from the master's raw data. This method can 
202
 
    be used for situations where the slave needs to skip a column (e.g., 
203
 
    WL#3915) or needs to advance the pointer for the fields in the raw 
 
201
    and the encoded field data from the master's raw data. This method can
 
202
    be used for situations where the slave needs to skip a column (e.g.,
 
203
    WL#3915) or needs to advance the pointer for the fields in the raw
204
204
    data from the master to a specific column.
205
205
  */
206
206
  uint32_t calc_field_size(uint32_t col, unsigned char *master_data) const;