mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
manually merged
client/mysqlbinlog.cc: Auto merged configure.in: Auto merged include/my_global.h: Auto merged include/my_pthread.h: Auto merged innobase/trx/trx0trx.c: Auto merged mysql-test/include/varchar.inc: Auto merged mysql-test/r/bdb.result: Auto merged mysql-test/r/myisam.result: Auto merged mysql-test/r/mysqlbinlog2.result: Auto merged mysql-test/t/ctype_ucs.test: Auto merged mysql-test/t/user_var.test: Auto merged mysys/hash.c: Auto merged sql/item_func.cc: Auto merged sql/log_event.cc: Auto merged sql/log_event.h: Auto merged sql/set_var.h: Auto merged sql/slave.cc: Auto merged sql/slave.h: Auto merged sql/sp_head.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_repl.cc: Auto merged sql/sql_repl.h: Auto merged sql/sql_table.cc: Auto merged sql/sql_trigger.cc: Auto merged mysql-test/r/ctype_ucs.result: ul mysql-test/r/drop_temp_table.result: ul mysql-test/r/innodb.result: ul mysql-test/r/insert_select.result: ul mysql-test/r/mix_innodb_myisam_binlog.result: ul mysql-test/r/rpl_change_master.result: ul mysql-test/r/rpl_charset.result: ul mysql-test/r/rpl_error_ignored_table.result: ul mysql-test/r/rpl_flush_log_loop.result: ul mysql-test/r/rpl_flush_tables.result: ul mysql-test/r/rpl_loaddata.result: ul mysql-test/r/rpl_loaddata_rule_m.result: ul mysql-test/r/rpl_log.result: ul mysql-test/r/rpl_max_relay_size.result: ul mysql-test/r/rpl_relayrotate.result: ul mysql-test/r/rpl_replicate_do.result: ul mysql-test/r/rpl_rotate_logs.result: ul mysql-test/r/rpl_temporary.result: ul mysql-test/r/rpl_timezone.result: ul mysql-test/r/rpl_until.result: ul mysql-test/r/rpl_user_variables.result: ul mysql-test/r/user_var.result: ul
This commit is contained in:
@@ -117,7 +117,7 @@ int mysql_update(THD *thd,
|
||||
{
|
||||
bool using_limit= limit != HA_POS_ERROR;
|
||||
bool safe_update= thd->options & OPTION_SAFE_UPDATES;
|
||||
bool used_key_is_modified, transactional_table, log_delayed;
|
||||
bool used_key_is_modified, transactional_table;
|
||||
int res;
|
||||
int error=0;
|
||||
uint used_index;
|
||||
@@ -471,7 +471,6 @@ int mysql_update(THD *thd,
|
||||
query_cache_invalidate3(thd, table_list, 1);
|
||||
}
|
||||
|
||||
log_delayed= (transactional_table || table->s->tmp_table);
|
||||
if ((updated || (error < 0)) && (error <= 0 || !transactional_table))
|
||||
{
|
||||
if (mysql_bin_log.is_open())
|
||||
@@ -479,11 +478,11 @@ int mysql_update(THD *thd,
|
||||
if (error <= 0)
|
||||
thd->clear_error();
|
||||
Query_log_event qinfo(thd, thd->query, thd->query_length,
|
||||
log_delayed, FALSE);
|
||||
transactional_table, FALSE);
|
||||
if (mysql_bin_log.write(&qinfo) && transactional_table)
|
||||
error=1; // Rollback update
|
||||
}
|
||||
if (!log_delayed)
|
||||
if (!transactional_table)
|
||||
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
|
||||
}
|
||||
if (transactional_table)
|
||||
@@ -1002,7 +1001,6 @@ multi_update::initialize_tables(JOIN *join)
|
||||
DBUG_RETURN(1);
|
||||
main_table=join->join_tab->table;
|
||||
trans_safe= transactional_tables= main_table->file->has_transactions();
|
||||
log_delayed= trans_safe || main_table->s->tmp_table != NO_TMP_TABLE;
|
||||
table_to_update= 0;
|
||||
|
||||
/* Create a temporary table for keys to all tables, except main table */
|
||||
@@ -1337,17 +1335,13 @@ int multi_update::do_updates(bool from_send_error)
|
||||
goto err;
|
||||
}
|
||||
updated++;
|
||||
if (table->s->tmp_table != NO_TMP_TABLE)
|
||||
log_delayed= 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (updated != org_updated)
|
||||
{
|
||||
if (table->s->tmp_table != NO_TMP_TABLE)
|
||||
log_delayed= 1; // Tmp tables forces delay log
|
||||
if (table->file->has_transactions())
|
||||
log_delayed= transactional_tables= 1;
|
||||
transactional_tables= 1;
|
||||
else
|
||||
trans_safe= 0; // Can't do safe rollback
|
||||
}
|
||||
@@ -1368,10 +1362,8 @@ err:
|
||||
|
||||
if (updated != org_updated)
|
||||
{
|
||||
if (table->s->tmp_table != NO_TMP_TABLE)
|
||||
log_delayed= 1;
|
||||
if (table->file->has_transactions())
|
||||
log_delayed= transactional_tables= 1;
|
||||
transactional_tables= 1;
|
||||
else
|
||||
trans_safe= 0;
|
||||
}
|
||||
@@ -1413,11 +1405,11 @@ bool multi_update::send_eof()
|
||||
if (local_error <= 0)
|
||||
thd->clear_error();
|
||||
Query_log_event qinfo(thd, thd->query, thd->query_length,
|
||||
log_delayed, FALSE);
|
||||
transactional_tables, FALSE);
|
||||
if (mysql_bin_log.write(&qinfo) && trans_safe)
|
||||
local_error= 1; // Rollback update
|
||||
}
|
||||
if (!log_delayed)
|
||||
if (!transactional_tables)
|
||||
thd->options|=OPTION_STATUS_NO_TRANS_UPDATE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user