~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbxt/src/ha_pbxt.h

  • Committer: Monty Taylor
  • Date: 2010-04-22 05:16:07 UTC
  • mto: (1527.1.5 staging)
  • mto: This revision was merged to the branch mainline in revision 1527.
  • Revision ID: mordred@inaugust.com-20100422051607-tdscrqr5951oi4fx
dtrace is broken on FreeBSD. Check for that and don't attempt to use it if it don't work.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2005 PrimeBase Technologies GmbH
 
1
/* Copyright (c) 2005 PrimeBase Technologies GmbH
2
2
 *
3
3
 * Derived from ha_example.h
4
4
 * Copyright (C) 2003 MySQL AB
17
17
 *
18
18
 * You should have received a copy of the GNU General Public License
19
19
 * along with this program; if not, write to the Free Software
20
 
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA    02110-1301      USA
 
20
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA     02111-1307      USA
21
21
 *
22
22
 * 2005-11-10   Paul McCullagh
23
23
 *
68
68
                                        HTON_FAST_KEY_READ | 
69
69
                                        HTON_NULL_IN_KEY | 
70
70
                                        HTON_CAN_INDEX_BLOBS |
71
 
                                        HTON_AUTO_PART_KEY |
72
 
                                        HTON_HAS_FOREIGN_KEYS |
73
 
                    HTON_HAS_DOES_TRANSACTIONS) 
 
71
                                        HTON_AUTO_PART_KEY) 
74
72
        {}
75
73
 
76
74
        void operator delete(void *) {}
77
75
        void operator delete[] (void *) {}
78
76
 
79
 
        /* override */ uint32_t index_flags(enum  ha_key_alg) const;
80
77
        /* override */ int close_connection(Session *);
81
78
        /* override */ int commit(Session *, bool);
82
79
        /* override */ int rollback(Session *, bool);
83
 
        /* override */ Cursor *create(Table&);
 
80
        /* override */ Cursor *create(TableShare&, memory::Root *);
84
81
        /* override */ void drop_database(char *);
85
82
        /* override */ bool show_status(Session *, stat_print_fn *, enum ha_stat_type);
86
83
        /* override */ const char **bas_ext() const;
87
 
        /* override */ int doCreateTable(Session& session, Table &table_arg, const TableIdentifier& ident,  drizzled::message::Table &proto);
88
 
        /* override */ int doRenameTable(Session& session, const TableIdentifier& from, const TableIdentifier& to);
89
 
        /* override */ int doDropTable(Session &session, const TableIdentifier& ident);
 
84
        /* override */ int doCreateTable(Session& session, Table &table_arg, TableIdentifier& ident,  drizzled::message::Table &proto);
 
85
        /* override */ int doRenameTable(Session& session, TableIdentifier& from, TableIdentifier& to);
 
86
        /* override */ int doDropTable(Session &session, TableIdentifier& ident);
90
87
 
91
88
        /* override */ int doStartTransaction(Session *session, start_transaction_option_t options);
92
89
        /* override */ int doStartConsistentSnapshot(Session *) { /* obsolete */ return -1; }
98
95
        /* override */ int doCommit(drizzled::Session*, bool);
99
96
        /* override */ int doRollback(drizzled::Session*, bool);
100
97
 
101
 
        /* override */ uint32_t max_supported_keys(void) const { return UINT32_MAX; }
 
98
        /* override */ uint32_t max_supported_keys(void) const { return -1; }
102
99
        /* override */ uint32_t max_supported_key_part_length(void) const { return MAX_KEY_LENGTH; }
103
100
 
104
 
        /* override */ void doGetTableIdentifiers(drizzled::CachedDirectory&,
105
 
                                                  const drizzled::SchemaIdentifier&,
106
 
                                                  drizzled::TableIdentifier::vector&) {}
107
 
 
108
 
        /* override */ bool doDoesTableExist(Session&, const TableIdentifier &identifier);
109
 
 
110
 
        virtual void shutdownPlugin();
111
 
 
112
 
        ~PBXTStorageEngine();
 
101
        /* override */ void doGetTableIdentifiers(drizzled::CachedDirectory&,
 
102
                                           drizzled::SchemaIdentifier&,
 
103
                                           drizzled::TableIdentifiers&) {}
 
104
 
 
105
        /* override */ void doGetTableNames(CachedDirectory&, 
 
106
                                        SchemaIdentifier&, 
 
107
                                        std::set<std::string>&) {}
 
108
 
 
109
        /* override */ bool doDoesTableExist(Session&, TableIdentifier &identifier);
 
