1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

MDEV-24959: ER_BINLOG_ROW_LOGGING_FAILED (1534: Writing one row to the row-based binary log failed)

The Write_rows_log_event originally allocated the m_rows_buf up-front, and
thus is_valid() checks that the buffer is allocated correctly. But at some
point this was changed to allocate the buffer lazily on demand. This means
that a a valid event can now have m_rows_buf==NULL. The is_valid() code was
not changed, and thus is_valid() could return false on a valid event.

This caused a bug for REPLACE INTO t() VALUES(), () which generates a
write_rows event with no after image; then the m_rows_buf was never
allocated and is_valid() incorrectly returned false, causing an error in
some other parts of the code.

Also fix a couple of missing special cases in the code for mysqlbinlog to
correctly decode (in comments) row events with missing after image.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
This commit is contained in:
Kristian Nielsen
2024-12-03 15:02:06 +01:00
parent b4fde50b1f
commit 2ab10fbec2
4 changed files with 82 additions and 4 deletions

View File

@@ -1314,3 +1314,21 @@ a b
2 2023-07-22 00:36:20.567890
DROP TABLE t;
SET time_zone= default;
#
# MDEV-24959: ER_BINLOG_ROW_LOGGING_FAILED (1534: Writing one row to the row-based binary log failed)
#
SET SESSION binlog_format= ROW;
SET SESSION binlog_row_image= MINIMAL;
RESET MASTER;
CREATE TABLE t1 (a INT NOT NULL DEFAULT 0 PRIMARY KEY);
REPLACE INTO t1 () VALUES (),();
DROP TABLE t1;
FLUSH BINARY LOGS;
SET SESSION binlog_format= STATEMENT;
SET SESSION binlog_row_image= default;
FOUND 1 /Number of rows: 2/ in mdev24959_1.txt
FOUND 1 /DROP TABLE/ in mdev24959_1.txt
FOUND 1 /Number of rows: 2/ in mdev24959_2.txt
FOUND 1 /DROP TABLE/ in mdev24959_2.txt
FOUND 1 /INSERT INTO .* VALUES/ in mdev24959_2.txt
FOUND 1 /SET /[*] no columns [*]// in mdev24959_2.txt