1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

Merge with 4.1.3-beta

This commit is contained in:
monty@mysql.com
2004-07-07 11:29:39 +03:00
1727 changed files with 63933 additions and 40199 deletions

View File

@ -205,15 +205,24 @@ cleanup:
query_cache_invalidate3(thd, table_list, 1);
}
delete select;
transactional_table= table->file->has_transactions();
log_delayed= (transactional_table || table->tmp_table);
if (deleted && (error <= 0 || !transactional_table))
/*
We write to the binary log even if we deleted no row, because maybe the
user is using this command to ensure that a table is clean on master *and
on slave*. Think of the case of a user having played separately with the
master's table and slave's table and wanting to take a fresh identical
start now.
error < 0 means "really no error". error <= 0 means "maybe some error".
*/
if ((deleted || (error < 0)) && (error <= 0 || !transactional_table))
{
if (mysql_bin_log.is_open())
{
if (error <= 0)
thd->clear_error();
Query_log_event qinfo(thd, thd->query, thd->query_length,
Query_log_event qinfo(thd, thd->query, thd->query_length,
log_delayed);
if (mysql_bin_log.write(&qinfo) && transactional_table)
error=1;
@ -232,7 +241,6 @@ cleanup:
mysql_unlock_tables(thd, thd->lock);
thd->lock=0;
}
delete select;
free_underlaid_joins(thd, &thd->lex->select_lex);
if (error >= 0 || thd->net.report_error)
send_error(thd,thd->killed_errno());
@ -560,6 +568,8 @@ bool multi_delete::send_eof()
rows and we succeeded, or also in an error case when there
was a non-transaction-safe table involved, since
modifications in it cannot be rolled back.
Note that if we deleted nothing we don't write to the binlog (TODO:
fix this).
*/
if (deleted && (error <= 0 || normal_tables))
{