1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

SQL: replication fixes [fixes #234]

This commit is contained in:
Eugene Kosov
2017-07-31 11:42:48 +03:00
parent 88454b3320
commit d998da0306
17 changed files with 302 additions and 128 deletions

View File

@ -1036,6 +1036,9 @@ int mysql_update(THD *thd,
else
errcode= query_error_code(thd, killed_status == NOT_KILLED);
ScopedStatementReplication scoped_stmt_rpl(
table->versioned_by_engine() ? thd : NULL);
if (thd->binlog_query(THD::ROW_QUERY_TYPE,
thd->query(), thd->query_length(),
transactional_table, FALSE, FALSE, errcode))
@ -2674,9 +2677,21 @@ bool multi_update::send_eof()
thd->clear_error();
else
errcode= query_error_code(thd, killed_status == NOT_KILLED);
if (thd->binlog_query(THD::ROW_QUERY_TYPE,
thd->query(), thd->query_length(),
transactional_tables, FALSE, FALSE, errcode))
bool force_stmt= false;
for (TABLE *table= all_tables->table; table; table= table->next)
{
if (table->versioned_by_engine())
{
force_stmt= true;
break;
}
}
ScopedStatementReplication scoped_stmt_rpl(force_stmt ? thd : NULL);
if (thd->binlog_query(THD::ROW_QUERY_TYPE, thd->query(),
thd->query_length(), transactional_tables, FALSE,
FALSE, errcode))
{
local_error= 1; // Rollback update
}