~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: lbieber
  • Date: 2010-10-06 16:34:16 UTC
  • mfrom: (1816.1.3 build)
  • Revision ID: lbieber@orisndriz08-20101006163416-ea0sl59qgpglk21y
Merge Monty - Change the requirement from either libinnodb to libhaildb. Also, tied it to version 2.2
Merge Andrew - fix bug 650935: remove --compress from all clients
Merge Andrew - fix bug 653471: Add -A to drizzle client
Merge Travis - 621861 = To change C structs to C++ classes in Drizzle

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
 *
40
40
#include <drizzled/data_home.h>
41
41
#include <drizzled/error.h>
42
42
#include <drizzled/table.h>
 
43
#include <drizzled/field/timestamp.h>
43
44
#include <drizzled/plugin/transactional_storage_engine.h>
44
45
 
45
46
#define my_strdup(a,b) strdup(a)
113
114
        int doStartTransaction(Session *session, start_transaction_option_t options);
114
115
        int doCommit(Session *, bool);
115
116
        int doRollback(Session *, bool);
116
 
        Cursor *create(Table& table);
117
 
        bool doDropSchema(const drizzled::identifier::Schema&);
 
117
        Cursor *create(TableShare& table);
 
118
        bool doDropSchema(const drizzled::SchemaIdentifier&);
118
119
        
119
120
        /*
120
121
        * Indicates to a storage engine the start of a
135
136
                (void) session;
136
137
        }
137
138
        
138
 
        int doCreateTable(Session&, Table&, const identifier::Table& ident, drizzled::message::Table& );        
139
 
        int doDropTable(Session &, const identifier::Table& );
140
 
        
141
 
        int doRenameTable(Session&, const identifier::Table &from, const identifier::Table &to);
142
 
        
143
 
        void doGetTableIdentifiers(drizzled::CachedDirectory &dir,
144
 
                                   const drizzled::identifier::Schema &schema,
145
 
                                   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) 
146
147
        {
147
148
                std::set<std::string> set_of_names;
148
149
                
149
150
                doGetTableNames(dir, schema, set_of_names);
150
151
                for (std::set<std::string>::iterator set_iter = set_of_names.begin(); set_iter != set_of_names.end(); ++set_iter)
151
152
                {
152
 
                        set_of_identifiers.push_back(identifier::Table(schema, *set_iter));
 
153
                        set_of_identifiers.push_back(TableIdentifier(schema, *set_iter));
153
154
                }
154
155
        }
155
156
        
156
157
        void doGetTableNames(CachedDirectory&, 
157
 
                                        const identifier::Schema &schema, 
 
158
                                        const SchemaIdentifier &schema, 
158
159
                                        std::set<std::string> &set_of_names) 
159
160
        {
160
161
                bool isPBMS = schema.compare("PBMS");
168
169
        int doReleaseSavepoint(Session *session, NamedSavepoint &savepoint);
169
170
        const char **bas_ext() const;
170
171
 
171
 
  int doGetTableDefinition(Session&, const identifier::Table &identifier,
 
172
  int doGetTableDefinition(Session&, const TableIdentifier &identifier,
172
173
                                          drizzled::message::Table &table_proto)
173
174
  {
174
175
                int err;
186
187
                return EEXIST;
187
188
  }
188
189
 
189
 
        bool doDoesTableExist(Session&, const identifier::Table &identifier)
 
190
        bool doDoesTableExist(Session&, const TableIdentifier &identifier)
190
191
        {
191
192
                const char *tab_name = identifier.getTableName().c_str();
192
193
                const char *db_name = identifier.getSchemaName().c_str();
256
257
 
257
258
 
258
259
#ifdef DRIZZLED
259
 
Cursor *PBMSStorageEngine::create(Table& table)
 
260
Cursor *PBMSStorageEngine::create(TableShare& table)
260
261
{
261
262
        PBMSStorageEngine * const hton = this;
262
263
        return new ha_pbms(hton, table);
434
435
#endif
435
436
 
436
437
#ifdef DRIZZLED
437
 
bool  PBMSStorageEngine::doDropSchema(const drizzled::identifier::Schema &schema)
 
438
bool  PBMSStorageEngine::doDropSchema(const drizzled::SchemaIdentifier &schema)
438
439
{
439
440
        CSThread *self;
440
441
        PBMSResultRec result;
654
655
}
655
656
 
656
657
#ifdef DRIZZLED
657
 
ha_pbms::ha_pbms(handlerton *hton, Table& table_arg) : handler(*hton, table_arg),
 
658
ha_pbms::ha_pbms(handlerton *hton, TableShare& table_arg) : handler(*hton, table_arg),
658
659
#else
659
660
ha_pbms::ha_pbms(handlerton *hton, TABLE_SHARE *table_arg) : handler(hton, table_arg),
660
661
#endif
695
696
 
696
697
        inner_();
697
698
        try_(a) {
698
 
                ha_open_tab = MSSystemTableShare::openSystemTable(table_path, getTable());
699
 
#ifdef DRIZZLED
 
699
                ha_open_tab = MSSystemTableShare::openSystemTable(table_path, table);
700
700
                ha_lock.init(&ha_open_tab->myShare->myThrLock);
701
 
#else
702
 
                thr_lock_data_init(&ha_open_tab->myShare->myThrLock, &ha_lock, NULL);
703
 
#endif
704
701
                ref_length = ha_open_tab->getRefLen();
705
702
        }
706
703
        catch_(a) {
1043
1040
 
1044
1041
 
1045
1042
#ifdef DRIZZLED
1046
 
int PBMSStorageEngine::doCreateTable(Session&, Table&, const identifier::Table& , drizzled::message::Table& )
 
1043
int PBMSStorageEngine::doCreateTable(Session&, Table&, const TableIdentifier& , drizzled::message::Table& )
1047
1044
{
1048
1045
        /* You cannot create PBMS tables. */
1049
1046
        return( HA_ERR_WRONG_COMMAND );
1050
1047
}
1051
1048
 
1052
 
int PBMSStorageEngine::doDropTable(Session &, const identifier::Table& )
 
1049
int PBMSStorageEngine::doDropTable(Session &, const TableIdentifier& )
1053
1050
{
1054
1051
        /* You cannot delete PBMS tables. */
1055
1052
        return( 0 );
1056
1053
}
1057
1054
 
1058
 
int PBMSStorageEngine::doRenameTable(Session&, const identifier::Table &, const identifier::Table &)
 
1055
int PBMSStorageEngine::doRenameTable(Session&, const TableIdentifier &, const TableIdentifier &)
1059
1056
{
1060
1057
        /* You cannot rename PBMS tables. */
1061
1058
        return( HA_ERR_WRONG_COMMAND );