Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
abb2f948
Commit
abb2f948
authored
Dec 26, 2016
by
kevg
Committed by
Aleksey Midenkov
May 05, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
IB: skip sys_trx_start when comparing master and slave rows [closes #107]
parent
4383e16c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
6 deletions
+47
-6
mysql-test/suite/versioning/r/rpl_row.result
mysql-test/suite/versioning/r/rpl_row.result
+13
-0
mysql-test/suite/versioning/r/rpl_stmt.result
mysql-test/suite/versioning/r/rpl_stmt.result
+13
-0
mysql-test/suite/versioning/t/rpl_test.inc
mysql-test/suite/versioning/t/rpl_test.inc
+11
-0
sql/log_event.cc
sql/log_event.cc
+4
-6
sql/table.h
sql/table.h
+6
-0
No files found.
mysql-test/suite/versioning/r/rpl_row.result
View file @
abb2f948
...
@@ -109,5 +109,18 @@ connection slave;
...
@@ -109,5 +109,18 @@ connection slave;
select * from t1;
select * from t1;
x
x
connection master;
connection master;
create or replace table t1 (a int) with system versioning engine = innodb;
insert into t1 values (1);
update t1 set a=2;
select * from t1 for system_time all;
a
2
1
connection slave;
select * from t1 for system_time all;
a
2
1
connection master;
drop table t1;
drop table t1;
include/rpl_end.inc
include/rpl_end.inc
mysql-test/suite/versioning/r/rpl_stmt.result
View file @
abb2f948
...
@@ -109,5 +109,18 @@ connection slave;
...
@@ -109,5 +109,18 @@ connection slave;
select * from t1;
select * from t1;
x
x
connection master;
connection master;
create or replace table t1 (a int) with system versioning engine = innodb;
insert into t1 values (1);
update t1 set a=2;
select * from t1 for system_time all;
a
2
1
connection slave;
select * from t1 for system_time all;
a
2
1
connection master;
drop table t1;
drop table t1;
include/rpl_end.inc
include/rpl_end.inc
mysql-test/suite/versioning/t/rpl_test.inc
View file @
abb2f948
...
@@ -86,5 +86,16 @@ select * from t1 for system_time all;
...
@@ -86,5 +86,16 @@ select * from t1 for system_time all;
sync_slave_with_master
;
sync_slave_with_master
;
select
*
from
t1
;
select
*
from
t1
;
# at this point in this particular test master and slave have different curr_trx_id
# and the same rows have different sys_trx_start
# slave should ignore sys_trx_start while searching for a record to update in a InnoDB table
connection
master
;
create
or
replace
table
t1
(
a
int
)
with
system
versioning
engine
=
innodb
;
insert
into
t1
values
(
1
);
update
t1
set
a
=
2
;
select
*
from
t1
for
system_time
all
;
sync_slave_with_master
;
select
*
from
t1
for
system_time
all
;
connection
master
;
connection
master
;
drop
table
t1
;
drop
table
t1
;
sql/log_event.cc
View file @
abb2f948
...
@@ -12766,7 +12766,7 @@ uint8 Write_rows_log_event::get_trg_event_map()
...
@@ -12766,7 +12766,7 @@ uint8 Write_rows_log_event::get_trg_event_map()
Returns TRUE if different.
Returns TRUE if different.
*/
*/
static
bool
record_compare
(
TABLE
*
table
,
bool
skip_sys_start
)
static
bool
record_compare
(
TABLE
*
table
)
{
{
bool
result
=
FALSE
;
bool
result
=
FALSE
;
/**
/**
...
@@ -12799,7 +12799,7 @@ static bool record_compare(TABLE *table, bool skip_sys_start)
...
@@ -12799,7 +12799,7 @@ static bool record_compare(TABLE *table, bool skip_sys_start)
/* Compare fields */
/* Compare fields */
for
(
Field
**
ptr
=
table
->
field
;
*
ptr
;
ptr
++
)
for
(
Field
**
ptr
=
table
->
field
;
*
ptr
;
ptr
++
)
{
{
if
(
skip_sys_start
&&
*
ptr
==
table
->
vers_start_field
())
if
(
table
->
versioned_by_engine
()
&&
*
ptr
==
table
->
vers_start_field
())
{
{
continue
;
continue
;
}
}
...
@@ -12997,7 +12997,6 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
...
@@ -12997,7 +12997,6 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
prepare_record
(
table
,
m_width
,
FALSE
);
prepare_record
(
table
,
m_width
,
FALSE
);
error
=
unpack_current_row
(
rgi
);
error
=
unpack_current_row
(
rgi
);
bool
skip_sys_start
=
false
;
if
(
table
->
versioned
())
if
(
table
->
versioned
())
{
{
...
@@ -13011,7 +13010,6 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
...
@@ -13011,7 +13010,6 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
bitmap_set_bit
(
table
->
write_set
,
sys_trx_end
->
field_index
);
bitmap_set_bit
(
table
->
write_set
,
sys_trx_end
->
field_index
);
sys_trx_end
->
set_max
();
sys_trx_end
->
set_max
();
table
->
vers_start_field
()
->
set_notnull
();
table
->
vers_start_field
()
->
set_notnull
();
skip_sys_start
=
true
;
}
}
}
}
...
@@ -13190,7 +13188,7 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
...
@@ -13190,7 +13188,7 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
/* We use this to test that the correct key is used in test cases. */
/* We use this to test that the correct key is used in test cases. */
DBUG_EXECUTE_IF
(
"slave_crash_if_index_scan"
,
abort
(););
DBUG_EXECUTE_IF
(
"slave_crash_if_index_scan"
,
abort
(););
while
(
record_compare
(
table
,
skip_sys_start
))
while
(
record_compare
(
table
))
{
{
while
((
error
=
table
->
file
->
ha_index_next
(
table
->
record
[
0
])))
while
((
error
=
table
->
file
->
ha_index_next
(
table
->
record
[
0
])))
{
{
...
@@ -13254,7 +13252,7 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
...
@@ -13254,7 +13252,7 @@ int Rows_log_event::find_row(rpl_group_info *rgi)
goto
end
;
goto
end
;
}
}
}
}
while
(
record_compare
(
table
,
skip_sys_start
));
while
(
record_compare
(
table
));
/*
/*
Note: above record_compare will take into accout all record fields
Note: above record_compare will take into accout all record fields
...
...
sql/table.h
View file @
abb2f948
...
@@ -1522,6 +1522,12 @@ struct TABLE
...
@@ -1522,6 +1522,12 @@ struct TABLE
return
s
->
versioned
&&
!
file
->
versioned
();
return
s
->
versioned
&&
!
file
->
versioned
();
}
}
bool
versioned_by_engine
()
const
{
DBUG_ASSERT
(
file
);
return
s
->
versioned
&&
file
->
versioned
();
}
Field
*
vers_start_field
()
const
Field
*
vers_start_field
()
const
{
{
DBUG_ASSERT
(
s
->
versioned
);
DBUG_ASSERT
(
s
->
versioned
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment