~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/schema_engine/schema.h

  • Committer: Monty Taylor
  • Date: 2010-09-16 23:12:30 UTC
  • mto: (1775.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 1773.
  • Revision ID: mordred@inaugust.com-20100916231230-uchkqks21rwzbmpz
Include files in tarball that were being left out.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include <assert.h>
25
25
#include <drizzled/plugin/storage_engine.h>
 
26
#include <drizzled/data_home.h>
26
27
#include <boost/unordered_map.hpp>
27
28
#include <boost/thread/shared_mutex.hpp>
28
29
 
34
35
 
35
36
class Schema : public drizzled::plugin::StorageEngine
36
37
{
37
 
  bool writeSchemaFile(const drizzled::identifier::Schema &schema_identifier, const drizzled::message::Schema &db);
38
 
  bool readSchemaFile(const drizzled::identifier::Schema &schema_identifier, drizzled::message::Schema &schema);
39
 
  bool readSchemaFile(std::string filename, drizzled::message::Schema &schema);
 
38
  bool writeSchemaFile(const drizzled::SchemaIdentifier &schema_identifier, const drizzled::message::Schema &db);
 
39
  bool readSchemaFile(const std::string &schema_file_name, drizzled::message::Schema &schema);
40
40
 
41
41
  void prime();
42
 
  void startup(drizzled::Session &session);
43
42
 
44
 
  typedef boost::unordered_map<std::string, drizzled::message::schema::shared_ptr> SchemaCache;
 
43
  typedef boost::unordered_map<std::string, drizzled::message::Schema> SchemaCache;
45
44
  SchemaCache schema_cache;
46
45
  bool schema_cache_filled;
47
46
 
53
52
  ~Schema();
54
53
 
55
54
 
56
 
  drizzled::Cursor *create(drizzled::Table &)
 
55
  bool doCanCreateTable(const drizzled::TableIdentifier &identifier);
 
56
 
 
57
  drizzled::Cursor *create(drizzled::TableShare &)
57
58
  {
58
59
    return NULL;
59
60
  }
60
61
 
61
 
  void doGetSchemaIdentifiers(drizzled::identifier::Schema::vector &set_of_names);
62
 
  bool doGetSchemaDefinition(const drizzled::identifier::Schema&, drizzled::message::schema::shared_ptr &proto);
 
62
  void doGetSchemaIdentifiers(drizzled::SchemaIdentifiers &set_of_names);
 
63
  bool doGetSchemaDefinition(const drizzled::SchemaIdentifier&, drizzled::message::Schema &proto);
63
64
 
64
65
  bool doCreateSchema(const drizzled::message::Schema &schema_message);
65
66
 
66
67
  bool doAlterSchema(const drizzled::message::Schema &schema_message);
67
68
 
68
 
  bool doDropSchema(const drizzled::identifier::Schema&);
 
69
  bool doDropSchema(const drizzled::SchemaIdentifier&);
69
70
 
70
71
  // Below are table methods that we don't implement (and don't need)
71
72
 
72
73
  int doGetTableDefinition(drizzled::Session&,
73
 
                           const drizzled::identifier::Table&,
 
74
                           const drizzled::TableIdentifier&,
74
75
                           drizzled::message::Table&)
75
76
  {
76
77
    return ENOENT;
77
78
  }
78
79
 
79
 
  bool doDoesTableExist(drizzled::Session&, const drizzled::identifier::Table&)
 
80
 
 
81
  void doGetTableNames(drizzled::CachedDirectory&,
 
82
                       const drizzled::SchemaIdentifier&,
 
83
                       std::set<std::string>&)
 
84
  {
 
85
  }
 
86
 
 
87
  bool doDoesTableExist(drizzled::Session&, const drizzled::TableIdentifier&)
80
88
  {
81
89
    return false;
82
90
  }
83
91
 
84
 
  int doRenameTable(drizzled::Session&, const drizzled::identifier::Table&, const drizzled::identifier::Table&)
 
92
  int doRenameTable(drizzled::Session&, const drizzled::TableIdentifier&, const drizzled::TableIdentifier&)
85
93
  {
86
 
    return drizzled::HA_ERR_NO_SUCH_TABLE;
 
94
    return EPERM;
87
95
  }
88
96
 
89
97
  int doCreateTable(drizzled::Session&,
90
98
                    drizzled::Table&,
91
 
                    const drizzled::identifier::Table&,
 
99
                    const drizzled::TableIdentifier&,
92
100
                    drizzled::message::Table&)
93
101
  {
94
 
    return drizzled::ER_TABLE_PERMISSION_DENIED;
 
102
    return EPERM;
95
103
  }
96
104
 
97
 
  int doDropTable(drizzled::Session&, const drizzled::identifier::Table&)
 
105
  int doDropTable(drizzled::Session&, const drizzled::TableIdentifier&)
98
106
  {
99
 
    return drizzled::HA_ERR_NO_SUCH_TABLE;
 
107
    return 0;
100
108
  }
101
109
 
102
110
  const char **bas_ext() const 
109
117
                          uint64_t *,
110
118
                          uint64_t *)
111
119
  {}
112
 
 
113
120
  void doGetTableIdentifiers(drizzled::CachedDirectory &directory,
114
 
                             const drizzled::identifier::Schema &schema_identifier,
115
 
                             drizzled::identifier::Table::vector &set_of_identifiers);
 
121
                             const drizzled::SchemaIdentifier &schema_identifier,
 
122
                             drizzled::TableIdentifiers &set_of_identifiers);
116
123
};
117
124
 
118
125
#endif /* PLUGIN_SCHEMA_ENGINE_SCHEMA_H */