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

MDEV-34594 : Assertion `client_state.transaction().active()' failed in

int wsrep_thd_append_key(THD*, const wsrep_key*, int, Wsrep_service_key_type)

CREATE TABLE [SELECT|REPLACE SELECT] is CTAS and idea was that
we force ROW format. However, it was not correctly enforced
and keys were appended before wsrep transaction was started.

At THD::decide_logging_format we should force used stmt binlog
format to ROW in CTAS case and produce a warning if used
binlog format was not ROW.

At ha_innodb::update_row we should not append keys similarly
as in ha_innodb::write_row if sql_command is SQLCOM_CREATE_TABLE.
Improved error logging on ::write_row, ::update_row and ::delete_row
if wsrep key append fails.

Signed-off-by: Julius Goryavsky <julius.goryavsky@mariadb.com>
This commit is contained in:
Jan Lindström
2024-07-18 10:10:26 +03:00
committed by Julius Goryavsky
parent 0e27351028
commit cd8b8bb964
5 changed files with 199 additions and 7 deletions

View File

@ -6372,6 +6372,24 @@ int THD::decide_logging_format(TABLE_LIST *tables)
}
set_current_stmt_binlog_format_row();
}
/* If user has requested binlog_format STMT OR MIXED
in CREATE TABLE [SELECT|REPLACE] we will fall back
to ROW.
Note that we can't use local binlog_format variable
here because wsrep_binlog_format sets it to ROW.
*/
if (wsrep_ctas && variables.binlog_format != BINLOG_FORMAT_ROW)
{
push_warning_printf(this, Sql_condition::WARN_LEVEL_WARN,
ER_UNKNOWN_ERROR,
"Galera does not support binlog_format = %s "
"in CREATE TABLE [SELECT|REPLACE] forcing ROW",
binlog_format == BINLOG_FORMAT_STMT ?
"STMT" : "MIXED");
set_current_stmt_binlog_format_row();
}
#endif /* WITH_WSREP */
if (WSREP_EMULATE_BINLOG_NNULL(this) ||