From 608b63c763689a239fcb26f8c82d64af676d0bda Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 16 Mar 2005 12:45:08 +0100 Subject: sql/ha_innodb.cc protect prepare-...-commit with a mutex to ensure that commits in binlog and in the innodb have the same order store binlog position with the commit innobase/include/trx0trx.h: comment modified sql/ha_innodb.cc: protect prepare-...-commit with a mutex to ensure that commits in binlog and in the innodb have the same order store binlog position with the commit sql/handler.cc: ha_prepare cannot return -1 --- innobase/include/trx0trx.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'innobase') diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 9db69261468..64e9c87fbbd 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -390,8 +390,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 -- cgit v1.2.1 From 912e5e4702d239b1e7a6b8a99849f7213a14e9ac Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 18 Mar 2005 16:18:06 -0800 Subject: Manually import InnoDB fix into build tree. innobase/include/data0type.ic: Fix for sorting of innodb TEXT columns. --- innobase/include/data0type.ic | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'innobase') diff --git a/innobase/include/data0type.ic b/innobase/include/data0type.ic index bf04e1c9b27..a87a08ca582 100644 --- a/innobase/include/data0type.ic +++ b/innobase/include/data0type.ic @@ -195,10 +195,12 @@ dtype_get_pad_char( || type->mtype == DATA_BINARY || type->mtype == DATA_FIXBINARY || type->mtype == DATA_MYSQL - || type->mtype == DATA_VARMYSQL) { + || type->mtype == DATA_VARMYSQL + || (type->mtype == DATA_BLOB + && (type->prtype & DATA_BINARY_TYPE) == 0)) { /* Space is the padding character for all char and binary - strings */ + strings, and starting from 5.0.3, also for TEXT strings. */ return((ulint)' '); } -- cgit v1.2.1 From 7656b6da717418b1f87fa7bec1c81ccdb6892442 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Mar 2005 22:10:42 +0200 Subject: trx0trx.c, trx0trx.h: If MySQL wrote to its binlog, but for some reason trx->update_undo and trx->insert_undo were NULL in InnoDB, then trx->commit_lsn was garbage, and InnoDB could assert in the log flush of trx_commit_complete_for_mysql() (Bug #9277) innobase/include/trx0trx.h: If MySQL wrote to its binlog, but for some reason trx->update_undo and trx->insert_undo were NULL in InnoDB, then trx->commit_lsn was garbage, and InnoDB could assert in the log flush of trx_commit_complete_for_mysql() (Bug #9277) innobase/trx/trx0trx.c: If MySQL wrote to its binlog, but for some reason trx->update_undo and trx->insert_undo were NULL in InnoDB, then trx->commit_lsn was garbage, and InnoDB could assert in the log flush of trx_commit_complete_for_mysql() (Bug #9277) --- innobase/include/trx0trx.h | 6 ++++++ innobase/trx/trx0trx.c | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'innobase') diff --git a/innobase/include/trx0trx.h b/innobase/include/trx0trx.h index 3be16e8f46d..4c93f25009f 100644 --- a/innobase/include/trx0trx.h +++ b/innobase/include/trx0trx.h @@ -346,6 +346,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 diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c index 576827966ab..e2a24c2f63c 100644 --- a/innobase/trx/trx0trx.c +++ b/innobase/trx/trx0trx.c @@ -96,6 +96,7 @@ trx_create( trx->check_unique_secondary = TRUE; trx->flush_log_later = FALSE; + trx->must_flush_log_later = FALSE; trx->dict_operation = FALSE; @@ -634,6 +635,8 @@ trx_commit_off_kernel( #endif /* UNIV_SYNC_DEBUG */ rseg = trx->rseg; + + trx->must_flush_log_later = FALSE; if (trx->insert_undo != NULL || trx->update_undo != NULL) { @@ -798,6 +801,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) { @@ -1516,7 +1520,9 @@ trx_commit_complete_for_mysql( trx->op_info = (char*)"flushing log"; - if (srv_flush_log_at_trx_commit == 0) { + if (!trx->must_flush_log_later) { + /* Do nothing */ + } 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) { @@ -1538,6 +1544,8 @@ trx_commit_complete_for_mysql( ut_error; } + trx->must_flush_log_later = FALSE; + trx->op_info = (char*)""; return(0); -- cgit v1.2.1 From 6d0d2c7e1d942f95b4f29645ef5007c43da56f79 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 21 Mar 2005 22:21:55 +0200 Subject: trx0trx.c: If MySQL wrote to its binlog, but for some reason trx->update_undo and trx->insert_undo were NULL in InnoDB, then trx->commit_lsn was garbage, and InnoDB could assert in the log flush of trx_commit_complete_for_mysql() (Bug #9277) innobase/trx/trx0trx.c: If MySQL wrote to its binlog, but for some reason trx->update_undo and trx->insert_undo were NULL in InnoDB, then trx->commit_lsn was garbage, and InnoDB could assert in the log flush of trx_commit_complete_for_mysql() (Bug #9277) --- innobase/trx/trx0trx.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'innobase') diff --git a/innobase/trx/trx0trx.c b/innobase/trx/trx0trx.c index 8f409034df0..13575a3cedd 100644 --- a/innobase/trx/trx0trx.c +++ b/innobase/trx/trx0trx.c @@ -96,6 +96,7 @@ trx_create( trx->check_unique_secondary = TRUE; trx->flush_log_later = FALSE; + trx->must_flush_log_later = FALSE; trx->dict_operation = FALSE; @@ -654,6 +655,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) { @@ -821,6 +824,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) { @@ -1539,7 +1543,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) { @@ -1560,6 +1566,8 @@ trx_commit_complete_for_mysql( } else { ut_error; } + + trx->must_flush_log_later = FALSE; trx->op_info = ""; -- cgit v1.2.1