~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbms/src/ha_pbms.cc

  • Committer: Monty Taylor
  • Date: 2010-11-08 18:26:08 UTC
  • mto: This revision was merged to the branch mainline in revision 1931.
  • Revision ID: mordred@inaugust.com-20101108182608-lci86acl7r53sbi3
Replaced auto_ptr with scoped_ptr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2008 PrimeBase Technologies GmbH, Germany
 
1
/* Copyright (c) 2008 PrimeBase Technologies GmbH, Germany
2
2
 *
3
3
 * PrimeBase Media Stream for MySQL
4
4
 *
32
32
#endif
33
33
 
34
34
#ifdef DRIZZLED
35
 
#include <config.h>
36
 
 
37
 
#include <drizzled/current_session.h>
 
35
#include "config.h"
38
36
#include <drizzled/common.h>
39
37
#include <drizzled/plugin.h>
40
38
#include <drizzled/field.h>
42
40
#include <drizzled/data_home.h>
43
41
#include <drizzled/error.h>
44
42
#include <drizzled/table.h>
 
43
#include <drizzled/field/timestamp.h>
45
44
#include <drizzled/plugin/transactional_storage_engine.h>
46
45
 
47
46
#define my_strdup(a,b) strdup(a)
116
115
        int doCommit(Session *, bool);
117
116
        int doRollback(Session *, bool);
118
117
        Cursor *create(Table& table);
119
 
        bool doDropSchema(const drizzled::identifier::Schema&);
 
118
        bool doDropSchema(const drizzled::SchemaIdentifier&);
120
119
        
121
120
        /*
122
121
        * Indicates to a storage engine the start of a
137
136
                (void) session;
138
137
        }
139
138
        
140
 
        int doCreateTable(Session&, Table&, const identifier::Table& ident, drizzled::message::Table& );        
141
 
        int doDropTable(Session &, const identifier::Table& );
142
 
        
143
 
        int doRenameTable(Session&, const identifier::Table &from, const identifier::Table &to);
144
 
        
145
 
        void doGetTableIdentifiers(drizzled::CachedDirectory &dir,
146
 
                                   const drizzled::identifier::Schema &schema,
147
 
                                   drizzled::identifier::Table::vector &set_of_identifiers) 
 
139
        int doCreateTable(Session&, Table&, const TableIdentifier& ident, drizzled::message::Table& );  
 
140
        int doDropTable(Session &, const TableIdentifier& );
 
141
        
 
142
        int doRenameTable(Session&, const TableIdentifier &from, const TableIdentifier &to);
 
143
        
 
144
        void doGetTableIdentifiers(drizzled::CachedDirectory &dir,
 
145
                             const drizzled::SchemaIdentifier &schema,
 
146
                             drizzled::TableIdentifiers &set_of_identifiers) 
148
147
        {
149
148
                std::set<std::string> set_of_names;
150
149
                
151
150
                doGetTableNames(dir, schema, set_of_names);
152
151
                for (std::set<std::string>::iterator set_iter = set_of_names.begin(); set_iter != set_of_names.end(); ++set_iter)
153
152
                {
154
 
                        set_of_identifiers.push_back(identifier::Table(schema, *set_iter));
 
153
                        set_of_identifiers.push_back(TableIdentifier(schema, *set_iter));
155
154
                }
156
155
        }
157
156
        
158
157
        void doGetTableNames(CachedDirectory&, 
159
 
                                        const identifier::Schema &schema, 
 
158
                                        const SchemaIdentifier &schema, 
160
159
                                        std::set<std::string> &set_of_names) 
161
160
        {
162
161
                bool isPBMS = schema.compare("PBMS");
170
169
        int doReleaseSavepoint(Session *session, NamedSavepoint &savepoint);
171
170
        const char **bas_ext() const;
172
171
 
173
 
  int doGetTableDefinition(Session&, const identifier::Table &identifier,
 
172
  int doGetTableDefinition(Session&, const TableIdentifier &identifier,
174
173
                                          drizzled::message::Table &table_proto)
175
174
  {
176
175
                int err;
188
187
                return EEXIST;
189
188
  }
190
189
 
191
 
        bool doDoesTableExist(Session&, const identifier::Table &identifier)
 
190
        bool doDoesTableExist(Session&, const TableIdentifier &identifier)
192
191
        {
193
192
                const char *tab_name = identifier.getTableName().c_str();
194
193
                const char *db_name = identifier.getSchemaName().c_str();
436
435
#endif
437
436
 
438
437
#ifdef DRIZZLED
439
 
bool  PBMSStorageEngine::doDropSchema(const drizzled::identifier::Schema &schema)
 
438
bool  PBMSStorageEngine::doDropSchema(const drizzled::SchemaIdentifier &schema)
440
439
{
441
440
        CSThread *self;
442
441
        PBMSResultRec result;
1045
1044
 
1046
1045
 
1047
1046
#ifdef DRIZZLED
1048
 
int PBMSStorageEngine::doCreateTable(Session&, Table&, const identifier::Table& , drizzled::message::Table& )
 
1047
int PBMSStorageEngine::doCreateTable(Session&, Table&, const TableIdentifier& , drizzled::message::Table& )
1049
1048
{
1050
1049
        /* You cannot create PBMS tables. */
1051
1050
        return( HA_ERR_WRONG_COMMAND );
1052
1051
}
1053
1052
 
1054
 
int PBMSStorageEngine::doDropTable(Session &, const identifier::Table& )
 
1053
int PBMSStorageEngine::doDropTable(Session &, const TableIdentifier& )
1055
1054
{
1056
1055
        /* You cannot delete PBMS tables. */
1057
1056
        return( 0 );
1058
1057
}
1059
1058
 
1060
 
int PBMSStorageEngine::doRenameTable(Session&, const identifier::Table &, const identifier::Table &)
 
1059
int PBMSStorageEngine::doRenameTable(Session&, const TableIdentifier &, const TableIdentifier &)
1061
1060
{
1062
1061
        /* You cannot rename PBMS tables. */
1063
1062
        return( HA_ERR_WRONG_COMMAND );