~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/handler_structs.h

pandora-build v0.71. Added check for avahi.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#ifndef DRIZZLED_HANDLER_STRUCTS_H
21
21
#define DRIZZLED_HANDLER_STRUCTS_H
22
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
 
23
#include <stdint.h>
 
24
#include <time.h>
33
25
 
34
26
#include <drizzled/base.h>
35
27
#include <drizzled/structs.h>
36
28
#include <drizzled/definitions.h>
37
29
#include <drizzled/lex_string.h>
38
 
#include "drizzled/global_charset_info.h"
 
30
 
 
31
class Ha_trx_info;
 
32
struct st_key;
 
33
typedef struct st_key KEY;
 
34
struct st_key_cache;
 
35
typedef struct st_key_cache KEY_CACHE;
39
36
 
40
37
namespace drizzled
41
38
{
42
 
 
43
39
namespace plugin
44
40
{
45
41
class StorageEngine;
46
42
}
 
43
}
 
44
 
 
45
struct Session_TRANS
 
46
{
 
47
  Session_TRANS() {};
 
48
 
 
49
  /* true is not all entries in the engines[] support 2pc */
 
50
  bool        no_2pc;
 
51
  /* storage engines that registered in this transaction */
 
52
  Ha_trx_info *ha_list;
 
53
  /*
 
54
    The purpose of this flag is to keep track of non-transactional
 
55
    tables that were modified in scope of:
 
56
    - transaction, when the variable is a member of
 
57
    Session::transaction.all
 
58
    - top-level statement or sub-statement, when the variable is a
 
59
    member of Session::transaction.stmt
 
60
    This member has the following life cycle:
 
61
    * stmt.modified_non_trans_table is used to keep track of
 
62
    modified non-transactional tables of top-level statements. At
 
63
    the end of the previous statement and at the beginning of the session,
 
64
    it is reset to false.  If such functions
 
65
    as mysql_insert, mysql_update, mysql_delete etc modify a
 
66
    non-transactional table, they set this flag to true.  At the
 
67
    end of the statement, the value of stmt.modified_non_trans_table
 
68
    is merged with all.modified_non_trans_table and gets reset.
 
69
    * all.modified_non_trans_table is reset at the end of transaction
 
70
 
 
71
    * Since we do not have a dedicated context for execution of a
 
72
    sub-statement, to keep track of non-transactional changes in a
 
73
    sub-statement, we re-use stmt.modified_non_trans_table.
 
74
    At entrance into a sub-statement, a copy of the value of
 
75
    stmt.modified_non_trans_table (containing the changes of the
 
76
    outer statement) is saved on stack. Then
 
77
    stmt.modified_non_trans_table is reset to false and the
 
78
    substatement is executed. Then the new value is merged with the
 
79
    saved value.
 
80
  */
 
81
  bool modified_non_trans_table;
 
82
 
 
83
  void reset() { no_2pc= false; modified_non_trans_table= false; }
 
84
};
47
85
 
48
86
typedef struct st_ha_create_information
49
87
{
52
90
  uint64_t auto_increment_value;
53
91
  uint32_t table_options;
54
92
  uint32_t used_fields;
55
 
  plugin::StorageEngine *db_type;
 
93
  enum row_type row_type;
 
94
  drizzled::plugin::StorageEngine *db_type;
 
95
  uint32_t options;                         /* OR of HA_CREATE_ options */
56
96
  bool table_existed;                   /* 1 in create if table existed */
57
 
 
58
 
  st_ha_create_information() :
59
 
    table_charset(0),
60
 
    default_table_charset(0),
61
 
    alias(0),
62
 
    auto_increment_value(0),
63
 
    table_options(0),
64
 
    used_fields(0),
65
 
    db_type(0),
66
 
    table_existed(0)
67
 
  { }
68
97
} HA_CREATE_INFO;
69
98
 
70
99
typedef struct st_ha_alter_information
71
100
{
72
 
  KeyInfo  *key_info_buffer;
 
101
  KEY  *key_info_buffer;
73
102
  uint32_t key_count;
74
103
  uint32_t index_drop_count;
75
104
  uint32_t *index_drop_buffer;
76
105
  uint32_t index_add_count;
77
106
  uint32_t *index_add_buffer;
78
107
  void *data;
79
 
 
80
 
  st_ha_alter_information() :
81
 
    key_info_buffer(0),
82
 
    key_count(0),
83
 
    index_drop_count(0),
84
 
    index_drop_buffer(0),
85
 
    index_add_count(0),
86
 
    index_add_buffer(0),
87
 
    data(0)
88
 
  { }
89
 
 
90
108
} HA_ALTER_INFO;
91
109
 
92
110
 
101
119
typedef struct st_ha_check_opt
102
120
{
103
121
  st_ha_check_opt() {}                        /* Remove gcc warning */
 
122
 
 
123
  uint32_t flags;       /* myisam layer flags (e.g. for myisamchk) */
 
124
 
 
125
  /* Just rebuild based on the defintion of the table */
 
126
  bool use_frm;
 
127
 
 
128
  /* new key cache when changing key cache */
 
129
  KEY_CACHE *key_cache;
 
130
 
 
131
  void init()
 
132
  {
 
133
    flags= 0; 
 
134
    use_frm= false;
 
135
  };
104
136
} HA_CHECK_OPT;
105
137
 
106
138
 
136
168
  uint32_t (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);
137
169
} RANGE_SEQ_IF;
138
170
 
139
 
} /* namespace drizzled */
 
171
/*
 
172
  This is a buffer area that the handler can use to store rows.
 
173
  'end_of_used_area' should be kept updated after calls to
 
174
  read-functions so that other parts of the code can use the
 
175
  remaining area (until next read calls is issued).
 
176
*/
 
177
 
 
178
typedef struct st_handler_buffer
 
179
{
 
180
  unsigned char *buffer;         /* Buffer one can start using */
 
181
  unsigned char *buffer_end;     /* End of buffer */
 
182
  unsigned char *end_of_used_area;     /* End of area that was used by handler */
 
183
} HANDLER_BUFFER;
140
184
 
141
185
#endif /* DRIZZLED_HANDLER_STRUCTS_H */