~posulliv/drizzle/optimizer-style-cleanup

« back to all changes in this revision

Viewing changes to drizzled/handler_structs.h

  • Committer: Padraig O'Sullivan
  • Date: 2010-03-15 14:05:26 UTC
  • mfrom: (1237.9.99 staging)
  • Revision ID: osullivan.padraig@gmail.com-20100315140526-opbgwdwn6tfecdkq
MergeĀ fromĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
namespace drizzled
41
41
{
42
42
 
43
 
class Ha_trx_info;
44
43
struct st_key;
45
44
typedef struct st_key KEY;
46
45
typedef struct st_key_cache KEY_CACHE;
51
50
class StorageEngine;
52
51
}
53
52
 
54
 
struct Session_TRANS
55
 
{
56
 
  Session_TRANS() :
57
 
    no_2pc(false),
58
 
    ha_list(NULL),
59
 
    modified_non_trans_table(false)
60
 
  {}
61
 
 
62
 
  /* true is not all entries in the engines[] support 2pc */
63
 
  bool        no_2pc;
64
 
  /* storage engines that registered in this transaction */
65
 
  Ha_trx_info *ha_list;
66
 
  /*
67
 
    The purpose of this flag is to keep track of non-transactional
68
 
    tables that were modified in scope of:
69
 
    - transaction, when the variable is a member of
70
 
    Session::transaction.all
71
 
    - top-level statement or sub-statement, when the variable is a
72
 
    member of Session::transaction.stmt
73
 
    This member has the following life cycle:
74
 
    * stmt.modified_non_trans_table is used to keep track of
75
 
    modified non-transactional tables of top-level statements. At
76
 
    the end of the previous statement and at the beginning of the session,
77
 
    it is reset to false.  If such functions
78
 
    as mysql_insert, mysql_update, mysql_delete etc modify a
79
 
    non-transactional table, they set this flag to true.  At the
80
 
    end of the statement, the value of stmt.modified_non_trans_table
81
 
    is merged with all.modified_non_trans_table and gets reset.
82
 
    * all.modified_non_trans_table is reset at the end of transaction
83
 
 
84
 
    * Since we do not have a dedicated context for execution of a
85
 
    sub-statement, to keep track of non-transactional changes in a
86
 
    sub-statement, we re-use stmt.modified_non_trans_table.
87
 
    At entrance into a sub-statement, a copy of the value of
88
 
    stmt.modified_non_trans_table (containing the changes of the
89
 
    outer statement) is saved on stack. Then
90
 
    stmt.modified_non_trans_table is reset to false and the
91
 
    substatement is executed. Then the new value is merged with the
92
 
    saved value.
93
 
  */
94
 
  bool modified_non_trans_table;
95
 
 
96
 
  void reset() { no_2pc= false; modified_non_trans_table= false; }
97
 
};
98
 
 
99
53
typedef struct st_ha_create_information
100
54
{
101
55
  const CHARSET_INFO *table_charset, *default_table_charset;