20
20
#include <drizzled/server_includes.h>
21
21
#include <drizzled/cursor.h>
22
22
#include <mysys/thr_lock.h>
23
24
#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;
33
drizzled::plugin::InfoSchemaTable::Rows::iterator iter;
36
InformationCursor(drizzled::plugin::StorageEngine *engine, TableShare *table_arg);
41
The name of the index type that will be used for display
42
don't implement this method unless you really have indexes
44
uint64_t table_flags() const
48
uint32_t index_flags(uint32_t inx, uint32_t part, bool all_parts) const;
49
/* The following defines can be increased if necessary */
50
int open(const char *name, int mode, uint32_t test_if_locked);
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
THR_LOCK_DATA **store_lock(Session *session,
59
enum thr_lock_type lock_type);
62
static const char *InformationEngine_exts[] = {
25
#include "information_cursor.h"
66
27
class InformationEngine : public drizzled::plugin::StorageEngine
30
typedef std::map<const std::string, InformationShare> OpenTables;
31
typedef std::pair<const std::string, InformationShare> Record;
33
OpenTables open_tables;
34
pthread_mutex_t mutex; // Mutext used in getShare() calls
69
37
InformationEngine(const std::string &name_arg)
70
38
: drizzled::plugin::StorageEngine(name_arg,
72
40
| HTON_HAS_DATA_DICTIONARY)
42
pthread_mutex_init(&mutex, NULL);
47
pthread_mutex_destroy(&mutex);
50
// Follow Two Methods are for "share"
51
InformationShare *getShare(const std::string &name_arg);
52
void freeShare(InformationShare *share);
75
55
int doCreateTable(Session *,
91
71
return new (mem_root) InformationCursor(this, table);
94
const char **bas_ext() const {
95
return InformationEngine_exts;
74
const char **bas_ext() const
98
void doGetTableNames(CachedDirectory&, std::string& db, std::set<std::string>& set_of_names);
79
void doGetTableNames(CachedDirectory&,
81
std::set<std::string> &set_of_names);
83
int doGetTableDefinition(Session &session,
86
const char *table_name,
88
drizzled::message::Table *table_proto);
101
92
#endif /* PLUGIN_INFORMATION_ENGINE_INFORMATION_ENGINE_H */