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
d65bc829
Commit
d65bc829
authored
Oct 31, 2016
by
Aleksey Midenkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests: (0.4) TRANSACTION support in queries (#27)
parent
6d89a4a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
152 additions
and
16 deletions
+152
-16
mysql-test/suite/versioning/r/select.result
mysql-test/suite/versioning/r/select.result
+129
-11
mysql-test/suite/versioning/t/select.test
mysql-test/suite/versioning/t/select.test
+23
-5
No files found.
mysql-test/suite/versioning/r/select.result
View file @
d65bc829
...
...
@@ -42,15 +42,30 @@ insert into t1 (x, y) values
(8, 108),
(9, 109);
set @t0= now(6);
if engine = 'innodb' then
select sys_start from t1 limit 1 into @x0;
end if;
delete from t1 where x = 3;
delete from t1 where x > 7;
insert into t1(x, y) values(3, 33);
set @str= concat('select ', fields, ' from t1 where x = 3 and y = 33 into @t1');
prepare stmt from @str; execute stmt; drop prepare stmt;
select sys_start from t1 where x = 3 and y = 33 into @t1;
if engine = 'innodb' then
set @x1= @t1;
select commit_ts(@x1) into @t1;
end if;
select x, y from t1;
select x as AS_OF_x, y from t1 for system_time as of timestamp @t0;
select x as FROM_TO_x, y from t1 for system_time from timestamp '0-0-0 0:0:0' to timestamp @t1;
select x as BETWEEN_AND_x, y from t1 for system_time between timestamp '0-0-0 0:0:0' and timestamp @t1;
select x as ASOF_x, y from t1 for system_time as of timestamp @t0;
select x as FROMTO_x, y from t1 for system_time from timestamp '0-0-0 0:0:0' to timestamp @t1;
select x as BETWAND_x, y from t1 for system_time between timestamp '0-0-0 0:0:0' and timestamp @t1;
select x as FROMTO_ext_x, y from t1 for system_time from timestamp '0-0-0 0:0:0' to timestamp @t1;
select x as BETWAND_ext_x, y from t1 for system_time between timestamp '0-0-0 0:0:0' and timestamp @t1;
if engine = 'innodb' then
select x as ASOF2_x, y from t1 for system_time as of transaction @x0;
select x as FROMTO2_x, y from t1 for system_time from transaction 0 to transaction @x1;
select x as BETWAND2_x, y from t1 for system_time between transaction 0 and transaction @x1;
select x as FROMTO2_ext_x, y from t1 for system_time transaction from 0 to @x1;
select x as BETWAND2_ext_x, y from t1 for system_time transaction between 0 and @x1;
end if;
drop table t1;
end~~
create or replace procedure test_02(
...
...
@@ -97,7 +112,7 @@ x y
6 106
7 107
3 33
AS
_
OF_x y
ASOF_x y
0 100
1 101
2 102
...
...
@@ -108,7 +123,7 @@ AS_OF_x y
7 107
8 108
9 109
FROM
_
TO_x y
FROMTO_x y
0 100
1 101
2 102
...
...
@@ -119,7 +134,30 @@ FROM_TO_x y
7 107
8 108
9 109
BETWEEN_AND_x y
BETWAND_x y
0 100
1 101
2 102
3 103
4 104
5 105
6 106
7 107
8 108
9 109
3 33
FROMTO_ext_x y
0 100
1 101
2 102
3 103
4 104
5 105
6 106
7 107
8 108
9 109
BETWAND_ext_x y
0 100
1 101
2 102
...
...
@@ -141,7 +179,52 @@ x y
6 106
7 107
3 33
AS_OF_x y
ASOF_x y
0 100
1 101
2 102
3 103
4 104
5 105
6 106
7 107
8 108
9 109
FROMTO_x y
0 100
1 101
2 102
3 103
4 104
5 105
6 106
7 107
8 108
9 109
BETWAND_x y
0 100
1 101
2 102
3 103
4 104
5 105
6 106
7 107
8 108
9 109
3 33
FROMTO_ext_x y
0 100
1 101
2 102
3 103
4 104
5 105
6 106
7 107
8 108
9 109
BETWAND_ext_x y
0 100
1 101
2 102
...
...
@@ -152,7 +235,42 @@ AS_OF_x y
7 107
8 108
9 109
FROM_TO_x y
3 33
ASOF2_x y
0 100
1 101
2 102
3 103
4 104
5 105
6 106
7 107
8 108
9 109
FROMTO2_x y
0 100
1 101
2 102
3 103
4 104
5 105
6 106
7 107
8 108
9 109
BETWAND2_x y
0 100
1 101
2 102
3 103
4 104
5 105
6 106
7 107
8 108
9 109
3 33
FROMTO2_ext_x y
0 100
1 101
2 102
...
...
@@ -163,7 +281,7 @@ FROM_TO_x y
7 107
8 108
9 109
BETW
EEN_AND
_x y
BETW
AND2_ext
_x y
0 100
1 101
2 102
...
...
mysql-test/suite/versioning/t/select.test
View file @
d65bc829
...
...
@@ -28,16 +28,34 @@ begin
(
8
,
108
),
(
9
,
109
);
set
@
t0
=
now
(
6
);
if
engine
=
'innodb'
then
select
sys_start
from
t1
limit
1
into
@
x0
;
end
if
;
delete
from
t1
where
x
=
3
;
delete
from
t1
where
x
>
7
;
insert
into
t1
(
x
,
y
)
values
(
3
,
33
);
set
@
str
=
concat
(
'select '
,
fields
,
' from t1 where x = 3 and y = 33 into @t1'
);
prepare
stmt
from
@
str
;
execute
stmt
;
drop
prepare
stmt
;
select
sys_start
from
t1
where
x
=
3
and
y
=
33
into
@
t1
;
if
engine
=
'innodb'
then
set
@
x1
=
@
t1
;
select
commit_ts
(
@
x1
)
into
@
t1
;
end
if
;
select
x
,
y
from
t1
;
select
x
as
AS_OF_x
,
y
from
t1
for
system_time
as
of
timestamp
@
t0
;
select
x
as
FROM_TO_x
,
y
from
t1
for
system_time
from
timestamp
'0-0-0 0:0:0'
to
timestamp
@
t1
;
select
x
as
BETWEEN_AND_x
,
y
from
t1
for
system_time
between
timestamp
'0-0-0 0:0:0'
and
timestamp
@
t1
;
select
x
as
ASOF_x
,
y
from
t1
for
system_time
as
of
timestamp
@
t0
;
select
x
as
FROMTO_x
,
y
from
t1
for
system_time
from
timestamp
'0-0-0 0:0:0'
to
timestamp
@
t1
;
select
x
as
BETWAND_x
,
y
from
t1
for
system_time
between
timestamp
'0-0-0 0:0:0'
and
timestamp
@
t1
;
select
x
as
FROMTO_ext_x
,
y
from
t1
for
system_time
from
timestamp
'0-0-0 0:0:0'
to
timestamp
@
t1
;
select
x
as
BETWAND_ext_x
,
y
from
t1
for
system_time
between
timestamp
'0-0-0 0:0:0'
and
timestamp
@
t1
;
if
engine
=
'innodb'
then
select
x
as
ASOF2_x
,
y
from
t1
for
system_time
as
of
transaction
@
x0
;
select
x
as
FROMTO2_x
,
y
from
t1
for
system_time
from
transaction
0
to
transaction
@
x1
;
select
x
as
BETWAND2_x
,
y
from
t1
for
system_time
between
transaction
0
and
transaction
@
x1
;
select
x
as
FROMTO2_ext_x
,
y
from
t1
for
system_time
transaction
from
0
to
@
x1
;
select
x
as
BETWAND2_ext_x
,
y
from
t1
for
system_time
transaction
between
0
and
@
x1
;
end
if
;
drop
table
t1
;
end
~~
...
...
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