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_INFORMATION_ENGINE_H
18
#define PLUGIN_INFORMATION_ENGINE_INFORMATION_ENGINE_H
20
#include <drizzled/server_includes.h>
21
#include <drizzled/cursor.h>
22
#include <mysys/thr_lock.h>
23
#include "information_share.h"
27
Class definition for the information engine
29
class InformationCursor: public Cursor
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 rnd_init(bool scan);
52
int rnd_next(unsigned char *buf);
53
int rnd_pos(unsigned char * buf, unsigned char *pos);
54
void position(const unsigned char *record);
55
int info(uint32_t flag);
56
THR_LOCK_DATA **store_lock(Session *session,
58
enum thr_lock_type lock_type);
61
static const char *InformationEngine_exts[] = {
65
class InformationEngine : public drizzled::plugin::StorageEngine
68
InformationEngine(const std::string &name_arg)
69
: drizzled::plugin::StorageEngine(name_arg,
71
| HTON_HAS_DATA_DICTIONARY)
74
int doCreateTable(Session *,
78
drizzled::message::Table&)
83
int doDropTable(Session&, const std::string)
88
virtual Cursor *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
void doGetTableNames(CachedDirectory&, std::string& db, std::set<std::string>& set_of_names);
100
#endif /* PLUGIN_INFORMATION_ENGINE_INFORMATION_ENGINE_H */