mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
BUG#23051 (READ COMMITTED breaks mixed and statement-based
replication): Patch to add binlog format capabilities to the InnoDB storage engine. The engine will not allow statement format logging when in READ COMMITTED or READ UNCOMMITTED transaction isolation level. In addition, an error is generated when trying to use READ COMMITTED or READ UNCOMMITTED transaction isolation level in STATEMENT binlog mode.
This commit is contained in:
@ -3612,18 +3612,24 @@ int decide_logging_format(THD *thd, TABLE_LIST *tables)
|
||||
int error= 0;
|
||||
if (binlog_flags == 0)
|
||||
{
|
||||
error= ER_BINLOG_ENGINES_INCOMPATIBLE;
|
||||
my_error((error= ER_BINLOG_LOGGING_IMPOSSIBLE), MYF(0),
|
||||
"Statement cannot be logged to the binary log in"
|
||||
" row-based nor statement-based format");
|
||||
}
|
||||
else if (thd->variables.binlog_format == BINLOG_FORMAT_STMT &&
|
||||
(binlog_flags & HA_BINLOG_STMT_CAPABLE) == 0)
|
||||
{
|
||||
error= ER_BINLOG_STMT_FORMAT_FORBIDDEN;
|
||||
my_error((error= ER_BINLOG_LOGGING_IMPOSSIBLE), MYF(0),
|
||||
"Statement-based format required for this statement,"
|
||||
" but not allowed by this combination of engines");
|
||||
}
|
||||
else if ((thd->variables.binlog_format == BINLOG_FORMAT_ROW ||
|
||||
thd->lex->is_stmt_unsafe()) &&
|
||||
(binlog_flags & HA_BINLOG_ROW_CAPABLE) == 0)
|
||||
{
|
||||
error= ER_BINLOG_ROW_FORMAT_FORBIDDEN;
|
||||
my_error((error= ER_BINLOG_LOGGING_IMPOSSIBLE), MYF(0),
|
||||
"Row-based format required for this statement,"
|
||||
" but not allowed by this combination of engines");
|
||||
}
|
||||
|
||||
DBUG_PRINT("info", ("error: %d", error));
|
||||
@ -3631,7 +3637,6 @@ int decide_logging_format(THD *thd, TABLE_LIST *tables)
|
||||
if (error)
|
||||
{
|
||||
ha_rollback_stmt(thd);
|
||||
my_error(error, MYF(0));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user