mariadb/mysql-test/suite/galera/r/MDEV-34594.result
Jan Lindström cd8b8bb964 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>
2024-08-12 23:54:30 +02:00

88 lines
2.3 KiB
Text

connection node_2;
connection node_1;
#
# Case 1: test with binlog_format ROW
#
connection node_1;
SET @@binlog_format=ROW;
CREATE TABLE t1 (a INT UNIQUE) SELECT 1 AS a,2 AS b UNION SELECT 2 AS a,3 AS c;
CREATE TABLE t2 (a INT UNIQUE) REPLACE SELECT 1 AS a,2 AS b UNION SELECT 1 AS a,3 AS c;
SELECT * FROM t1;
a b
1 2
2 3
SELECT * FROM t2;
a b
1 3
connection node_2;
SELECT * FROM t1;
a b
1 2
2 3
SELECT * FROM t2;
a b
1 3
DROP TABLE t1,t2;
#
# Case 2: test with binlog_format MIXED
#
connection node_1;
SET @@binlog_format=MIXED;
Warnings:
Warning 1105 MariaDB Galera and flashback do not support binlog format: MIXED
CREATE TABLE t1 (a INT UNIQUE) SELECT 1 AS a,2 AS b UNION SELECT 2 AS a,3 AS c;
Warnings:
Warning 1105 Galera does not support binlog_format = MIXED in CREATE TABLE [SELECT|REPLACE] forcing ROW
Warning 1105 Galera does not support binlog_format = MIXED in CREATE TABLE [SELECT|REPLACE] forcing ROW
CREATE TABLE t2 (a INT UNIQUE) REPLACE SELECT 1 AS a,2 AS b UNION SELECT 1 AS a,3 AS c;
Warnings:
Warning 1105 Galera does not support binlog_format = MIXED in CREATE TABLE [SELECT|REPLACE] forcing ROW
Warning 1105 Galera does not support binlog_format = MIXED in CREATE TABLE [SELECT|REPLACE] forcing ROW
SELECT * FROM t1;
a b
1 2
2 3
SELECT * FROM t2;
a b
1 3
connection node_2;
SELECT * FROM t1;
a b
1 2
2 3
SELECT * FROM t2;
a b
1 3
DROP TABLE t1,t2;
#
# Case 3: test with binlog_format STATEMENT
#
connection node_1;
SET @@binlog_format=STATEMENT;
Warnings:
Warning 1105 MariaDB Galera and flashback do not support binlog format: STATEMENT
CREATE TABLE t1 (a INT UNIQUE) SELECT 1 AS a,2 AS b UNION SELECT 2 AS a,3 AS c;
Warnings:
Warning 1105 Galera does not support binlog_format = MIXED in CREATE TABLE [SELECT|REPLACE] forcing ROW
Warning 1105 Galera does not support binlog_format = MIXED in CREATE TABLE [SELECT|REPLACE] forcing ROW
CREATE TABLE t2 (a INT UNIQUE) REPLACE SELECT 1 AS a,2 AS b UNION SELECT 1 AS a,3 AS c;
Warnings:
Warning 1105 Galera does not support binlog_format = MIXED in CREATE TABLE [SELECT|REPLACE] forcing ROW
Warning 1105 Galera does not support binlog_format = MIXED in CREATE TABLE [SELECT|REPLACE] forcing ROW
SELECT * FROM t1;
a b
1 2
2 3
SELECT * FROM t2;
a b
1 3
connection node_2;
SELECT * FROM t1;
a b
1 2
2 3
SELECT * FROM t2;
a b
1 3
DROP TABLE t1,t2;
connection node_1;