~drizzle-trunk/drizzle/development

575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
4
 *  Copyright (C) 2008 Sun Microsystems
5
 *
6
 *  This program is free software; you can redistribute it and/or modify
7
 *  it under the terms of the GNU General Public License as published by
8
 *  the Free Software Foundation; version 2 of the License.
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
20
#ifndef DRIZZLED_HANDLER_STRUCTS_H
21
#define DRIZZLED_HANDLER_STRUCTS_H
22
1241.9.28 by Monty Taylor
Removed global_charset_info.h from server_includes.h
23
#if TIME_WITH_SYS_TIME
24
# include <sys/time.h>
25
# include <time.h>
26
#else
27
# if HAVE_SYS_TIME_H
28
#  include <sys/time.h>
29
# else
30
#  include <time.h>
31
# endif
32
#endif
575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
33
34
#include <drizzled/base.h>
35
#include <drizzled/structs.h>
36
#include <drizzled/definitions.h>
37
#include <drizzled/lex_string.h>
1241.9.28 by Monty Taylor
Removed global_charset_info.h from server_includes.h
38
#include "drizzled/global_charset_info.h"
39
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
40
namespace drizzled
41
{
575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
42
43
struct st_key;
44
typedef struct st_key KEY;
45
typedef struct st_key_cache KEY_CACHE;
46
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
47
1130.1.4 by Monty Taylor
Moved StorageEngine into plugin namespace.
48
namespace plugin
49
{
50
class StorageEngine;
51
}
52
575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
53
typedef struct st_ha_create_information
54
{
55
  const CHARSET_INFO *table_charset, *default_table_charset;
56
  const char *alias;
57
  uint64_t auto_increment_value;
58
  uint32_t table_options;
59
  uint32_t used_fields;
1030.1.2 by Brian Aker
More alignment for structures
60
  enum row_type row_type;
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
61
  plugin::StorageEngine *db_type;
575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
62
  bool table_existed;			/* 1 in create if table existed */
63
} HA_CREATE_INFO;
64
65
typedef struct st_ha_alter_information
66
{
67
  KEY  *key_info_buffer;
68
  uint32_t key_count;
69
  uint32_t index_drop_count;
70
  uint32_t *index_drop_buffer;
71
  uint32_t index_add_count;
72
  uint32_t *index_add_buffer;
73
  void *data;
74
} HA_ALTER_INFO;
75
76
77
typedef struct st_key_create_information
78
{
79
  enum ha_key_alg algorithm;
80
  uint32_t block_size;
81
  LEX_STRING comment;
82
} KEY_CREATE_INFO;
83
84
85
typedef struct st_ha_check_opt
86
{
87
  st_ha_check_opt() {}                        /* Remove gcc warning */
88
} HA_CHECK_OPT;
89
90
91
typedef struct st_range_seq_if
92
{
93
  /*
94
    Initialize the traversal of range sequence
95
96
    SYNOPSIS
97
    init()
98
    init_params  The seq_init_param parameter
99
    n_ranges     The number of ranges obtained
100
    flags        A combination of HA_MRR_SINGLE_POINT, HA_MRR_FIXED_KEY
101
102
    RETURN
103
    An opaque value to be used as RANGE_SEQ_IF::next() parameter
104
  */
105
  range_seq_t (*init)(void *init_params, uint32_t n_ranges, uint32_t flags);
106
107
108
  /*
109
    Get the next range in the range sequence
110
111
    SYNOPSIS
112
    next()
113
    seq    The value returned by RANGE_SEQ_IF::init()
114
    range  OUT Information about the next range
115
116
    RETURN
117
    0 - Ok, the range structure filled with info about the next range
118
    1 - No more ranges
119
  */
120
  uint32_t (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);
121
} RANGE_SEQ_IF;
122
123
/*
124
  This is a buffer area that the handler can use to store rows.
125
  'end_of_used_area' should be kept updated after calls to
126
  read-functions so that other parts of the code can use the
127
  remaining area (until next read calls is issued).
128
*/
129
130
typedef struct st_handler_buffer
131
{
132
  unsigned char *buffer;         /* Buffer one can start using */
133
  unsigned char *buffer_end;     /* End of buffer */
134
  unsigned char *end_of_used_area;     /* End of area that was used by handler */
135
} HANDLER_BUFFER;
136
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
137
} /* namespace drizzled */
138
575.1.3 by Monty Taylor
Moved some stuff out of handler.h.
139
#endif /* DRIZZLED_HANDLER_STRUCTS_H */