83
83
Cursor *Cursor::clone(memory::Root *mem_root)
85
85
Cursor *new_handler= getTable()->getMutableShare()->db_type()->getCursor(*getTable());
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.
92
91
new_handler->ref= mem_root->alloc(ALIGN_SIZE(ref_length)*2);
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;