List:Commits« Previous MessageNext Message »
From:marko.makela Date:May 31 2012 1:13pm
Subject:bzr push into mysql-trunk-wl6255 branch (marko.makela:3917 to 3918) WL#5223
View as plain text  
 3918 Marko Mäkelä	2012-05-31
      WL#5223 bug fix.
      
      trx_commit_complete_for_mysql(): Read srv_flush_log_at_trx_commit only once
      in the function, because it may change while the function is executing.

    modified:
      storage/innobase/trx/trx0trx.cc
 3917 Marko Mäkelä	2012-05-31
      WL#6255 duplicate key error reporting
      
      When an error occurs during online rebuild apply, convert the buffered row
      into the MySQL record buffer, so that it can be used in error messages,
      such as duplicate key error.
      
      row_log_table_apply_insert(), row_log_table_apply_update(): Invoke
      innobase_rec_to_mysql() on error.
      
      When delete fails, we will not invoke the conversion, because the buffered
      record contains the PRIMARY KEY in the new table, which could differ from
      the old table (different columns).

    modified:
      mysql-test/suite/innodb/r/innodb-table-online.result
      storage/innobase/row/row0log.cc
=== modified file 'storage/innobase/trx/trx0trx.cc'
--- a/storage/innobase/trx/trx0trx.cc	revid:marko.makela@strippedjsei
+++ b/storage/innobase/trx/trx0trx.cc	revid:marko.makela@stripped
@@ -1442,15 +1442,22 @@ trx_commit_complete_for_mysql(
 
 	ut_a(trx);
 
+	if (!trx->must_flush_log_later) {
+		return(0);
+	}
+
 	trx->op_info = "flushing log";
 
-	if (!trx->must_flush_log_later) {
-		/* Do nothing */
-	} else if (srv_flush_log_at_trx_commit == 0
-		   || thd_requested_durability(trx->mysql_thd)
-		   == HA_IGNORE_DURABILITY) {
+	switch (srv_flush_log_at_trx_commit) {
+	case 0:
 		/* Do nothing */
-	} else if (srv_flush_log_at_trx_commit == 1) {
+		break;
+	case 1:
+		if (thd_requested_durability(trx->mysql_thd)
+		    == HA_IGNORE_DURABILITY) {
+			break;
+		}
+
 		if (srv_unix_file_flush_method == SRV_UNIX_NOSYNC) {
 			/* Write the log but do not flush it to disk */
 
@@ -1461,12 +1468,17 @@ trx_commit_complete_for_mysql(
 
 			log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, TRUE);
 		}
-	} else if (srv_flush_log_at_trx_commit == 2) {
 
-		/* Write the log but do not flush it to disk */
+		break;
+	case 2:
+		if (thd_requested_durability(trx->mysql_thd)
+		    == HA_IGNORE_DURABILITY) {
+			break;
+		}
 
+		/* Write the log but do not flush it to disk */
 		log_write_up_to(lsn, LOG_WAIT_ONE_GROUP, FALSE);
-	} else {
+	default:
 		ut_error;
 	}
 

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk-wl6255 branch (marko.makela:3917 to 3918) WL#5223marko.makela31 May