~posulliv/drizzle/optimizer-style-cleanup

« back to all changes in this revision

Viewing changes to plugin/function_engine/cursor.cc

  • Committer: Padraig O'Sullivan
  • Date: 2010-03-15 14:05:26 UTC
  • mfrom: (1237.9.99 staging)
  • Revision ID: osullivan.padraig@gmail.com-20100315140526-opbgwdwn6tfecdkq
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
68
68
int FunctionCursor::rnd_next(unsigned char *)
69
69
{
70
70
  bool more_rows;
71
 
  ha_statistic_increment(&SSV::ha_read_rnd_next_count);
 
71
  ha_statistic_increment(&system_status_var::ha_read_rnd_next_count);
72
72
 
73
73
  /* Fix bug in the debug logic for field */
74
74
  for (Field **field=table->field ; *field ; field++)
96
96
{
97
97
  unsigned char *copy;
98
98
 
99
 
  copy= (unsigned char *)malloc(table->s->reclength);
 
99
  copy= (unsigned char *)calloc(table->s->reclength, sizeof(unsigned char));
 
100
  assert(copy);
100
101
  memcpy(copy, record, table->s->reclength);
101
102
  row_cache.push_back(copy);
102
103
  internal::my_store_ptr(ref, ref_length, record_id);
124
125
 
125
126
int FunctionCursor::rnd_pos(unsigned char *buf, unsigned char *pos)
126
127
{
127
 
  ha_statistic_increment(&SSV::ha_read_rnd_count);
 
128
  ha_statistic_increment(&system_status_var::ha_read_rnd_count);
128
129
  size_t position_id= (size_t)internal::my_get_ptr(pos, ref_length);
129
130
 
130
131
  memcpy(buf, row_cache[position_id], table->s->reclength);