~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

lp:drizzle + pbxt 1.1 + test results

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 2008 PrimeBase Technologies GmbH, Germany
 
2
 *
 
3
 * PrimeBase XT
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License as published by
 
7
 * the Free Software Foundation; either version 2 of the License, or
 
8
 * (at your option) any later version.
 
9
 *
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 *
 
15
 * You should have received a copy of the GNU General Public License
 
16
 * along with this program; if not, write to the Free Software
 
17
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 
18
 *
 
19
 * Paul McCullagh
 
20
 *
 
21
 * 2007-05-20
 
22
 *
 
23
 * H&G2JCtL
 
24
 *
 
25
 * PBXT System Table handler.
 
26
 *
 
27
 */
 
28
#ifndef __HA_XTSYS_H__
 
29
#define __HA_XTSYS_H__
 
30
 
 
31
#ifdef DRIZZLED
 
32
#include <drizzled/common.h>
 
33
#include <drizzled/handler_structs.h>
 
34
#include <drizzled/current_session.h>
 
35
#include <drizzled/plugin/storage_engine.h>
 
36
#include <drizzled/cursor.h>
 
37
using namespace drizzled;
 
38
using namespace drizzled::plugin;
 
39
#else
 
40
#include "mysql_priv.h"
 
41
#endif
 
42
 
 
43
#include "xt_defs.h"
 
44
 
 
45
#ifdef USE_PRAGMA_INTERFACE
 
46
#pragma interface                       /* gcc class implementation */
 
47
#endif
 
48
 
 
49
#if MYSQL_VERSION_ID >= 50120
 
50
#define byte uchar
 
51
#endif
 
52
 
 
53
class XTOpenSystemTable;
 
54
 
 
55
class ha_xtsys: public handler
 
56
{
 
57
        THR_LOCK_DATA           ha_lock;                        ///< MySQL lock
 
58
        XTOpenSystemTable       *ha_open_tab;
 
59
 
 
60
public:
 
61
#ifdef DRIZZLED
 
62
        ha_xtsys(handlerton *hton, TableShare& table_arg);
 
63
#else
 
64
        ha_xtsys(handlerton *hton, TABLE_SHARE *table_arg);
 
65
#endif
 
66
        ~ha_xtsys() { }
 
67
 
 
68
        const char *table_type() const { return "PBXT"; }
 
69
 
 
70
        const char *index_type(uint XT_UNUSED(inx)) {
 
71
                return "NONE";
 
72
        }
 
73
 
 
74
        const char **bas_ext() const;
 
75
 
 
76
        MX_TABLE_TYPES_T table_flags() const {
 
77
                return HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE;
 
78
        }
 
79
 
 
80
        MX_ULONG_T index_flags(uint XT_UNUSED(inx), uint XT_UNUSED(part), bool XT_UNUSED(all_parts)) const {
 
81
                return (HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | HA_KEYREAD_ONLY);
 
82
        }
 
83
        uint    max_supported_keys()                    const { return 512; }
 
84
        uint    max_supported_key_part_length() const { return 1024; }
 
85
 
 
86
        int             open(const char *name, int mode, uint test_if_locked);
 
87
        int             close(void);
 
88
        int             rnd_init(bool scan);
 
89
        int             rnd_next(byte *buf);
 
90
        int             rnd_pos(byte * buf, byte *pos);
 
91
        void    position(const byte *record);
 
92
        int             info(uint);
 
93
 
 
94
        int             external_lock(THD *thd, int lock_type);
 
95
        int             delete_table(const char *from);
 
96
        int             create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
 
97
 
 
98
        THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type);
 
99
        bool get_error_message(int error, String *buf);
 
100
 
 
101
        // dummy implmentation
 
102
        void get_auto_increment(MX_ULONGLONG_T XT_UNUSED(offset), MX_ULONGLONG_T XT_UNUSED(increment),
 
103
                                 MX_ULONGLONG_T XT_UNUSED(nb_desired_values),
 
104
                                 MX_ULONGLONG_T *first_value,
 
105
                                 MX_ULONGLONG_T *nb_reserved_values) 
 
106
        {
 
107
                *first_value = 1;
 
108
                *nb_reserved_values = 1;
 
109
        }
 
110
};
 
111
 
 
112
#endif
 
113