~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/cursor.cc

  • Committer: Olaf van der Spek
  • Date: 2011-08-05 10:29:23 UTC
  • mto: This revision was merged to the branch mainline in revision 2395.
  • Revision ID: olafvdspek@gmail.com-20110805102923-l7tjgd09c8g5epoq
Refactor getTableName

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
Cursor *Cursor::clone(memory::Root *mem_root)
84
84
{
85
85
  Cursor *new_handler= getTable()->getMutableShare()->db_type()->getCursor(*getTable());
86
 
 
87
86
  /*
88
87
    Allocate Cursor->ref here because otherwise ha_open will allocate it
89
88
    on this->table->mem_root and we will not be able to reclaim that memory
90
89
    when the clone Cursor object is destroyed.
91
90
  */
92
91
  new_handler->ref= mem_root->alloc(ALIGN_SIZE(ref_length)*2);
93
 
 
94
 
  identifier::Table identifier(getTable()->getShare()->getSchemaName(),
95
 
                             getTable()->getShare()->getTableName(),
96
 
                             getTable()->getShare()->getType());
97
 
 
98
 
  if (new_handler && !new_handler->ha_open(identifier,
99
 
                                           getTable()->getDBStat(),
100
 
                                           HA_OPEN_IGNORE_IF_LOCKED))
101
 
    return new_handler;
102
 
  return NULL;
 
92
  identifier::Table identifier(getTable()->getShare()->getSchemaName(), getTable()->getShare()->getTableName(), getTable()->getShare()->getType());
 
93
  return new_handler->ha_open(identifier, getTable()->getDBStat(), HA_OPEN_IGNORE_IF_LOCKED) ? NULL : new_handler;
103
94
}
104
95
 
105
96
/*