~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/handler_structs.h

  • Committer: Monty Taylor
  • Date: 2009-08-17 18:46:08 UTC
  • mto: (1182.1.1 staging)
  • mto: This revision was merged to the branch mainline in revision 1183.
  • Revision ID: mordred@inaugust.com-20090817184608-0b2emowpjr9m6le7
"Fixed" the deadlock test. I'd still like someone to look at what's going on here.

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"
39
 
 
40
 
namespace drizzled
41
 
{
42
 
 
 
30
 
 
31
class Ha_trx_info;
 
32
struct StorageEngine;
43
33
struct st_key;
44
34
typedef struct st_key KEY;
 
35
struct st_key_cache;
45
36
typedef struct st_key_cache KEY_CACHE;
46
37
 
47
 
 
48
 
namespace plugin
 
38
struct Session_TRANS
49
39
{
50
 
class StorageEngine;
51
 
}
 
40
  Session_TRANS() {};
 
41
 
 
42
  /* true is not all entries in the engines[] support 2pc */
 
43
  bool        no_2pc;
 
44
  /* storage engines that registered in this transaction */
 
45
  Ha_trx_info *ha_list;
 
46
  /*
 
47
    The purpose of this flag is to keep track of non-transactional
 
48
    tables that were modified in scope of:
 
49
    - transaction, when the variable is a member of
 
50
    Session::transaction.all
 
51
    - top-level statement or sub-statement, when the variable is a
 
52
    member of Session::transaction.stmt
 
53
    This member has the following life cycle:
 
54
    * stmt.modified_non_trans_table is used to keep track of
 
55
    modified non-transactional tables of top-level statements. At
 
56
    the end of the previous statement and at the beginning of the session,
 
57
    it is reset to false.  If such functions
 
58
    as mysql_insert, mysql_update, mysql_delete etc modify a
 
59
    non-transactional table, they set this flag to true.  At the
 
60
    end of the statement, the value of stmt.modified_non_trans_table
 
61
    is merged with all.modified_non_trans_table and gets reset.
 
62
    * all.modified_non_trans_table is reset at the end of transaction
 
63
 
 
64
    * Since we do not have a dedicated context for execution of a
 
65
    sub-statement, to keep track of non-transactional changes in a
 
66
    sub-statement, we re-use stmt.modified_non_trans_table.
 
67
    At entrance into a sub-statement, a copy of the value of
 
68
    stmt.modified_non_trans_table (containing the changes of the
 
69
    outer statement) is saved on stack. Then
 
70
    stmt.modified_non_trans_table is reset to false and the
 
71
    substatement is executed. Then the new value is merged with the
 
72
    saved value.
 
73
  */
 
74
  bool modified_non_trans_table;
 
75
 
 
76
  void reset() { no_2pc= false; modified_non_trans_table= false; }
 
77
};
52
78
 
53
79
typedef struct st_ha_create_information
54
80
{
55
81
  const CHARSET_INFO *table_charset, *default_table_charset;
 
82
  LEX_STRING connect_string;
 
83
  LEX_STRING comment;
 
84
  const char *data_file_name, *index_file_name;
56
85
  const char *alias;
 
86
  uint64_t max_rows,min_rows;
57
87
  uint64_t auto_increment_value;
58
88
  uint32_t table_options;
 
89
  uint32_t avg_row_length;
59
90
  uint32_t used_fields;
 
91
  uint32_t key_block_size;
 
92
  uint32_t block_size;
60
93
  enum row_type row_type;
61
 
  plugin::StorageEngine *db_type;
 
94
  StorageEngine *db_type;
 
95
  uint32_t null_bits;                       /* NULL bits at start of record */
 
96
  uint32_t options;                         /* OR of HA_CREATE_ options */
 
97
  uint32_t extra_size;                      /* length of extra data segment */
62
98
  bool table_existed;                   /* 1 in create if table existed */
 
99
  bool varchar;                         /* 1 if table has a VARCHAR */
 
100
  enum ha_choice page_checksum;         /* If we have page_checksums */
63
101
} HA_CREATE_INFO;
64
102
 
65
103
typedef struct st_ha_alter_information
78
116
{
79
117
  enum ha_key_alg algorithm;
80
118
  uint32_t block_size;
 
119
  LEX_STRING parser_name;
81
120
  LEX_STRING comment;
82
121
} KEY_CREATE_INFO;
83
122
 
85
124
typedef struct st_ha_check_opt
86
125
{
87
126
  st_ha_check_opt() {}                        /* Remove gcc warning */
 
127
  uint32_t flags;       /* myisam layer flags (e.g. for myisamchk) */
 
128
  /* Just rebuild based on the defintion of the table */
 
129
  bool use_frm;
 
130
  /* new key cache when changing key cache */
 
131
  KEY_CACHE *key_cache;
 
132
  void init();
88
133
} HA_CHECK_OPT;
89
134
 
90
135
 
134
179
  unsigned char *end_of_used_area;     /* End of area that was used by handler */
135
180
} HANDLER_BUFFER;
136
181
 
137
 
} /* namespace drizzled */
138
 
 
139
182
#endif /* DRIZZLED_HANDLER_STRUCTS_H */