~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/rpl_record.cc

  • Committer: Brian Aker
  • Date: 2008-07-10 19:37:55 UTC
  • mfrom: (51.1.67 remove-dbug)
  • Revision ID: brian@tangent.org-20080710193755-f5g761uieqa3wxmt
Merge.

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
          length is stored in little-endian format, since this is the
97
97
          format used for the binlog.
98
98
        */
99
 
#ifndef DBUG_OFF
100
99
        const uchar *old_pack_ptr= pack_ptr;
101
 
#endif
102
100
        pack_ptr= field->pack(pack_ptr, field->ptr + offset,
103
 
                              field->max_data_length(), TRUE);
 
101
                              field->max_data_length(), true);
104
102
      }
105
103
 
106
104
      null_mask <<= 1;
107
105
      if ((null_mask & 0xFF) == 0)
108
106
      {
109
 
        DBUG_ASSERT(null_ptr < row_data + null_byte_count);
 
107
        assert(null_ptr < row_data + null_byte_count);
110
108
        null_mask = 1U;
111
109
        *null_ptr++ = null_bits;
112
110
        null_bits= (1U << 8) - 1;
119
117
  */
120
118
  if ((null_mask & 0xFF) > 1)
121
119
  {
122
 
    DBUG_ASSERT(null_ptr < row_data + null_byte_count);
 
120
    assert(null_ptr < row_data + null_byte_count);
123
121
    *null_ptr++ = null_bits;
124
122
  }
125
123
 
127
125
    The null pointer should now point to the first byte of the
128
126
    packed data. If it doesn't, something is very wrong.
129
127
  */
130
 
  DBUG_ASSERT(null_ptr == row_data + null_byte_count);
131
 
  DBUG_DUMP("row_data", row_data, pack_ptr - row_data);
 
128
  assert(null_ptr == row_data + null_byte_count);
132
129
  return(static_cast<size_t>(pack_ptr - row_data));
133
130
}
134
131
#endif
174
171
           uchar const *const row_data, MY_BITMAP const *cols,
175
172
           uchar const **const row_end, ulong *const master_reclength)
176
173
{
177
 
  DBUG_ASSERT(row_data);
 
174
  assert(row_data);
178
175
  size_t const master_null_byte_count= (bitmap_bits_set(cols) + 7) / 8;
179
176
  int error= 0;
180
177
 
185
182
  Field **field_ptr;
186
183
  Field **const end_ptr= begin_ptr + colcnt;
187
184
 
188
 
  DBUG_ASSERT(null_ptr < row_data + master_null_byte_count);
 
185
  assert(null_ptr < row_data + master_null_byte_count);
189
186
 
190
187
  // Mask to mask out the correct bit among the null bits
191
188
  unsigned int null_mask= 1U;
213
210
    {
214
211
      if ((null_mask & 0xFF) == 0)
215
212
      {
216
 
        DBUG_ASSERT(null_ptr < row_data + master_null_byte_count);
 
213
        assert(null_ptr < row_data + master_null_byte_count);
217
214
        null_mask= 1U;
218
215
        null_bits= *null_ptr++;
219
216
      }
220
217
 
221
 
      DBUG_ASSERT(null_mask & 0xFF); // One of the 8 LSB should be set
 
218
      assert(null_mask & 0xFF); // One of the 8 LSB should be set
222
219
 
223
220
      /* Field...::unpack() cannot return 0 */
224
 
      DBUG_ASSERT(pack_ptr != NULL);
 
221
      assert(pack_ptr != NULL);
225
222
 
226
223
      if ((null_bits & null_mask) && f->maybe_null())
227
224
      {
242
239
          the packed row comes from the table to which it is unpacked.
243
240
        */
244
241
        uint16 metadata= tabledef ? tabledef->field_metadata(i) : 0;
245
 
#ifndef DBUG_OFF
246
242
        uchar const *const old_pack_ptr= pack_ptr;
247
 
#endif
248
 
        pack_ptr= f->unpack(f->ptr, pack_ptr, metadata, TRUE);
 
243
        pack_ptr= f->unpack(f->ptr, pack_ptr, metadata, true);
249
244
      }
250
245
 
251
246
      null_mask <<= 1;
267
262
    {
268
263
      if ((null_mask & 0xFF) == 0)
269
264
      {
270
 
        DBUG_ASSERT(null_ptr < row_data + master_null_byte_count);
 
265
        assert(null_ptr < row_data + master_null_byte_count);
271
266
        null_mask= 1U;
272
267
        null_bits= *null_ptr++;
273
268
      }
274
 
      DBUG_ASSERT(null_mask & 0xFF); // One of the 8 LSB should be set
 
269
      assert(null_mask & 0xFF); // One of the 8 LSB should be set
275
270
 
276
271
      if (!((null_bits & null_mask) && tabledef->maybe_null(i)))
277
272
        pack_ptr+= tabledef->calc_field_size(i, (uchar *) pack_ptr);
283
278
    We should now have read all the null bytes, otherwise something is
284
279
    really wrong.
285
280
   */
286
 
  DBUG_ASSERT(null_ptr == row_data + master_null_byte_count);
287
 
 
288
 
  DBUG_DUMP("row_data", row_data, pack_ptr - row_data);
 
281
  assert(null_ptr == row_data + master_null_byte_count);
289
282
 
290
283
  *row_end = pack_ptr;
291
284
  if (master_reclength)