1
/* Copyright (C) 2005 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
17
#ifndef PLUGIN_INFORMATION_ENGINE_HA_INFORMATION_ENGINE_H
18
#define PLUGIN_INFORMATION_ENGINE_HA_INFORMATION_ENGINE_H
20
#include <drizzled/server_includes.h>
21
#include <drizzled/handler.h>
22
#include <mysys/thr_lock.h>
23
#include "information_share.h"
27
Class definition for the information engine
29
class InformationCursor: public handler
31
THR_LOCK_DATA lock; /* MySQL lock */
32
InformationShare *share;
35
InformationCursor(drizzled::plugin::StorageEngine *engine, TableShare *table_arg);
40
The name of the index type that will be used for display
41
don't implement this method unless you really have indexes
43
uint64_t table_flags() const
47
uint32_t index_flags(uint32_t inx, uint32_t part, bool all_parts) const;
48
/* The following defines can be increased if necessary */
49
int open(const char *name, int mode, uint32_t test_if_locked);
51
int write_row(unsigned char * buf);
52
int rnd_init(bool scan);
53
int rnd_next(unsigned char *buf);
54
int rnd_pos(unsigned char * buf, unsigned char *pos);
55
void position(const unsigned char *record);
56
int info(uint32_t flag);
57
int external_lock(Session *session, int lock_type);
58
THR_LOCK_DATA **store_lock(Session *session,
60
enum thr_lock_type lock_type);
63
static const char *InformationEngine_exts[] = {
67
class InformationEngineNameIterator: public drizzled::plugin::TableNameIteratorImplementation
70
InformationEngineNameIterator(const std::string &database)
71
: drizzled::plugin::TableNameIteratorImplementation(database)
74
int next(std::string *)
81
class InformationEngine : public drizzled::plugin::StorageEngine
84
InformationEngine(const string &name_arg)
85
: drizzled::plugin::StorageEngine(name_arg,
87
| HTON_HAS_DATA_DICTIONARY) {}
88
virtual handler *create(TableShare *table, MEM_ROOT *mem_root)
90
return new (mem_root) InformationCursor(this, table);
93
const char **bas_ext() const {
94
return InformationEngine_exts;
97
int createTableImplementation(Session*, const char *, Table *,
98
HA_CREATE_INFO *, drizzled::message::Table*);
100
int deleteTableImplementation(Session*, const string table_name);
102
drizzled::plugin::TableNameIteratorImplementation* tableNameIterator(const std::string &database)
104
return new InformationEngineNameIterator(database);
108
#endif /* PLUGIN_INFORMATION_ENGINE_HA_INFORMATION_ENGINE_H */