~drizzle-trunk/drizzle/development

« back to all changes in this revision

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

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 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, Table& 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
#ifdef DRIZZLED
 
89
        int             doStartTableScan(bool scan);
 
90
#else
 
91
        int             rnd_init(bool scan);
 
92
#endif
 
93
        int             rnd_next(byte *buf);
 
94
        int             rnd_pos(byte * buf, byte *pos);
 
95
        void    position(const byte *record);
 
96
        int             info(uint);
 
97
 
 
98
        int             external_lock(THD *thd, int lock_type);
 
99
        int             delete_table(const char *from);
 
100
        int             create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
 
101
 
 
102
        THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type);
 
103
        bool get_error_message(int error, String *buf);
 
104
 
 
105
        // dummy implmentation
 
106
        void get_auto_increment(MX_ULONGLONG_T XT_UNUSED(offset), MX_ULONGLONG_T XT_UNUSED(increment),
 
107
                                 MX_ULONGLONG_T XT_UNUSED(nb_desired_values),
 
108
                                 MX_ULONGLONG_T *first_value,
 
109
                                 MX_ULONGLONG_T *nb_reserved_values) 
 
110
        {
 
111
                *first_value = 1;
 
112
                *nb_reserved_values = 1;
 
113
        }
 
114
};
 
115
 
 
116
#endif
 
117