Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions mysql-test/suite/rpl/r/rpl_row_img_eng_noblob.result
Original file line number Diff line number Diff line change
Expand Up @@ -4780,5 +4780,65 @@ FLUSH TABLES;
SHOW VARIABLES LIKE 'binlog_row_image';
Variable_name Value
binlog_row_image FULL
#
# MDEV-38899: Assert !((f->flags & NO_DEFAULT_VALUE_FLAG) && f->vcol_info)
# in prepare_record() with binlog_row_image=NOBLOB and UNIQUE BLOB column
#
connection server_1;
CREATE TABLE t1 (
id INT NOT NULL,
b BLOB NOT NULL,
UNIQUE KEY (b(64))
) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 'hello');
INSERT INTO t1 VALUES (2, 'world');
include/rpl_sync.inc
connection server_1;
SELECT id, CONVERT(b USING utf8) AS b FROM t1 ORDER BY id;
id b
1 hello
2 world
connection server_1;
UPDATE t1 SET id = 10 WHERE id = 1;
UPDATE t1 SET id = 20 WHERE id = 2;
include/rpl_sync.inc
connection server_1;
SELECT id, CONVERT(b USING utf8) AS b FROM t1 ORDER BY id;
id b
10 hello
20 world
connection server_1;
DROP TABLE t1;
include/rpl_sync.inc
#
# MDEV-38899: Assert !((f->flags & NO_DEFAULT_VALUE_FLAG) && f->vcol_info)
# in prepare_record() with binlog_row_image=NOBLOB and UNIQUE BLOB column
#
connection server_1;
CREATE TABLE t1 (
id INT NOT NULL,
b BLOB NOT NULL,
UNIQUE KEY (b(64))
) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1, 'hello');
INSERT INTO t1 VALUES (2, 'world');
include/rpl_sync.inc
connection server_1;
SELECT id, CONVERT(b USING utf8) AS b FROM t1 ORDER BY id;
id b
1 hello
2 world
connection server_1;
UPDATE t1 SET id = 10 WHERE id = 1;
UPDATE t1 SET id = 20 WHERE id = 2;
include/rpl_sync.inc
connection server_1;
SELECT id, CONVERT(b USING utf8) AS b FROM t1 ORDER BY id;
id b
10 hello
20 world
connection server_1;
DROP TABLE t1;
include/rpl_sync.inc
connection server_1;
include/rpl_end.inc
68 changes: 29 additions & 39 deletions mysql-test/suite/rpl/t/rpl_row_img_eng_noblob.test
Original file line number Diff line number Diff line change
@@ -1,39 +1,29 @@
#Want to skip this test from daily Valgrind execution
--source include/no_valgrind_without_big.inc
#
# This file contains tests for WL#5096 and bug fixes.
#

--let $rpl_topology= 1->2->3
--source include/rpl_init.inc
-- source include/have_binlog_format_row.inc

-- connection server_1
-- source include/have_innodb.inc
-- connection server_2
-- source include/have_innodb.inc
-- connection server_3
-- source include/have_innodb.inc
-- connection server_1

#
# WL#5096
#

#
# Tests for different storage engines on each server,
# but same index structure on tables. The tests are conducted
# using NOBLOB binlog-row-image on all servers.
#

-- let $row_img_set=server_1:NOBLOB:N,server_2:NOBLOB:Y,server_3:NOBLOB:Y
-- source include/rpl_row_img_set.inc

-- let $row_img_test_script= include/rpl_row_img.test
-- source include/rpl_row_img_general_loop.inc

-- let $row_img_set=server_1:FULL:N,server_2:FULL:Y,server_3:FULL:Y
-- source include/rpl_row_img_set.inc


--source include/rpl_end.inc
--echo #
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused why the original part of this test is removed.

I didn't follow "Pull in rpl_row_img_eng_noblob.test from upstream/12.3" from commit message, because as this is based on 12.3, the should only be the addition of the test for this MDEV.

Per the GH status failure, they pertain to this test. Replication test aren't supported in embedded mode requring --source include/not_embedded.inc in the prefix. Its assumed that part of the original test had this already.

--echo # MDEV-38899: Assert !((f->flags & NO_DEFAULT_VALUE_FLAG) && f->vcol_info)
--echo # in prepare_record() with binlog_row_image=NOBLOB and UNIQUE BLOB column
--echo #
--connection server_1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

binlog_row_image=NOBLOB isn't set by this test.

CREATE TABLE t1 (
id INT NOT NULL,
b BLOB NOT NULL,
UNIQUE KEY (b(64))
) ENGINE=InnoDB;

INSERT INTO t1 VALUES (1, 'hello');
INSERT INTO t1 VALUES (2, 'world');
--source include/rpl_sync.inc
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

per the comments in in the top of this file, this requires rpl_int.inc`.


--connection server_1
SELECT id, CONVERT(b USING utf8) AS b FROM t1 ORDER BY id;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its not clear why you think the result is changing. If you really want to check, perhaps testing on the replica connection.


--connection server_1
UPDATE t1 SET id = 10 WHERE id = 1;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as this isn't changing the unique blobs, what is the exercising?

UPDATE t1 SET id = 20 WHERE id = 2;
--source include/rpl_sync.inc

--connection server_1
SELECT id, CONVERT(b USING utf8) AS b FROM t1 ORDER BY id;

--connection server_1
DROP TABLE t1;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original test included include/rpl_row_img.test. This might be a good place to add a BLOB with index. Per the MDEV the only real test required is to insert and ensure it replicates.

--source include/rpl_sync.inc
4 changes: 2 additions & 2 deletions sql/rpl_record.cc
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ int prepare_record(TABLE *const table)
For fields on the slave that are not going to be updated from the row image,
we check if they have a default.
The check follows the same rules as the INSERT query without specifying an
explicit value for a field not having the explicit default
explicit value for a field not having the explicit default
(@c check_that_all_fields_are_given_values()).
*/
col= bitmap_get_first_clear(table->write_set);
Expand All @@ -584,7 +584,7 @@ int prepare_record(TABLE *const table)
continue;

Field *const f= *field_ptr;
DBUG_ASSERT(!((f->flags & NO_DEFAULT_VALUE_FLAG) && f->vcol_info)); // QQ
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing this is a left-over from times when there was no has_no_default_value() helper function.
I would model this check to be as close as possible to the check in check_that_all_fields_are_given_values(). I'd even consider addopting check_that_all_fields_are_given_values() itself.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

has_no_default_value() has the expression including system version interval rows:

    if ((field->flags & (NO_DEFAULT_VALUE_FLAG | VERS_ROW_START | VERS_ROW_END))
         == NO_DEFAULT_VALUE_FLAG && field->real_type() != MYSQL_TYPE_ENUM)

And no !(*field)->vcol_info (added with be237b3), however given the other use of has_no_default_value it could be moved there.

Yes looks scarily close.


if ((f->flags & NO_DEFAULT_VALUE_FLAG) &&
(f->real_type() != MYSQL_TYPE_ENUM) && !f->vcol_info)
{
Expand Down
Loading