~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.h

init_read_record_idx return result should be checked now that it checks startIndexScan result.

Show diffs side-by-side

added added

removed removed

Lines of Context:
124
124
extern const std::string UNKNOWN_STRING;
125
125
extern const std::string DEFAULT_DEFINITION_FILE_EXT;
126
126
 
 
127
 
127
128
/*
128
129
  StorageEngine is a singleton structure - one instance per storage engine -
129
130
  to provide access to storage engine functionality that works on the
136
137
class StorageEngine : public Plugin,
137
138
                      public MonitoredInTransaction
138
139
{
 
140
  friend class SEAPITester;
139
141
public:
140
142
  typedef uint64_t Table_flags;
141
143
 
142
144
private:
 
145
  static EngineVector &getSchemaEngines();
143
146
  const std::bitset<HTON_BIT_SIZE> flags; /* global Cursor flags */
144
147
 
145
 
  static EngineVector &getSchemaEngines();
146
148
 
147
149
  virtual void setTransactionReadWrite(Session& session);
148
150
 
205
207
 
206
208
  virtual ~StorageEngine();
207
209
 
 
210
protected:
208
211
  virtual int doGetTableDefinition(Session &session,
209
212
                                   const drizzled::TableIdentifier &identifier,
210
213
                                   message::Table &table_message)
217
220
  }
218
221
 
219
222
  /* Old style cursor errors */
220
 
protected:
221
223
  void print_keydup_error(uint32_t key_nr, const char *msg, Table &table);
222
224
  void print_error(int error, myf errflag, Table *table= NULL);
223
225
  virtual bool get_error_message(int error, String *buf);
252
254
  {
253
255
    return 0;
254
256
  }
 
257
 
255
258
  virtual Cursor *create(Table &)= 0;
256
259
  /* args: path */
257
260
  virtual bool flush_logs() { return false; }
282
285
  virtual int doRenameTable(Session &session,
283
286
                            const drizzled::TableIdentifier &from, const drizzled::TableIdentifier &to)= 0;
284
287
 
285
 
public:
286
 
 
287
 
  int renameTable(Session &session, const drizzled::TableIdentifier &from, const drizzled::TableIdentifier &to);
 
288
  virtual int doDropTable(Session &session,
 
289
                          const drizzled::TableIdentifier &identifier)= 0;
288
290
 
289
291
  virtual void doGetTableIdentifiers(CachedDirectory &directory,
290
292
                                     const drizzled::SchemaIdentifier &schema_identifier,
291
293
                                     TableIdentifier::vector &set_of_identifiers)= 0;
292
294
 
293
 
  virtual int doDropTable(Session &session,
294
 
                          const drizzled::TableIdentifier &identifier)= 0;
 
295
  virtual bool doDoesTableExist(Session& session, const drizzled::TableIdentifier &identifier);
 
296
 
 
297
  virtual bool doCanCreateTable(const drizzled::TableIdentifier &identifier)
 
298
  { (void)identifier;  return true; }
 
299
 
 
300
public:
 
301
 
 
302
  friend class AddSchemaNames;
 
303
  friend class AddTableIdentifier;
 
304
  friend class AlterSchema;
 
305
  friend class CanCreateTable;
 
306
  friend class CreateSchema;
 
307
  friend class DropSchema;
 
308
  friend class DropTable;
 
309
  friend class DropTables;
 
310
  friend class FindEngineByName;
 
311
  friend class Ha_delete_table_error_handler;
 
312
  friend class StorageEngineCloseConnection;
 
313
  friend class StorageEngineDoesTableExist;
 
314
  friend class StorageEngineGetSchemaDefinition;
 
315
  friend class StorageEngineGetTableDefinition;
 
316
 
 
317
  int renameTable(Session &session, const drizzled::TableIdentifier &from, const drizzled::TableIdentifier &to);
295
318
 
296
319
  /* Class Methods for operating on plugin */
297
320
  static bool addPlugin(plugin::StorageEngine *engine);
305
328
                             const drizzled::TableIdentifier &identifier,
306
329
                             bool include_temporary_tables= true);
307
330
 
308
 
  virtual bool doDoesTableExist(Session& session, const drizzled::TableIdentifier &identifier);
309
 
 
310
331
  static plugin::StorageEngine *findByName(const std::string &find_str);
311
332
  static plugin::StorageEngine *findByName(Session& session, const std::string &find_str);
312
333
 
324
345
 
325
346
  // Check to see if any SE objects to creation.
326
347
  static bool canCreateTable(const drizzled::TableIdentifier &identifier);
327
 
  virtual bool doCanCreateTable(const drizzled::TableIdentifier &identifier)
328
 
  { (void)identifier;  return true; }
329
348
 
330
349
  // @note All schema methods defined here
331
350
  static void getIdentifiers(Session &session, SchemaIdentifier::vector &schemas);
334
353
  static bool doesSchemaExist(const drizzled::SchemaIdentifier &identifier);
335
354
  static const CHARSET_INFO *getSchemaCollation(const drizzled::SchemaIdentifier &identifier);
336
355
  static bool createSchema(const drizzled::message::Schema &schema_message);
337
 
  static bool dropSchema(const drizzled::SchemaIdentifier &identifier);
 
356
  static bool dropSchema(drizzled::Session& session, SchemaIdentifier::const_reference identifier);
338
357
  static bool alterSchema(const drizzled::message::Schema &schema_message);
339
358
 
340
359
  // @note make private/protected
 
360
protected:
341
361
  virtual void doGetSchemaIdentifiers(SchemaIdentifier::vector&)
342
362
  { }
343
363
 
355
375
  virtual bool doDropSchema(const drizzled::SchemaIdentifier&)
356
376
  { return false; }
357
377
 
 
378
public:
358
379
  static inline const std::string &resolveName(const StorageEngine *engine)
359
380
  {
360
381
    return engine == NULL ? UNKNOWN_STRING : engine->getName();