~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/function_engine/cursor.cc

merged with latest trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
int FunctionCursor::doStartTableScan(bool)
71
71
{
72
72
  rows_returned= 0;
73
 
  generator= tool->generator(table->field);
 
73
  generator= tool->generator(table->getFields());
74
74
 
75
75
  return 0;
76
76
}
82
82
  ha_statistic_increment(&system_status_var::ha_read_rnd_next_count);
83
83
 
84
84
  /* Fix bug in the debug logic for field */
85
 
  for (Field **field=table->field ; *field ; field++)
 
85
  for (Field **field= table->getFields() ; *field ; field++)
86
86
  {
87
87
    (*field)->setWriteSet();
88
88
  }
89
89
 
90
 
  more_rows= generator->sub_populate(table->getShare()->fields);
 
90
  more_rows= generator->sub_populate(table->getShare()->sizeFields());
91
91
 
92
92
  if (more_rows)
93
93
  {
105
105
 
106
106
void FunctionCursor::position(const unsigned char *record)
107
107
{
108
 
  if (row_cache.size() <= record_id * table->getShare()->reclength)
 
108
  if (row_cache.size() <= record_id * table->getShare()->getRecordLength())
109
109
  {
110
 
    row_cache.resize(row_cache.size() + table->getShare()->reclength * 100); // Hardwired at adding an additional 100 rows of storage
 
110
    row_cache.resize(row_cache.size() + table->getShare()->getRecordLength() * 100); // Hardwired at adding an additional 100 rows of storage
111
111
  }
112
 
  memcpy(&row_cache[record_id * table->getShare()->reclength], record, table->getShare()->reclength);
 
112
  memcpy(&row_cache[record_id * table->getShare()->getRecordLength()], record, table->getShare()->getRecordLength());
113
113
  internal::my_store_ptr(ref, ref_length, record_id);
114
114
  record_id++;
115
115
}
154
154
  ha_statistic_increment(&system_status_var::ha_read_rnd_count);
155
155
  size_t position_id= (size_t)internal::my_get_ptr(pos, ref_length);
156
156
 
157
 
  assert(position_id * table->getShare()->reclength < row_cache.size());
158
 
  memcpy(buf, &row_cache[position_id * table->getShare()->reclength], table->getShare()->reclength);
 
157
  assert(position_id * table->getShare()->getRecordLength() < row_cache.size());
 
158
  memcpy(buf, &row_cache[position_id * table->getShare()->getRecordLength()], table->getShare()->getRecordLength());
159
159
 
160
160
  return 0;
161
161
}