~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/hp_record.cc

  • Committer: Brian Aker
  • Date: 2010-08-13 18:47:31 UTC
  • mfrom: (1707.1.7 rollup)
  • Revision ID: brian@tangent.org-20100813184731-w2iu1wzs219nqmt6
Style fixes/etc in heap.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
uint32_t hp_get_encoded_data_length(HP_SHARE *info, const unsigned char *record, uint32_t *chunk_count)
43
43
{
44
 
  uint32_t i, dst_offset;
45
 
 
46
 
  dst_offset= info->fixed_data_length;
 
44
  uint32_t dst_offset= info->fixed_data_length;
47
45
 
48
46
  if (!info->recordspace.is_variable_size)
49
47
  {
52
50
    return dst_offset;
53
51
  }
54
52
 
55
 
  for (i= info->fixed_column_count; i < info->column_count; i++)
 
53
  for (uint32_t i= info->fixed_column_count; i < info->column_count; i++)
56
54
  {
57
55
    uint32_t src_offset, length;
58
56
 
92
90
}
93
91
 
94
92
 
95
 
/*static void dump_chunk(HP_SHARE *info, const unsigned char* curr_chunk)
96
 
{
97
 
  uint32_t i;
98
 
  fprintf(stdout, "Chunk dump at 0x%lx: ", (long)curr_chunk);
99
 
  for (i= 0; i < info->chunk_dataspace_length; i++)
100
 
  {
101
 
    uint32_t b= *((unsigned char*)(curr_chunk + i));
102
 
    if (b < 0x10)
103
 
    {
104
 
      fprintf(stdout, "0");
105
 
    }
106
 
    fprintf(stdout, "%lx ", (long)b);
107
 
  }
108
 
  fprintf(stdout, ". Next = 0x%lx, Status = %d\n",
109
 
    (long)(*((unsigned char**) (curr_chunk + info->offset_link))),
110
 
    (uint)(*((unsigned char*) (curr_chunk + info->offset_status))));
111
 
}*/
112
 
 
113
 
 
114
93
/**
115
94
  Encodes or compares record
116
95
 
130
109
uint32_t hp_process_record_data_to_chunkset(HP_SHARE *info, const unsigned char *record,
131
110
                                      unsigned char *pos, uint32_t is_compare)
132
111
{
133
 
  uint32_t i, dst_offset;
 
112
  uint32_t dst_offset;
134
113
  unsigned char* curr_chunk= pos;
135
114
 
136
115
  if (is_compare)
153
132
 
154
133
  dst_offset= info->fixed_data_length;
155
134
 
156
 
  for (i= info->fixed_column_count; i < info->column_count; i++)
 
135
  for (uint32_t i= info->fixed_column_count; i < info->column_count; i++)
157
136
  {
158
137
    uint32_t src_offset, length;
159
138
 
266
245
 
267
246
void hp_extract_record(HP_SHARE *info, unsigned char *record, const unsigned char *pos)
268
247
{
269
 
  uint32_t i, src_offset;
 
248
  uint32_t src_offset;
270
249
  const unsigned char* curr_chunk= pos;
271
250
 
272
251
 
277
256
 
278
257
  memcpy(record, curr_chunk, (size_t) info->fixed_data_length);
279
258
 
280
 
  if (!info->recordspace.is_variable_size)
 
259
  if (not info->recordspace.is_variable_size)
281
260
  {
282
261
    /* Nothing more to copy */
283
262
    return;
285
264
 
286
265
  src_offset= info->fixed_data_length;
287
266
 
288
 
  for (i= info->fixed_column_count; i < info->column_count; i++)
 
267
  for (uint32_t i= info->fixed_column_count; i < info->column_count; i++)
289
268
  {
290
269
    uint32_t dst_offset, length, is_null = 0;
291
270
 
370
349
      length-= to_copy;
371
350
    }
372
351
  }
373
 
 
374
 
  return;
375
352
}