~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.h

  • Committer: Brian Aker
  • Date: 2010-03-05 03:12:24 UTC
  • mfrom: (1273.1.32 bug530870)
  • Revision ID: brian@gaz-20100305031224-ijnk5d5n4dut5mtv
Merge Jay's bugfix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include "drizzled/sql_string.h"
31
31
#include "drizzled/table_identifier.h"
32
32
#include "drizzled/cached_directory.h"
 
33
#include "drizzled/plugin/monitored_in_transaction.h"
33
34
 
34
35
#include "drizzled/hash.h"
35
36
 
140
141
 
141
142
  static StorageEngine { ... } xxx_engine;
142
143
*/
143
 
class StorageEngine : public Plugin
 
144
class StorageEngine : public Plugin,
 
145
                      public MonitoredInTransaction
144
146
{
145
147
public:
146
148
  typedef uint64_t Table_flags;
234
236
public:
235
237
  virtual void print_error(int error, myf errflag, Table& table);
236
238
 
237
 
  /*
238
 
    each storage engine has it's own memory area (actually a pointer)
239
 
    in the session, for storing per-connection information.
240
 
    It is accessed as
241
 
 
242
 
      session->ha_data[xxx_engine.slot]
243
 
 
244
 
   slot number is initialized by MySQL after xxx_init() is called.
245
 
  */
246
 
  uint32_t slot;
247
 
 
248
 
  inline uint32_t getSlot (void) { return slot; }
249
 
  inline uint32_t getSlot (void) const { return slot; }
250
 
  inline void setSlot (uint32_t value) { slot= value; }
251
 
 
252
239
  bool is_user_selectable() const
253
240
  {
254
241
    return not flags.test(HTON_BIT_NOT_USER_SELECTABLE);
271
258
  }
272
259
 
273
260
  /*
274
 
    StorageEngine methods:
275
 
 
276
 
    close_connection is only called if
277
 
    session->ha_data[xxx_engine.slot] is non-zero, so even if you don't need
278
 
    this storage area - set it to something, so that MySQL would know
279
 
    this storage engine was accessed in this connection
280
 
  */
 
261
   * Called during Session::cleanup() for all engines
 
262
   */
281
263
  virtual int close_connection(Session  *)
282
264
  {
283
265
    return 0;
431
413
  static int deleteDefinitionFromPath(TableIdentifier &identifier);
432
414
  static int renameDefinitionFromPath(TableIdentifier &dest, TableIdentifier &src);
433
415
  static int writeDefinitionFromPath(TableIdentifier &identifier, message::Table &proto);
 
416
 
 
417
public:
 
418
  /* 
 
419
   * The below are simple virtual overrides for the plugin::MonitoredInTransaction
 
420
   * interface.
 
421
   */
 
422
  virtual bool participatesInSqlTransaction() const
 
423
  {
 
424
    return false; /* plugin::StorageEngine is non-transactional in terms of SQL */
 
425
  }
 
426
  virtual bool participatesInXaTransaction() const
 
427
  {
 
428
    return false; /* plugin::StorageEngine is non-transactional in terms of XA */
 
429
  }
 
430
  virtual bool alwaysRegisterForXaTransaction() const
 
431
  {
 
432
    return false;
 
433
  }
434
434
};
435
435
 
436
436
} /* namespace plugin */