~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/memory/ha_heap.cc

  • Committer: Andrew Hutchings
  • Date: 2011-01-04 11:36:01 UTC
  • mto: This revision was merged to the branch mainline in revision 2057.
  • Revision ID: andrew@linuxjedi.co.uk-20110104113601-diiveyfl32dgaa6f
Refix using placement new for join code, vector for join cache buffer.
Also refix a bug in COND_CMP properly

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
 
71
71
  int doCreateTable(Session &session,
72
72
                    Table &table_arg,
73
 
                    const identifier::Table &identifier,
 
73
                    const TableIdentifier &identifier,
74
74
                    message::Table &create_proto);
75
75
 
76
76
  /* For whatever reason, internal tables can be created by Cursor::open()
84
84
                        message::Table &create_proto,
85
85
                        HP_SHARE **internal_share);
86
86
 
87
 
  int doRenameTable(Session&, const identifier::Table &from, const identifier::Table &to);
 
87
  int doRenameTable(Session&, const TableIdentifier &from, const TableIdentifier &to);
88
88
 
89
 
  int doDropTable(Session&, const identifier::Table &identifier);
 
89
  int doDropTable(Session&, const TableIdentifier &identifier);
90
90
 
91
91
  int doGetTableDefinition(Session& session,
92
 
                           const identifier::Table &identifier,
 
92
                           const TableIdentifier &identifier,
93
93
                           message::Table &table_message);
94
94
 
95
95
  uint32_t max_supported_keys()          const { return MAX_KEY; }
100
100
    return ( HA_ONLY_WHOLE_INDEX | HA_KEY_SCAN_NOT_ROR);
101
101
  }
102
102
 
103
 
  bool doDoesTableExist(Session& session, const identifier::Table &identifier);
 
103
  bool doDoesTableExist(Session& session, const TableIdentifier &identifier);
104
104
  void doGetTableIdentifiers(CachedDirectory &directory,
105
 
                             const identifier::Schema &schema_identifier,
106
 
                             identifier::Table::vector &set_of_identifiers);
 
105
                             const SchemaIdentifier &schema_identifier,
 
106
                             TableIdentifier::vector &set_of_identifiers);
107
107
};
108
108
 
109
109
void HeapEngine::doGetTableIdentifiers(CachedDirectory&,
110
 
                                       const identifier::Schema&,
111
 
                                       identifier::Table::vector&)
 
110
                                       const SchemaIdentifier&,
 
111
                                       TableIdentifier::vector&)
112
112
{
113
113
}
114
114
 
115
 
bool HeapEngine::doDoesTableExist(Session& session, const identifier::Table &identifier)
 
115
bool HeapEngine::doDoesTableExist(Session& session, const TableIdentifier &identifier)
116
116
{
117
117
  return session.getMessageCache().doesTableMessageExist(identifier);
118
118
}
119
119
 
120
120
int HeapEngine::doGetTableDefinition(Session &session,
121
 
                                     const identifier::Table &identifier,
 
121
                                     const TableIdentifier &identifier,
122
122
                                     message::Table &table_proto)
123
123
{
124
124
  if (session.getMessageCache().getTableMessage(identifier, table_proto))
130
130
  We have to ignore ENOENT entries as the MEMORY table is created on open and
131
131
  not when doing a CREATE on the table.
132
132
*/
133
 
int HeapEngine::doDropTable(Session &session, const identifier::Table &identifier)
 
133
int HeapEngine::doDropTable(Session &session, const TableIdentifier &identifier)
134
134
{
135
135
  session.getMessageCache().removeTableMessage(identifier);
136
136
 
175
175
*/
176
176
#define MEMORY_STATS_UPDATE_THRESHOLD 10
177
177
 
178
 
int ha_heap::doOpen(const drizzled::identifier::Table &identifier, int mode, uint32_t test_if_locked)
 
178
int ha_heap::doOpen(const drizzled::TableIdentifier &identifier, int mode, uint32_t test_if_locked)
179
179
{
180
180
  if ((test_if_locked & HA_OPEN_INTERNAL_TABLE) || (!(file= heap_open(identifier.getPath().c_str(), mode)) && errno == ENOENT))
181
181
  {
240
240
Cursor *ha_heap::clone(memory::Root *)
241
241
{
242
242
  Cursor *new_handler= getTable()->getMutableShare()->db_type()->getCursor(*getTable());
243
 
  identifier::Table identifier(getTable()->getShare()->getSchemaName(),
 
243
  TableIdentifier identifier(getTable()->getShare()->getSchemaName(),
244
244
                             getTable()->getShare()->getTableName(),
245
245
                             getTable()->getShare()->getPath());
246
246
 
623
623
}
624
624
 
625
625
 
626
 
int HeapEngine::doRenameTable(Session &session, const identifier::Table &from, const identifier::Table &to)
 
626
int HeapEngine::doRenameTable(Session &session, const TableIdentifier &from, const TableIdentifier &to)
627
627
{
628
628
  session.getMessageCache().renameTableMessage(from, to);
629
629
  return heap_rename(from.getPath().c_str(), to.getPath().c_str());
652
652
 
653
653
int HeapEngine::doCreateTable(Session &session,
654
654
                              Table &table_arg,
655
 
                              const identifier::Table &identifier,
 
655
                              const TableIdentifier &identifier,
656
656
                              message::Table& create_proto)
657
657
{
658
658
  int error;