~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/pbms/src/ha_pbms.h

  • Committer: Monty Taylor
  • Date: 2008-08-05 19:01:20 UTC
  • mto: (266.1.1 codestyle)
  • mto: This revision was merged to the branch mainline in revision 266.
  • Revision ID: monty@inaugust.com-20080805190120-tsuziqz2mfqcw7pe
Removed libmysyslt.la, made mysys a noinst_ and made everything use it. It's
not a standalone lib, there's no reason to pretend otherwise.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2008 PrimeBase Technologies GmbH, Germany
2
 
 *
3
 
 * PrimeBase Media Stream for MySQL
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
 
 * Original author: Paul McCullagh
20
 
 * Continued development: Barry Leslie
21
 
 *
22
 
 * 2007-05-20
23
 
 *
24
 
 * H&G2JCtL
25
 
 *
26
 
 * Table handler.
27
 
 *
28
 
 */
29
 
#ifndef __HA_PBMS_H__
30
 
#define __HA_PBMS_H__
31
 
 
32
 
#include "defs_ms.h"
33
 
#include "engine_ms.h"
34
 
 
35
 
#ifdef USE_PRAGMA_INTERFACE
36
 
#pragma interface                       /* gcc class implementation */
37
 
#endif
38
 
 
39
 
#if MYSQL_VERSION_ID >= 50120
40
 
#define byte uchar
41
 
#endif
42
 
 
43
 
#ifdef DRIZZLED
44
 
#include <drizzled/cursor.h>
45
 
#include <drizzled/thr_lock.h>
46
 
 
47
 
class PBMSStorageEngine;
48
 
#define handlerton PBMSStorageEngine
49
 
#define handler Cursor
50
 
 
51
 
using namespace drizzled;
52
 
 
53
 
#else
54
 
extern handlerton               *pbms_hton;
55
 
#endif
56
 
 
57
 
class MSOpenSystemTable;
58
 
 
59
 
class ha_pbms: public handler
60
 
{
61
 
        THR_LOCK_DATA           ha_lock;                        ///< MySQL lock
62
 
        MSOpenSystemTable       *ha_open_tab;
63
 
        int                                     ha_error;
64
 
        PBMSResultRec           ha_result;
65
 
        //MS_SHARE                      *ha_share;              ///< Shared lock info
66
 
 
67
 
public:
68
 
#ifdef DRIZZLED
69
 
        ha_pbms(handlerton *hton, TableShare& table_arg);
70
 
#else
71
 
        ha_pbms(handlerton *hton, TABLE_SHARE *table_arg);
72
 
#endif
73
 
        ~ha_pbms() { }
74
 
 
75
 
        const char *table_type() const { return "PBMS"; }
76
 
 
77
 
        const char *index_type(uint inx) { UNUSED(inx); return "NONE"; }
78
 
 
79
 
#ifndef DRIZZLED
80
 
        const char **bas_ext() const;
81
 
 
82
 
        MX_TABLE_TYPES_T table_flags() const;
83
 
#endif
84
 
 
85
 
        MX_ULONG_T index_flags(uint inx, uint part , bool all_parts ) const 
86
 
        { 
87
 
                UNUSED(inx); 
88
 
                UNUSED(part); 
89
 
                UNUSED(all_parts); 
90
 
                return (HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE | HA_KEYREAD_ONLY); 
91
 
        }
92
 
        uint    max_supported_keys()                    const { return 512; }
93
 
        uint    max_supported_key_length()    const { return 1024; }
94
 
        uint    max_supported_key_part_length() const { return 1024; }
95
 
 
96
 
        int open(const char *name, int mode, uint test_if_locked);
97
 
        void drop_table(const char *name) {UNUSED(name);}
98
 
 
99
 
        int close(void);
100
 
#ifdef DRIZZLED
101
 
        int             doInsertRecord(byte * buf);
102
 
        int             doUpdateRecord(const byte * old_data, byte * new_data);
103
 
        int             doDeleteRecord(const byte * buf);
104
 
 
105
 
#else
106
 
        int write_row(unsigned char * buf);
107
 
        int update_row(const unsigned char * old_data, unsigned char * new_data);
108
 
        int delete_row(const unsigned char * buf);
109
 
#endif
110
 
 
111
 
        /* Sequential scan functions: */
112
 
#ifdef DRIZZLED
113
 
        int     doStartTableScan(bool scan);
114
 
#else
115
 
        int rnd_init(bool scan);
116
 
#endif
117
 
        int rnd_next(byte *buf);
118
 
        int rnd_pos(byte * buf, byte *pos);
119
 
        void position(const byte *record);
120
 
        int info(uint);
121
 
 
122
 
#ifdef PBMS_HAS_KEYS
123
 
        /* Index access functions: */
124
 
        int             index_init(uint idx, bool sorted);
125
 
        int             index_end();
126
 
        int             index_read(byte * buf, const byte * key,
127
 
                                                                 uint key_len, enum ha_rkey_function find_flag);
128
 
        int             index_read_idx(byte * buf, uint idx, const byte * key,
129
 
                                                                                 uint key_len, enum ha_rkey_function find_flag);
130
 
        int             index_next(byte * buf);
131
 
        int             index_prev(byte * buf);
132
 
        int             index_first(byte * buf);
133
 
        int             index_last(byte * buf);
134
 
        int             index_read_last(byte * buf, const byte * key, uint key_len);
135
 
#endif
136
 
        
137
 
        int             external_lock(THD *thd, int lock_type);
138
 
#ifndef DRIZZLED
139
 
        int create(const char *name, TABLE *form, HA_CREATE_INFO *create_info);
140
 
#endif
141
 
  void get_auto_increment(uint64_t, uint64_t,
142
 
                          uint64_t,
143
 
                          uint64_t *,
144
 
                          uint64_t *)
145
 
  {}
146
 
 
147
 
        THR_LOCK_DATA **store_lock(THD *thd, THR_LOCK_DATA **to, enum thr_lock_type lock_type);
148
 
 
149
 
        bool get_error_message(int error, String *buf);
150
 
 
151
 
};
152
 
 
153
 
#endif
154