~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cursor.cc

  • Committer: Olaf van der Spek
  • Date: 2011-06-22 14:19:44 UTC
  • mto: This revision was merged to the branch mainline in revision 2347.
  • Revision ID: olafvdspek@gmail.com-20110622141944-na0vb0uv30n6u55z
Refactor

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
    on this->table->mem_root and we will not be able to reclaim that memory
90
90
    when the clone Cursor object is destroyed.
91
91
  */
92
 
  if (!(new_handler->ref= (unsigned char*) mem_root->alloc_root(ALIGN_SIZE(ref_length)*2)))
93
 
    return NULL;
 
92
  new_handler->ref= (unsigned char*) mem_root->alloc(ALIGN_SIZE(ref_length)*2);
94
93
 
95
94
  identifier::Table identifier(getTable()->getShare()->getSchemaName(),
96
95
                             getTable()->getShare()->getTableName(),
249
248
    (void) extra(HA_EXTRA_NO_READCHECK);        // Not needed in SQL
250
249
 
251
250
    /* ref is already allocated for us if we're called from Cursor::clone() */
252
 
    if (!ref && !(ref= (unsigned char*) getTable()->alloc_root(ALIGN_SIZE(ref_length)*2)))
253
 
    {
254
 
      close();
255
 
      error=HA_ERR_OUT_OF_MEM;
256
 
    }
257
 
    else
258
 
      dup_ref=ref+ALIGN_SIZE(ref_length);
 
251
    if (!ref)
 
252
      ref= (unsigned char*) getTable()->alloc_root(ALIGN_SIZE(ref_length)*2);
 
253
    dup_ref=ref+ALIGN_SIZE(ref_length);
259
254
  }
260
255
  return error;
261
256
}