1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-05 13:16:09 +03:00

Quick backport of the following bugfix from MySQL 4.0.14.

DO NOT COPY THIS CODE TO 4.0. The bugfix is better in 4.0,
but here in 3.23 we don't want to add a new error code so
we just use ER_EMPTY_QUERY. Bug was:
"If a query was ignored on the slave (because of
@code{replicate-ignore-table} and other similar rules), the slave
still checked if the query got the same error code (0, no error) as on
the master. So if the master had an error on the query (for example,
``Duplicate entry'' in a multiple-row insert), then the slave stopped
and warned that the error codes didn't match. (Bug #797)"
This commit is contained in:
guilhem@mysql.com
2003-09-12 17:26:48 +02:00
parent ebfa41086d
commit 40a88045cb
2 changed files with 14 additions and 1 deletions

View File

@@ -1085,7 +1085,19 @@ mysql_execute_command(void)
// rules have been given and the table list says the query should not be
// replicated
if(table_rules_on && tables && !tables_ok(thd,tables))
{
/*
We consider the query as empty and warn the slave thread which will
consider ER_EMPTY_QUERY as an ignorable error. Note that this has a
drawback: if the event is corrupted it could contain an empty query;
then the slave thread will silently ignore it instead of warning. But
such corruption is unlikely enough.
In MySQL 4.0 we do it more properly using a new error code
(ER_SLAVE_IGNORED_TABLE).
*/
my_error(ER_EMPTY_QUERY, MYF(0));
DBUG_VOID_RETURN;
}
// this is a workaround to deal with the shortcoming
// in 3.23.44-3.23.46 masters
// in RELEASE_LOCK() logging. We re-write SELECT RELEASE_LOCK() as