diff options
author | tsmith@ramayana.hindu.god <> | 2007-08-01 18:40:02 -0600 |
---|---|---|
committer | tsmith@ramayana.hindu.god <> | 2007-08-01 18:40:02 -0600 |
commit | a52a078f75c1ecc2972a589165db320eddeb9981 (patch) | |
tree | 7db31fdc56ff34260977557c78abc33869800671 /sql/handler.h | |
parent | 76366d79317d94716bfe46e845e993fb2c140edc (diff) | |
parent | d4329ea78339bb71cbb3e23ebce4d64db90d7998 (diff) | |
download | mariadb-git-a52a078f75c1ecc2972a589165db320eddeb9981.tar.gz |
Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into ramayana.hindu.god:/home/tsmith/m/bk/maint/51
Diffstat (limited to 'sql/handler.h')
-rw-r--r-- | sql/handler.h | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/sql/handler.h b/sql/handler.h index 7cf7bfe043d..ddea6c3a34c 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -728,6 +728,35 @@ typedef struct st_thd_trans bool no_2pc; /* storage engines that registered themselves for this transaction */ handlerton *ht[MAX_HA]; + /* + The purpose of this flag is to keep track of non-transactional + tables that were modified in scope of: + - transaction, when the variable is a member of + THD::transaction.all + - top-level statement or sub-statement, when the variable is a + member of THD::transaction.stmt + This member has the following life cycle: + * stmt.modified_non_trans_table is used to keep track of + modified non-transactional tables of top-level statements. At + the end of the previous statement and at the beginning of the session, + it is reset to FALSE. If such functions + as mysql_insert, mysql_update, mysql_delete etc modify a + non-transactional table, they set this flag to TRUE. At the + end of the statement, the value of stmt.modified_non_trans_table + is merged with all.modified_non_trans_table and gets reset. + * all.modified_non_trans_table is reset at the end of transaction + + * Since we do not have a dedicated context for execution of a + sub-statement, to keep track of non-transactional changes in a + sub-statement, we re-use stmt.modified_non_trans_table. + At entrance into a sub-statement, a copy of the value of + stmt.modified_non_trans_table (containing the changes of the + outer statement) is saved on stack. Then + stmt.modified_non_trans_table is reset to FALSE and the + substatement is executed. Then the new value is merged with the + saved value. + */ + bool modified_non_trans_table; } THD_TRANS; enum enum_tx_isolation { ISO_READ_UNCOMMITTED, ISO_READ_COMMITTED, |