summaryrefslogtreecommitdiff
path: root/innobase
diff options
context:
space:
mode:
authorunknown <patg@patrick.local>2005-04-01 12:32:17 -0800
committerunknown <patg@patrick.local>2005-04-01 12:32:17 -0800
commitc0333ecee42a4de499b3377cfa21d7b5af1ddd2b (patch)
tree389228d07d324be3e962fefab032b134daa8021a /innobase
parent844acf9a66bb85ea0604f385efdaf2c655fd957a (diff)
parentbd2da82b2131241ce960bb02075aba2689ed1a3a (diff)
downloadmariadb-git-c0333ecee42a4de499b3377cfa21d7b5af1ddd2b.tar.gz
5.0 to 5.1 merge
mysql-test/r/grant.result: Auto merged scripts/mysql_create_system_tables.sh: Auto merged scripts/mysql_fix_privilege_tables.sql: Auto merged sql/Makefile.am: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/slave.cc: Auto merged sql/slave.h: Auto merged sql/sql_acl.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_parse.cc: Auto merged configure.in: merge of 5.0 to 5.1, version info and NDB_VERSION_() conflicts libmysqld/Makefile.am: merge of Makefile sql_sources list sql/sql_acl.h: merge, no need to hand resolve BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'innobase')
-rw-r--r--innobase/include/trx0trx.h11
-rw-r--r--innobase/trx/trx0trx.c10
2 files changed, 18 insertions, 3 deletions
diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h
index 9db69261468..d46613c3a68 100644
--- a/innobase/include/trx0trx.h
+++ b/innobase/include/trx0trx.h
@@ -381,6 +381,12 @@ struct trx_struct{
in MySQL's binlog write, we will
flush the log to disk later in
a separate call */
+ ibool must_flush_log_later;/* this flag is set to TRUE in
+ trx_commit_off_kernel() if
+ flush_log_later was TRUE, and there
+ were modifications by the transaction;
+ in that case we must flush the log
+ in trx_commit_complete_for_mysql() */
dulint commit_lsn; /* lsn at the time of the commit */
ibool dict_operation; /* TRUE if the trx is used to create
a table, create an index, or drop a
@@ -390,8 +396,9 @@ struct trx_struct{
dulint table_id; /* table id if the preceding field is
TRUE */
/*------------------------------*/
- int active_trans; /* whether a transaction in MySQL
- is active */
+ int active_trans; /* 1 - if a transaction in MySQL
+ is active. 2 - if prepare_commit_mutex
+ was taken */
void* mysql_thd; /* MySQL thread handle corresponding
to this trx, or NULL */
char** mysql_query_str;/* pointer to the field in mysqld_thd
diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c
index 643f7e164e5..cdda1dd4dee 100644
--- a/innobase/trx/trx0trx.c
+++ b/innobase/trx/trx0trx.c
@@ -99,6 +99,7 @@ trx_create(
trx->check_unique_secondary = TRUE;
trx->flush_log_later = FALSE;
+ trx->must_flush_log_later = FALSE;
trx->dict_operation = FALSE;
@@ -710,6 +711,8 @@ trx_commit_off_kernel(
ut_ad(mutex_own(&kernel_mutex));
#endif /* UNIV_SYNC_DEBUG */
+ trx->must_flush_log_later = FALSE;
+
rseg = trx->rseg;
if (trx->insert_undo != NULL || trx->update_undo != NULL) {
@@ -875,6 +878,7 @@ trx_commit_off_kernel(
if (trx->flush_log_later) {
/* Do nothing yet */
+ trx->must_flush_log_later = TRUE;
} else if (srv_flush_log_at_trx_commit == 0) {
/* Do nothing */
} else if (srv_flush_log_at_trx_commit == 1) {
@@ -1594,7 +1598,9 @@ trx_commit_complete_for_mysql(
trx->op_info = "flushing log";
- if (srv_flush_log_at_trx_commit == 0) {
+ if (!trx->must_flush_log_later) {
+ /* Do nothing */
+ } else if (srv_flush_log_at_trx_commit == 0) {
/* Do nothing */
} else if (srv_flush_log_at_trx_commit == 1) {
if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
@@ -1615,6 +1621,8 @@ trx_commit_complete_for_mysql(
} else {
ut_error;
}
+
+ trx->must_flush_log_later = FALSE;
trx->op_info = "";