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
f6ee1324
Commit
f6ee1324
authored
Dec 19, 2018
by
Aleksey Midenkov
Committed by
Sergei Golubchik
Mar 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Versioning tests stability improvement
Fix SELECT resultset order.
parent
8df04fb8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
96 additions
and
93 deletions
+96
-93
mysql-test/suite/versioning/r/rpl.result
mysql-test/suite/versioning/r/rpl.result
+27
-27
mysql-test/suite/versioning/r/update,trx_id.rdiff
mysql-test/suite/versioning/r/update,trx_id.rdiff
+11
-8
mysql-test/suite/versioning/r/update.result
mysql-test/suite/versioning/r/update.result
+26
-26
mysql-test/suite/versioning/t/rpl.test
mysql-test/suite/versioning/t/rpl.test
+22
-22
mysql-test/suite/versioning/t/update.test
mysql-test/suite/versioning/t/update.test
+10
-10
No files found.
mysql-test/suite/versioning/r/rpl.result
View file @
f6ee1324
...
...
@@ -4,38 +4,38 @@ connection slave;
connection master;
CREATE TABLE t1 (x int) with system versioning;
insert into t1 values (1);
SELECT * FROM t1
;
select * from t1 order by x
;
x
1
delete from t1;
select * from t1;
select * from t1
order by x
;
x
select * from t1 for system_time all;
select * from t1 for system_time all
order by row_end, x
;
x
1
connection slave;
select * from t1;
select * from t1
order by x
;
x
select * from t1 for system_time all;
select * from t1 for system_time all
order by row_end, x
;
x
1
connection master;
insert into t1 values (2);
connection slave;
select * from t1;
select * from t1
order by x
;
x
2
connection master;
update t1 set x = 3;
connection slave;
select * from t1;
select * from t1
order by x
;
x
3
select * from t1 for system_time all;
select * from t1 for system_time all
order by row_end, x
;
x
1
3
2
3
# check unversioned -> versioned replication
connection master;
create or replace table t1 (x int primary key);
...
...
@@ -44,28 +44,28 @@ alter table t1 with system versioning;
connection master;
insert into t1 values (1);
connection slave;
select * from t1;
select * from t1
order by x
;
x
1
select * from t1 for system_time all;
select * from t1 for system_time all
order by row_end, x
;
x
1
connection master;
update t1 set x= 2 where x = 1;
connection slave;
select * from t1;
select * from t1
order by x
;
x
2
select * from t1 for system_time all;
select * from t1 for system_time all
order by row_end, x
;
x
1
2
connection master;
delete from t1;
connection slave;
select * from t1;
select * from t1
order by x
;
x
select * from t1 for system_time all;
select * from t1 for system_time all
order by row_end, x
;
x
1
2
...
...
@@ -78,22 +78,22 @@ connection master;
insert into t1 values (1);
update t1 set x= 2 where x = 1;
connection slave;
select * from t1;
select * from t1
order by x
;
x
2
select * from t1 for system_time all;
select * from t1 for system_time all
order by row_end, x
;
x
2
1
2
connection master;
delete from t1;
connection slave;
select * from t1;
select * from t1
order by x
;
x
select * from t1 for system_time all;
select * from t1 for system_time all
order by row_end, x
;
x
2
1
2
# multi-update
connection master;
create or replace table t1 (x int) with system versioning;
...
...
@@ -102,20 +102,20 @@ insert into t1 values (1);
insert into t2 values (2);
update t1, t2 set t1.x=11, t2.x=22;
connection slave;
select * from t1;
select * from t1
order by x
;
x
11
select * from t2;
select * from t2
order by x
;
x
22
select * from t1 for system_time all;
select * from t1 for system_time all
order by row_end, x
;
x
11
1
select * from t2 for system_time all;
11
select * from t2 for system_time all order by row_end, x;
x
22
2
22
# MDEV-14767 system_versioning_alter_history breaks ALTER replication
## Case 1: KEEP on the master, ALTER will work on the slave
connection master;
...
...
mysql-test/suite/versioning/r/update,trx_id.rdiff
View file @
f6ee1324
--- suite/versioning/r/update.result
+++ suite/versioning/r/update.reject
@@ -88,10 +88,8 @@
5 3 1
3 1 0
--- update.result 2018-12-19 13:55:35.873917389 +0300
+++ update,trx_id.reject 2018-12-19 13:55:35.533917399 +0300
@@ -81,12 +81,10 @@
commit;
select x, y, sys_trx_end = MAXVAL as current from t1 for system_time all order by sys_trx_end, x, y;
x y current
-3 1 0
2 1 0
-3 2 0
+3 1 0
4 1 0
5 1 0
-5 2 0
drop table t1;
create table t1 (
id int primary key auto_increment,
1 1 1
2 2 1
3 3 1
mysql-test/suite/versioning/r/update.result
View file @
f6ee1324
...
...
@@ -6,7 +6,7 @@ sys_trx_end SYS_DATATYPE as row end invisible,
period for system_time (sys_trx_start, sys_trx_end))
with system versioning;
insert into t1(x, y) values (1, 1000), (2, 2000), (3, 3000), (4, 4000), (5, 5000), (6, 6000), (7, 7000), (8, 8000), (9, 9000);
select x, y from t1;
select x, y from t1
order by x, y
;
x y
1 1000
2 2000
...
...
@@ -18,7 +18,7 @@ x y
8 8000
9 9000
update t1 set y = y + 1 where x > 7;
select x, y from t1;
select x, y from t1
order by x, y
;
x y
1 1000
2 2000
...
...
@@ -29,8 +29,10 @@ x y
7 7000
8 8001
9 9001
select x, y from t1 for system_time all;
select x, y from t1 for system_time all
order by sys_trx_end, x, y
;
x y
8 8000
9 9000
1 1000
2 2000
3 3000
...
...
@@ -40,8 +42,6 @@ x y
7 7000
8 8001
9 9001
8 8000
9 9000
drop table t1;
create table t1 (
id bigint primary key,
...
...
@@ -79,19 +79,19 @@ update t1 set y= y + 1 where x = 3;
update t1 set y= y + 1 where x > 3;
update t1 set y= y + 1 where x > 4;
commit;
select x, y, sys_trx_end = MAXVAL as current from t1 for system_time all;
select x, y, sys_trx_end = MAXVAL as current from t1 for system_time all
order by sys_trx_end, x, y
;
x y current
1 1 1
2 2 1
3 3 1
4 2 1
5 3 1
3 1 0
2 1 0
3 2 0
4 1 0
5 1 0
5 2 0
1 1 1
2 2 1
3 3 1
4 2 1
5 3 1
drop table t1;
create table t1 (
id int primary key auto_increment,
...
...
@@ -129,15 +129,15 @@ with system versioning;
insert into t1(x, y) values (1, 1000), (3, 3000), (4, 4000), (5, 5000);
insert into t1(x, y) values(3, 3000) on duplicate key update y = y+1;
insert into t1(x, y) values(4, 4444) on duplicate key update y = y+1;
select x, y from t1 for system_time all;
select x, y from t1 for system_time all
order by sys_trx_end, x, y
;
x y
1 1000
3 3000
1 1000
3 3001
4 4000
4 4444
5 5000
select x, y from t1;
select x, y from t1
order by x, y
;
x y
1 1000
3 3001
...
...
@@ -156,8 +156,10 @@ create table t2 like t1;
insert into t1(x, y) values (1, 1000), (2, 2000), (3, 3000), (4, 4000), (5, 5000), (6, 6000), (7, 7000), (8, 8000), (9, 9000);
insert into t2(x, y) values (1, 1010), (2, 2010), (3, 3010), (4, 4010), (5, 5010), (6, 6010), (7, 7010), (8, 8010), (9, 9010);
update t1, t2 set t1.y = t1.x + t1.y, t2.y = t2.x + t2.y where t1.x > 7 and t2.x < 7;
select x, y from t1 for system_time all;
select x, y from t1 for system_time all
order by sys_trx_end, x, y
;
x y
8 8000
9 9000
1 1000
2 2000
3 3000
...
...
@@ -167,9 +169,7 @@ x y
7 7000
8 8008
9 9009
8 8000
9 9000
select x, y from t1;
select x, y from t1 order by x, y;
x y
1 1000
2 2000
...
...
@@ -180,8 +180,14 @@ x y
7 7000
8 8008
9 9009
select x, y from t2 for system_time all;
select x, y from t2 for system_time all
order by sys_trx_end, x, y
;
x y
1 1010
2 2010
3 3010
4 4010
5 5010
6 6010
1 1011
2 2012
3 3013
...
...
@@ -191,13 +197,7 @@ x y
7 7010
8 8010
9 9010
1 1010
2 2010
3 3010
4 4010
5 5010
6 6010
select x, y from t2;
select x, y from t2 order by x, y;
x y
1 1011
2 2012
...
...
mysql-test/suite/versioning/t/rpl.test
View file @
f6ee1324
...
...
@@ -14,24 +14,24 @@ let $slave_com_update_before= query_get_value(SHOW GLOBAL STATUS LIKE 'com_updat
connection
master
;
CREATE
TABLE
t1
(
x
int
)
with
system
versioning
;
insert
into
t1
values
(
1
);
SELECT
*
FROM
t1
;
select
*
from
t1
order
by
x
;
delete
from
t1
;
select
*
from
t1
;
select
*
from
t1
for
system_time
all
;
select
*
from
t1
order
by
x
;
select
*
from
t1
for
system_time
all
order
by
row_end
,
x
;
sync_slave_with_master
;
select
*
from
t1
;
select
*
from
t1
for
system_time
all
;
select
*
from
t1
order
by
x
;
select
*
from
t1
for
system_time
all
order
by
row_end
,
x
;
connection
master
;
insert
into
t1
values
(
2
);
sync_slave_with_master
;
select
*
from
t1
;
select
*
from
t1
order
by
x
;
connection
master
;
update
t1
set
x
=
3
;
sync_slave_with_master
;
select
*
from
t1
;
select
*
from
t1
for
system_time
all
;
select
*
from
t1
order
by
x
;
select
*
from
t1
for
system_time
all
order
by
row_end
,
x
;
--
echo
# check unversioned -> versioned replication
connection
master
;
...
...
@@ -42,20 +42,20 @@ alter table t1 with system versioning;
connection
master
;
insert
into
t1
values
(
1
);
sync_slave_with_master
;
select
*
from
t1
;
select
*
from
t1
for
system_time
all
;
select
*
from
t1
order
by
x
;
select
*
from
t1
for
system_time
all
order
by
row_end
,
x
;
connection
master
;
update
t1
set
x
=
2
where
x
=
1
;
sync_slave_with_master
;
select
*
from
t1
;
select
*
from
t1
for
system_time
all
;
select
*
from
t1
order
by
x
;
select
*
from
t1
for
system_time
all
order
by
row_end
,
x
;
connection
master
;
delete
from
t1
;
sync_slave_with_master
;
select
*
from
t1
;
select
*
from
t1
for
system_time
all
;
select
*
from
t1
order
by
x
;
select
*
from
t1
for
system_time
all
order
by
row_end
,
x
;
--
echo
# same thing (UPDATE, DELETE), but without PK
connection
master
;
...
...
@@ -67,14 +67,14 @@ connection master;
insert
into
t1
values
(
1
);
update
t1
set
x
=
2
where
x
=
1
;
sync_slave_with_master
;
select
*
from
t1
;
select
*
from
t1
for
system_time
all
;
select
*
from
t1
order
by
x
;
select
*
from
t1
for
system_time
all
order
by
row_end
,
x
;
connection
master
;
delete
from
t1
;
sync_slave_with_master
;
select
*
from
t1
;
select
*
from
t1
for
system_time
all
;
select
*
from
t1
order
by
x
;
select
*
from
t1
for
system_time
all
order
by
row_end
,
x
;
--
echo
# multi-update
connection
master
;
...
...
@@ -84,10 +84,10 @@ insert into t1 values (1);
insert
into
t2
values
(
2
);
update
t1
,
t2
set
t1
.
x
=
11
,
t2
.
x
=
22
;
sync_slave_with_master
;
select
*
from
t1
;
select
*
from
t2
;
select
*
from
t1
for
system_time
all
;
select
*
from
t2
for
system_time
all
;
select
*
from
t1
order
by
x
;
select
*
from
t2
order
by
x
;
select
*
from
t1
for
system_time
all
order
by
row_end
,
x
;
select
*
from
t2
for
system_time
all
order
by
row_end
,
x
;
--
echo
# MDEV-14767 system_versioning_alter_history breaks ALTER replication
--
echo
## Case 1: KEEP on the master, ALTER will work on the slave
...
...
mysql-test/suite/versioning/t/update.test
View file @
f6ee1324
...
...
@@ -11,10 +11,10 @@ eval create table t1(
with
system
versioning
;
insert
into
t1
(
x
,
y
)
values
(
1
,
1000
),
(
2
,
2000
),
(
3
,
3000
),
(
4
,
4000
),
(
5
,
5000
),
(
6
,
6000
),
(
7
,
7000
),
(
8
,
8000
),
(
9
,
9000
);
select
x
,
y
from
t1
;
select
x
,
y
from
t1
order
by
x
,
y
;
update
t1
set
y
=
y
+
1
where
x
>
7
;
select
x
,
y
from
t1
;
select
x
,
y
from
t1
for
system_time
all
;
select
x
,
y
from
t1
order
by
x
,
y
;
select
x
,
y
from
t1
for
system_time
all
order
by
sys_trx_end
,
x
,
y
;
drop
table
t1
;
replace_result
$sys_datatype_expl
SYS_DATATYPE
;
...
...
@@ -56,7 +56,7 @@ update t1 set y= y + 1 where x > 4;
commit
;
replace_result
$sys_datatype_max
MAXVAL
;
eval
select
x
,
y
,
sys_trx_end
=
$sys_datatype_max
as
current
from
t1
for
system_time
all
;
eval
select
x
,
y
,
sys_trx_end
=
$sys_datatype_max
as
current
from
t1
for
system_time
all
order
by
sys_trx_end
,
x
,
y
;
drop
table
t1
;
...
...
@@ -95,8 +95,8 @@ with system versioning;
insert
into
t1
(
x
,
y
)
values
(
1
,
1000
),
(
3
,
3000
),
(
4
,
4000
),
(
5
,
5000
);
insert
into
t1
(
x
,
y
)
values
(
3
,
3000
)
on
duplicate
key
update
y
=
y
+
1
;
insert
into
t1
(
x
,
y
)
values
(
4
,
4444
)
on
duplicate
key
update
y
=
y
+
1
;
select
x
,
y
from
t1
for
system_time
all
;
select
x
,
y
from
t1
;
select
x
,
y
from
t1
for
system_time
all
order
by
sys_trx_end
,
x
,
y
;
select
x
,
y
from
t1
order
by
x
,
y
;
drop
table
t1
;
replace_result
$sys_datatype_expl
SYS_DATATYPE
;
...
...
@@ -111,10 +111,10 @@ create table t2 like t1;
insert
into
t1
(
x
,
y
)
values
(
1
,
1000
),
(
2
,
2000
),
(
3
,
3000
),
(
4
,
4000
),
(
5
,
5000
),
(
6
,
6000
),
(
7
,
7000
),
(
8
,
8000
),
(
9
,
9000
);
insert
into
t2
(
x
,
y
)
values
(
1
,
1010
),
(
2
,
2010
),
(
3
,
3010
),
(
4
,
4010
),
(
5
,
5010
),
(
6
,
6010
),
(
7
,
7010
),
(
8
,
8010
),
(
9
,
9010
);
update
t1
,
t2
set
t1
.
y
=
t1
.
x
+
t1
.
y
,
t2
.
y
=
t2
.
x
+
t2
.
y
where
t1
.
x
>
7
and
t2
.
x
<
7
;
select
x
,
y
from
t1
for
system_time
all
;
select
x
,
y
from
t1
;
select
x
,
y
from
t2
for
system_time
all
;
select
x
,
y
from
t2
;
select
x
,
y
from
t1
for
system_time
all
order
by
sys_trx_end
,
x
,
y
;
select
x
,
y
from
t1
order
by
x
,
y
;
select
x
,
y
from
t2
for
system_time
all
order
by
sys_trx_end
,
x
,
y
;
select
x
,
y
from
t2
order
by
x
,
y
;
drop
table
t1
;
drop
table
t2
;
...
...
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