~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/handler_structs.h

Merge/fix in FAQ.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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, Inc.
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
 
 
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
33
 
 
34
 
#include <drizzled/base.h>
35
 
#include <drizzled/definitions.h>
36
 
#include <drizzled/lex_string.h>
37
 
#include <drizzled/structs.h>
38
 
 
39
 
namespace drizzled
40
 
{
41
 
 
42
 
struct charset_info_st;
43
 
 
44
 
namespace plugin
45
 
{
46
 
class StorageEngine;
47
 
}
48
 
 
49
 
typedef struct st_ha_create_information
50
 
{
51
 
  const charset_info_st *table_charset, *default_table_charset;
52
 
  const char *alias;
53
 
  uint64_t auto_increment_value;
54
 
  uint32_t table_options;
55
 
  uint32_t used_fields;
56
 
  plugin::StorageEngine *db_type;
57
 
  bool table_existed;                   /* 1 in create if table existed */
58
 
 
59
 
  st_ha_create_information() :
60
 
    table_charset(0),
61
 
    default_table_charset(0),
62
 
    alias(0),
63
 
    auto_increment_value(0),
64
 
    table_options(0),
65
 
    used_fields(0),
66
 
    db_type(0),
67
 
    table_existed(0)
68
 
  { }
69
 
} HA_CREATE_INFO;
70
 
 
71
 
typedef struct st_ha_alter_information
72
 
{
73
 
  KeyInfo  *key_info_buffer;
74
 
  uint32_t key_count;
75
 
  uint32_t index_drop_count;
76
 
  uint32_t *index_drop_buffer;
77
 
  uint32_t index_add_count;
78
 
  uint32_t *index_add_buffer;
79
 
  void *data;
80
 
 
81
 
  st_ha_alter_information() :
82
 
    key_info_buffer(0),
83
 
    key_count(0),
84
 
    index_drop_count(0),
85
 
    index_drop_buffer(0),
86
 
    index_add_count(0),
87
 
    index_add_buffer(0),
88
 
    data(0)
89
 
  { }
90
 
 
91
 
} HA_ALTER_INFO;
92
 
 
93
 
 
94
 
typedef struct key_create_information_st
95
 
{
96
 
  enum ha_key_alg algorithm;
97
 
  uint32_t block_size;
98
 
  LEX_STRING comment;
99
 
} KEY_CREATE_INFO;
100
 
 
101
 
 
102
 
typedef struct st_ha_check_opt
103
 
{
104
 
  st_ha_check_opt() {}                        /* Remove gcc warning */
105
 
} HA_CHECK_OPT;
106
 
 
107
 
 
108
 
typedef struct st_range_seq_if
109
 
{
110
 
  /*
111
 
    Initialize the traversal of range sequence
112
 
 
113
 
    SYNOPSIS
114
 
    init()
115
 
    init_params  The seq_init_param parameter
116
 
    n_ranges     The number of ranges obtained
117
 
    flags        A combination of HA_MRR_SINGLE_POINT, HA_MRR_FIXED_KEY
118
 
 
119
 
    RETURN
120
 
    An opaque value to be used as RANGE_SEQ_IF::next() parameter
121
 
  */
122
 
  range_seq_t (*init)(void *init_params, uint32_t n_ranges, uint32_t flags);
123
 
 
124
 
 
125
 
  /*
126
 
    Get the next range in the range sequence
127
 
 
128
 
    SYNOPSIS
129
 
    next()
130
 
    seq    The value returned by RANGE_SEQ_IF::init()
131
 
    range  OUT Information about the next range
132
 
 
133
 
    RETURN
134
 
    0 - Ok, the range structure filled with info about the next range
135
 
    1 - No more ranges
136
 
  */
137
 
  uint32_t (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);
138
 
} RANGE_SEQ_IF;
139
 
 
140
 
} /* namespace drizzled */
141
 
 
142
 
#endif /* DRIZZLED_HANDLER_STRUCTS_H */