110
 
 
111
        ~PBXTStorageEngine();
113
112
};
114
113
 
115
114
typedef PBXTStorageEngine handlerton;
174
173
        THD                                     *pb_mysql_thd;                  /* A pointer to the MySQL thread. */
175
174
        xtBool                          pb_in_stat;                             /* TRUE of start_stmt() was issued */
176
175
 
177
 
        ha_pbxt(plugin::StorageEngine &engine_arg, Table &table_arg);
 
176
#ifdef DRIZZLED
 
177
        ha_pbxt(handlerton *hton, TableShare& table_arg);
 
178
#else
 
179
        ha_pbxt(handlerton *hton, TABLE_SHARE *table_arg);
 
180
#endif
178
181
        virtual ~ha_pbxt() { }
179
182
 
180
183
        /* The name that will be used for display purposes */
198
201
        MX_TABLE_TYPES_T table_flags() const;
199
202
 
200
203
        /*
 
204
         * part is the key part to check. First key part is 0
 
205
         * If all_parts it's set, MySQL want to know the flags for the combined
 
206
         * index up to and including 'part'.
 
207
         */
 
208
        MX_ULONG_T index_flags(uint inx, uint part, bool all_parts) const;
 
209
 
 
210
        /*
201
211
         * unireg.cc will call the following to make sure that the storage engine can
202
212
         * handle the data it is about to send.
203
213
         * 
242
252
        int             xt_index_in_range(register XTOpenTablePtr ot, register XTIndexPtr ind, register XTIdxSearchKeyPtr search_key, byte *buf);
243
253
        int             xt_index_next_read(register XTOpenTablePtr ot, register XTIndexPtr ind, xtBool key_only, register XTIdxSearchKeyPtr search_key, byte *buf);
244
254
        int             xt_index_prev_read(XTOpenTablePtr ot, XTIndexPtr ind, xtBool key_only, register XTIdxSearchKeyPtr search_key, byte *buf);
245
 
        int             doStartIndexScan(uint idx, bool sorted);
246
 
        int             doEndIndexScan();
 
255
        int             index_init(uint idx, bool sorted);
 
256
        int             index_end();
247
257
        int             index_read(byte * buf, const byte * key,
248
258
                                                                 uint key_len, enum ha_rkey_function find_flag);
249
259
        int             index_read_idx(byte * buf, uint idx, const byte * key,
258
268
        int             index_read_last(byte * buf, const byte * key, uint key_len);
259
269
 
260
270
        /* Sequential scan functions: */
261
 
        int             doStartTableScan(bool scan);                                                            //required
262
 
        int             doEndTableScan();
 
271
        int             rnd_init(bool scan);                                                            //required
 
272
        int             rnd_end();
263
273
        int             rnd_next(byte *buf);                                                            //required
264
274
        int             rnd_pos(byte * buf, byte *pos);                                                                                                  //required
265
275
        void    position(const byte *record);                   //required
276
286
        void    unlock_row();
277
287
        int             delete_all_rows(void);
278
288
        int             repair(THD* thd, HA_CHECK_OPT* check_opt);
 
289
#ifdef DRIZZLED
279
290
        int             analyze(THD* thd);
280
291
        int             optimize(THD* thd);
281
292
        int             check(THD* thd);
 
293
#else
 
294
        int             analyze(THD* thd, HA_CHECK_OPT* check_opt);
 
295
        int             optimize(THD* thd, HA_CHECK_OPT* check_opt);
 
296
        int             check(THD* thd, HA_CHECK_OPT* check_opt);
 
297
#endif
282
298
        ha_rows records_in_range(uint inx, key_range *min_key, key_range *max_key);
 
299
#ifndef DRIZZLED
 
300
        int             delete_system_table(const char *table_path);
 
301
        int             delete_table(const char *from);
 
302
        int             rename_system_table(const char * from, const char * to);
 
303
        int             rename_table(const char * from, const char * to);
 
304
        int             create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);                             //required
 
305
#endif
 
306
        void    update_create_info(HA_CREATE_INFO *create_info);
283
307
 
284
308
        THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type);          //required
285
309
 
329
353
#define thd_query(t)                                            &(t)->query
330
354
#define thd_slave_thread(t)                                     (t)->slave_thread
331
355
#define thd_binlog_format(t)                            (t)->variables.binlog_format
 
356
#define thd_mark_transaction_to_rollback(t)     mark_transaction_to_rollback(t, all)
332
357
#endif // INNODB_COMPATIBILITY_HOOKS */
333
358
#endif /* !DRIZZLED */
334
359