#At file:///home/lsoares/Workspace/bzr/work/bugfixing/push/mysql-5.5-bugteam/ based on revid:luis.soares@stripped
3158 Luis Soares 2010-12-01
BUG#46166
NOTE: Work-in-progress.
Post-merge fixes for mysql-5.5-bugteam.
modified:
mysql-test/suite/binlog/r/binlog_max_extension.result
mysql-test/suite/binlog/t/binlog_max_extension.test
sql/log.cc
=== modified file 'mysql-test/suite/binlog/r/binlog_max_extension.result'
--- a/mysql-test/suite/binlog/r/binlog_max_extension.result 2009-11-22 03:59:48 +0000
+++ b/mysql-test/suite/binlog/r/binlog_max_extension.result 2010-12-01 02:04:03 +0000
@@ -3,6 +3,5 @@ call mtr.add_suppression("Log filename e
call mtr.add_suppression("Can't generate a unique log-filename");
RESET MASTER;
FLUSH LOGS;
-Warnings:
-Warning 1098 Can't generate a unique log-filename master-bin.(1-999)
+ERROR HY000: Can't generate a unique log-filename master-bin.(1-999)
=== modified file 'mysql-test/suite/binlog/t/binlog_max_extension.test'
--- a/mysql-test/suite/binlog/t/binlog_max_extension.test 2010-11-26 13:30:22 +0000
+++ b/mysql-test/suite/binlog/t/binlog_max_extension.test 2010-12-01 02:04:03 +0000
@@ -58,7 +58,8 @@ EOF
# Assertion
###########
-# assertion: should throw warning
+# assertion: should raise error
+-- error ER_NO_UNIQUE_LOGFILE
FLUSH LOGS;
##############
=== modified file 'sql/log.cc'
--- a/sql/log.cc 2010-12-01 00:08:45 +0000
+++ b/sql/log.cc 2010-12-01 02:04:03 +0000
@@ -1646,20 +1646,30 @@ binlog_flush_stmt_cache(THD *thd, binlog
bool const is_transactional= FALSE;
IO_CACHE *cache_log= &cache_mngr->stmt_cache.cache_log;
- if (thd->binlog_flush_pending_rows_event(TRUE, is_transactional))
- DBUG_RETURN(1);
+ if (!(error= thd->binlog_flush_pending_rows_event(TRUE, is_transactional)))
+ {
+ Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, FALSE, TRUE, 0);
+ if ((error= mysql_bin_log.write(thd, cache_log, &qev,
+ cache_mngr->stmt_cache.has_incident())))
+ goto end;
+ cache_mngr->reset_cache(&cache_mngr->stmt_cache);
- Query_log_event qev(thd, STRING_WITH_LEN("COMMIT"), TRUE, FALSE, TRUE, 0);
- if ((error= mysql_bin_log.write(thd, cache_log, &qev,
- cache_mngr->stmt_cache.has_incident())))
- DBUG_RETURN(error);
- cache_mngr->reset_cache(&cache_mngr->stmt_cache);
+ statistic_increment(binlog_cache_use, &LOCK_status);
+ if (cache_log->disk_writes != 0)
+ {
+ statistic_increment(binlog_cache_disk_use, &LOCK_status);
+ cache_log->disk_writes= 0;
+ }
+ }
- statistic_increment(binlog_cache_use, &LOCK_status);
- if (cache_log->disk_writes != 0)
+end:
+ if (error)
{
- statistic_increment(binlog_cache_disk_use, &LOCK_status);
- cache_log->disk_writes= 0;
+ /**
+ Be conservative.
+ */
+ (void) mysql_bin_log.write_incident(thd, TRUE);
+ cache_mngr->reset_cache(&cache_mngr->stmt_cache);
}
DBUG_RETURN(error);
}
@@ -6412,8 +6422,15 @@ int TC_LOG_BINLOG::log_xid(THD *thd, my_
We always commit the entire transaction when writing an XID. Also
note that the return value is inverted.
*/
- DBUG_RETURN(!binlog_flush_stmt_cache(thd, cache_mngr) &&
- !binlog_flush_trx_cache(thd, cache_mngr, &xle));
+ if (!cache_mngr->stmt_cache.empty() &&
+ binlog_flush_stmt_cache(thd, cache_mngr))
+ DBUG_RETURN(0); // inverted: zero is bad thing
+
+ if (!cache_mngr->trx_cache.empty() &&
+ binlog_flush_trx_cache(thd, cache_mngr, &xle))
+ DBUG_RETURN(0); // inverted: zero is bad thing
+
+ DBUG_RETURN(1);
}
int TC_LOG_BINLOG::unlog(ulong cookie, my_xid xid)
Attachment: [text/bzr-bundle] bzr/luis.soares@oracle.com-20101201020403-ag72fk98lpjr29b0.bundle
| Thread |
|---|
| • bzr commit into mysql-5.5-bugteam branch (luis.soares:3158) Bug#46166 | Luis Soares | 1 Dec |