mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
3a64d55aed
* Syntax sugar: query-global QUERY FOR SYSTEM_TIME
69 lines
2 KiB
Text
69 lines
2 KiB
Text
create table t(
|
|
a int,
|
|
b int without system versioning
|
|
) with system versioning;
|
|
insert into t values(1, 2);
|
|
insert into t values(3, 4);
|
|
select * from t;
|
|
a b
|
|
1 2
|
|
3 4
|
|
select a from t for system_time as of timestamp now(6);
|
|
a
|
|
1
|
|
3
|
|
select a, b, b+0 from t for system_time as of timestamp now(6);
|
|
a b b+0
|
|
1 NULL NULL
|
|
3 NULL NULL
|
|
Warnings:
|
|
Warning 4075 Attempt to read unversioned field `b` in historical query
|
|
Warning 4075 Attempt to read unversioned field `b` in historical query
|
|
select * from t for system_time as of timestamp now(6);
|
|
a b
|
|
1 NULL
|
|
3 NULL
|
|
Warnings:
|
|
Warning 4075 Attempt to read unversioned field `b` in historical query
|
|
select count(*) from t group by b query for system_time as of timestamp now(6);
|
|
count(*)
|
|
2
|
|
Warnings:
|
|
Warning 4075 Attempt to read unversioned field `b` in historical query
|
|
select * from t for system_time as of timestamp now(6) order by b asc;
|
|
a b
|
|
1 NULL
|
|
3 NULL
|
|
Warnings:
|
|
Warning 4075 Attempt to read unversioned field `b` in historical query
|
|
select * from t for system_time as of timestamp now(6) order by b desc;
|
|
a b
|
|
1 NULL
|
|
3 NULL
|
|
Warnings:
|
|
Warning 4075 Attempt to read unversioned field `b` in historical query
|
|
select * from t group by a having a=2 query for system_time as of timestamp now(6);
|
|
a b
|
|
Warnings:
|
|
Warning 4075 Attempt to read unversioned field `b` in historical query
|
|
select * from t group by b having b=2 query for system_time as of timestamp now(6);
|
|
a b
|
|
Warnings:
|
|
Warning 4075 Attempt to read unversioned field `b` in historical query
|
|
select a from t where b=2 query for system_time as of timestamp now(6);
|
|
a
|
|
Warnings:
|
|
Warning 4075 Attempt to read unversioned field `b` in historical query
|
|
select a from t where b=NULL query for system_time as of timestamp now(6);
|
|
a
|
|
Warnings:
|
|
Warning 4075 Attempt to read unversioned field `b` in historical query
|
|
select count(*), b from t group by b having b=NULL query for system_time as of timestamp now(6);
|
|
count(*) b
|
|
Warnings:
|
|
Warning 4075 Attempt to read unversioned field `b` in historical query
|
|
select a, b from t;
|
|
a b
|
|
1 2
|
|
3 4
|
|
drop table t;
|