Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix recalculation of vcols in binlog_row_image=minimal
unpack_row() must calculate all stored and indexed vcols (in fill_extra_persistent_columns()). Also Update and Delete row events must mark in read_set all columns needed for calculating all stored and indexed vcols. If it's done properly in do_apply_event(), it no longer needs to be repeated per row.
- Loading branch information
Showing
5 changed files
with
100 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
include/master-slave.inc | ||
[connection master] | ||
set binlog_row_image=minimal; | ||
connection slave; | ||
stop slave; | ||
set global binlog_row_image=minimal; | ||
include/reset_slave.inc | ||
create table t1 ( | ||
a int key, b blob, c char(5), | ||
d char(10) as (concat(trim(c), '-U')) unique, | ||
e char(10) as (concat('S', b)) stored) engine=innodb; | ||
connection master; | ||
create table t1 (a int primary key, b blob, c char(5)) engine=innodb; | ||
reset master; | ||
connection slave; | ||
start slave; | ||
connection master; | ||
set timestamp=unix_timestamp('2010-10-10 10:10:10'); | ||
insert t1 values (1,'.','Kyle'),(2,'?','JOE'),(3,'!','QA'), (4, '$', '4TH'); | ||
update t1 set c='UPD' where a=3; | ||
update t1 set b='#' where a=2; | ||
delete from t1 where a=4; | ||
select * from t1; | ||
a b c | ||
1 . Kyle | ||
2 # JOE | ||
3 ! UPD | ||
connection slave; | ||
select * from t1; | ||
a b c d e | ||
1 . Kyle Kyle-U S. | ||
2 # JOE JOE-U S# | ||
3 ! UPD UPD-U S! | ||
select d from t1; | ||
d | ||
JOE-U | ||
Kyle-U | ||
UPD-U | ||
select * from t1 where d='JOE-U'; | ||
a b c d e | ||
2 # JOE JOE-U S# | ||
connection master; | ||
drop table t1; | ||
connection slave; | ||
set global binlog_row_image=full; | ||
include/rpl_end.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--source include/have_binlog_format_row.inc | ||
--source include/have_innodb.inc | ||
--source include/master-slave.inc | ||
|
||
set binlog_row_image=minimal; | ||
|
||
connection slave; | ||
stop slave; | ||
set global binlog_row_image=minimal; | ||
--source include/reset_slave.inc | ||
|
||
create table t1 ( | ||
a int key, b blob, c char(5), | ||
d char(10) as (concat(trim(c), '-U')) unique, | ||
e char(10) as (concat('S', b)) stored) engine=innodb; | ||
|
||
connection master; | ||
create table t1 (a int primary key, b blob, c char(5)) engine=innodb; | ||
reset master; | ||
|
||
connection slave; | ||
start slave; | ||
|
||
connection master; | ||
set timestamp=unix_timestamp('2010-10-10 10:10:10'); | ||
insert t1 values (1,'.','Kyle'),(2,'?','JOE'),(3,'!','QA'), (4, '$', '4TH'); | ||
update t1 set c='UPD' where a=3; | ||
update t1 set b='#' where a=2; | ||
delete from t1 where a=4; | ||
--sorted_result | ||
select * from t1; | ||
--sorted_result | ||
sync_slave_with_master; | ||
--sorted_result | ||
select * from t1; | ||
select d from t1; # no --sorted_result here, this must be KEYREAD, so must be sorted | ||
select * from t1 where d='JOE-U'; | ||
|
||
connection master; | ||
drop table t1; | ||
sync_slave_with_master; | ||
set global binlog_row_image=full; | ||
|
||
--source include/rpl_end.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters