~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/handler_structs.h

Fixed the clock_gettime test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#include <drizzled/lex_string.h>
38
38
#include "drizzled/global_charset_info.h"
39
39
 
 
40
 
 
41
class Ha_trx_info;
 
42
struct st_key;
 
43
typedef struct st_key KEY;
 
44
struct st_key_cache;
 
45
typedef struct st_key_cache KEY_CACHE;
 
46
 
40
47
namespace drizzled
41
48
{
42
 
 
43
49
namespace plugin
44
50
{
45
51
class StorageEngine;
46
52
}
 
53
}
 
54
 
 
55
struct Session_TRANS
 
56
{
 
57
  Session_TRANS() {};
 
58
 
 
59
  /* true is not all entries in the engines[] support 2pc */
 
60
  bool        no_2pc;
 
61
  /* storage engines that registered in this transaction */
 
62
  Ha_trx_info *ha_list;
 
63
  /*
 
64
    The purpose of this flag is to keep track of non-transactional
 
65
    tables that were modified in scope of:
 
66
    - transaction, when the variable is a member of
 
67
    Session::transaction.all
 
68
    - top-level statement or sub-statement, when the variable is a
 
69
    member of Session::transaction.stmt
 
70
    This member has the following life cycle:
 
71
    * stmt.modified_non_trans_table is used to keep track of
 
72
    modified non-transactional tables of top-level statements. At
 
73
    the end of the previous statement and at the beginning of the session,
 
74
    it is reset to false.  If such functions
 
75
    as mysql_insert, mysql_update, mysql_delete etc modify a
 
76
    non-transactional table, they set this flag to true.  At the
 
77
    end of the statement, the value of stmt.modified_non_trans_table
 
78
    is merged with all.modified_non_trans_table and gets reset.
 
79
    * all.modified_non_trans_table is reset at the end of transaction
 
80
 
 
81
    * Since we do not have a dedicated context for execution of a
 
82
    sub-statement, to keep track of non-transactional changes in a
 
83
    sub-statement, we re-use stmt.modified_non_trans_table.
 
84
    At entrance into a sub-statement, a copy of the value of
 
85
    stmt.modified_non_trans_table (containing the changes of the
 
86
    outer statement) is saved on stack. Then
 
87
    stmt.modified_non_trans_table is reset to false and the
 
88
    substatement is executed. Then the new value is merged with the
 
89
    saved value.
 
90
  */
 
91
  bool modified_non_trans_table;
 
92
 
 
93
  void reset() { no_2pc= false; modified_non_trans_table= false; }
 
94
};
47
95
 
48
96
typedef struct st_ha_create_information
49
97
{
52
100
  uint64_t auto_increment_value;
53
101
  uint32_t table_options;
54
102
  uint32_t used_fields;
55
 
  plugin::StorageEngine *db_type;
 
103
  enum row_type row_type;
 
104
  drizzled::plugin::StorageEngine *db_type;
56
105
  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
106
} HA_CREATE_INFO;
69
107
 
70
108
typedef struct st_ha_alter_information
71
109
{
72
 
  KeyInfo  *key_info_buffer;
 
110
  KEY  *key_info_buffer;
73
111
  uint32_t key_count;
74
112
  uint32_t index_drop_count;
75
113
  uint32_t *index_drop_buffer;
76
114
  uint32_t index_add_count;
77
115
  uint32_t *index_add_buffer;
78
116
  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
117
} HA_ALTER_INFO;
91
118
 
92
119
 
136
163
  uint32_t (*next) (range_seq_t seq, KEY_MULTI_RANGE *range);
137
164
} RANGE_SEQ_IF;
138
165
 
139
 
} /* namespace drizzled */
 
166
/*
 
167
  This is a buffer area that the handler can use to store rows.
 
168
  'end_of_used_area' should be kept updated after calls to
 
169
  read-functions so that other parts of the code can use the
 
170
  remaining area (until next read calls is issued).
 
171
*/
 
172
 
 
173
typedef struct st_handler_buffer
 
174
{
 
175
  unsigned char *buffer;         /* Buffer one can start using */
 
176
  unsigned char *buffer_end;     /* End of buffer */
 
177
  unsigned char *end_of_used_area;     /* End of area that was used by handler */
 
178
} HANDLER_BUFFER;
140
179
 
141
180
#endif /* DRIZZLED_HANDLER_STRUCTS_H */