mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Lots of code fixes to the replication code (especially the binary logging and index log file handling)
Fixed bugs in my last changeset that made MySQL hard to compile. Added mutex around some data that could cause table cache corruptions when using OPTIMIZE TABLE / REPAIR TABLE or automatic repair of MyISAM tables. Added mutex around some data in the slave start/stop code that could cause THD linked list corruptions Extended my_chsize() to allow one to specify a filler character. Extend vio_blocking to return the old state (This made some usage of this function much simpler) Added testing for some functions that they caller have got the required mutexes before calling the function. Use setrlimit() to ensure that we can write core file if one specifies --core-file. Added --slave-compressed-protocol Made 2 the minimum length for ft_min_word_len Added variables foreign_key_checks & unique_checks. Less logging from replication code (if not started with --log-warnings) Changed that SHOW INNODB STATUS requre the SUPER privilege More DBUG statements and a lot of new code comments
This commit is contained in:
@@ -275,40 +275,11 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
|
||||
{
|
||||
bool operation_done= 0;
|
||||
bool transaction_commited= 0;
|
||||
|
||||
/* Update the binary log if we have cached some queries */
|
||||
if (trans == &thd->transaction.all && mysql_bin_log.is_open() &&
|
||||
my_b_tell(&thd->transaction.trans_log))
|
||||
{
|
||||
/* We write the command "COMMIT" as the last SQL command in the
|
||||
binlog segment cached for this transaction */
|
||||
|
||||
int save_query_length = thd->query_length;
|
||||
|
||||
thd->query_length = 6; /* length of 'COMMIT'; note that we may come
|
||||
here because a DROP TABLE, for instance,
|
||||
makes an implicit commit, and then
|
||||
thd->query is not 'COMMIT'! */
|
||||
|
||||
Query_log_event qinfo(thd, "COMMIT", TRUE);
|
||||
|
||||
/* When we come here, and the user wrapped the transaction into
|
||||
BEGIN and COMMIT, then qinfo got above the field cache_stmt
|
||||
erroneously set to 0. Let us set it to 1: */
|
||||
|
||||
qinfo.cache_stmt = 1;
|
||||
|
||||
/* Write the 'COMMIT' entry to the cache */
|
||||
|
||||
if (mysql_bin_log.write(&qinfo)) {
|
||||
my_error(ER_ERROR_DURING_COMMIT, MYF(0), 5000);
|
||||
error=1;
|
||||
}
|
||||
|
||||
thd->query_length = save_query_length;
|
||||
|
||||
/* Now we write the binlog segment cached for this transaction to
|
||||
the real binlog */
|
||||
|
||||
mysql_bin_log.write(thd, &thd->transaction.trans_log);
|
||||
reinit_io_cache(&thd->transaction.trans_log,
|
||||
WRITE_CACHE, (my_off_t) 0, 0, 1);
|
||||
|
Reference in New Issue
Block a user