~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/plugin/storage_engine.h

  • Committer: Stewart Smith
  • Date: 2010-07-27 19:43:43 UTC
  • mto: (1720.1.1 drizzle)
  • mto: This revision was merged to the branch mainline in revision 1721.
  • Revision ID: stewart@flamingspork.com-20100727194343-rj79lftdvityzqlg
fix SHOW CREATE TABLE tests for explicit COLLATE in CREATE TABLE

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include <drizzled/definitions.h>
25
25
#include <drizzled/plugin.h>
26
26
#include <drizzled/handler_structs.h>
27
 
#include <drizzled/message.h>
28
 
#include <drizzled/message/cache.h>
 
27
#include <drizzled/message/schema.pb.h>
 
28
#include <drizzled/message/table.pb.h>
29
29
#include "drizzled/plugin/plugin.h"
30
30
#include "drizzled/sql_string.h"
31
31
#include "drizzled/identifier.h"
32
32
#include "drizzled/cached_directory.h"
33
33
#include "drizzled/plugin/monitored_in_transaction.h"
34
34
 
 
35
#include <drizzled/unordered_map.h>
 
36
 
35
37
#include <bitset>
36
38
#include <string>
37
39
#include <vector>
117
119
namespace plugin
118
120
{
119
121
 
 
122
typedef unordered_map<std::string, StorageEngine *> EngineMap;
120
123
typedef std::vector<StorageEngine *> EngineVector;
121
124
 
122
125
typedef std::set<std::string> TableNameList;
252
255
  {
253
256
    return 0;
254
257
  }
255
 
  virtual Cursor *create(Table &)= 0;
 
258
  virtual Cursor *create(TableShare &, memory::Root *)= 0;
256
259
  /* args: path */
257
260
  virtual bool flush_logs() { return false; }
258
261
  virtual bool show_status(Session *, stat_print_fn *, enum ha_stat_type)
286
289
 
287
290
  int renameTable(Session &session, const drizzled::TableIdentifier &from, const drizzled::TableIdentifier &to);
288
291
 
 
292
  // @todo move these to protected
 
293
  virtual void doGetTableNames(CachedDirectory &directory,
 
294
                               const drizzled::SchemaIdentifier &schema_identifier,
 
295
                               TableNameList &set_of_names)= 0;
 
296
 
289
297
  virtual void doGetTableIdentifiers(CachedDirectory &directory,
290
298
                                     const drizzled::SchemaIdentifier &schema_identifier,
291
 
                                     TableIdentifier::vector &set_of_identifiers)= 0;
 
299
                                     TableIdentifiers &set_of_identifiers)= 0;
292
300
 
293
301
  virtual int doDropTable(Session &session,
294
302
                          const drizzled::TableIdentifier &identifier)= 0;
299
307
 
300
308
  static int getTableDefinition(Session& session,
301
309
                                const drizzled::TableIdentifier &identifier,
302
 
                                message::table::shared_ptr &table_proto,
 
310
                                message::Table &table_proto,
303
311
                                bool include_temporary_tables= true);
304
312
  static bool doesTableExist(Session &session,
305
313
                             const drizzled::TableIdentifier &identifier,
320
328
                       const drizzled::TableIdentifier &identifier);
321
329
  static void getIdentifiers(Session &session,
322
330
                             const SchemaIdentifier &schema_identifier,
323
 
                             TableIdentifier::vector &set_of_identifiers);
 
331
                             TableIdentifiers &set_of_identifiers);
324
332
 
325
333
  // Check to see if any SE objects to creation.
326
334
  static bool canCreateTable(const drizzled::TableIdentifier &identifier);
328
336
  { (void)identifier;  return true; }
329
337
 
330
338
  // @note All schema methods defined here
331
 
  static void getIdentifiers(Session &session, SchemaIdentifier::vector &schemas);
332
 
  static bool getSchemaDefinition(const drizzled::TableIdentifier &identifier, message::schema::shared_ptr &proto);
333
 
  static bool getSchemaDefinition(const drizzled::SchemaIdentifier &identifier, message::schema::shared_ptr &proto);
 
339
  static void getIdentifiers(Session &session, SchemaIdentifiers &schemas);
 
340
  static bool getSchemaDefinition(const drizzled::TableIdentifier &identifier, message::Schema &proto);
 
341
  static bool getSchemaDefinition(const drizzled::SchemaIdentifier &identifier, message::Schema &proto);
334
342
  static bool doesSchemaExist(const drizzled::SchemaIdentifier &identifier);
335
343
  static const CHARSET_INFO *getSchemaCollation(const drizzled::SchemaIdentifier &identifier);
336
344
  static bool createSchema(const drizzled::message::Schema &schema_message);
338
346
  static bool alterSchema(const drizzled::message::Schema &schema_message);
339
347
 
340
348
  // @note make private/protected
341
 
  virtual void doGetSchemaIdentifiers(SchemaIdentifier::vector&)
 
349
  virtual void doGetSchemaIdentifiers(SchemaIdentifiers&)
342
350
  { }
343
351
 
344
 
  virtual bool doGetSchemaDefinition(const drizzled::SchemaIdentifier&, drizzled::message::schema::shared_ptr&)
 
352
  virtual bool doGetSchemaDefinition(const drizzled::SchemaIdentifier&, drizzled::message::Schema&)
345
353
  { 
346
354
    return false; 
347
355
  }
366
374
 
367
375
  static void removeLostTemporaryTables(Session &session, const char *directory);
368
376
 
369
 
  Cursor *getCursor(Table &share);
 
377
  Cursor *getCursor(TableShare &share, memory::Root *alloc);
370
378
 
371
379
  uint32_t max_record_length() const
372
380
  { return std::min((unsigned int)HA_MAX_REC_LENGTH, max_supported_record_length()); }