1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-20 05:03:09 +03:00
Files
mariadb/mysql-test/suite/versioning/t/optimized.test
Sergei Golubchik 3198bc839d Parser: unreserve keywords
SELECT * FROM t1 FOR SYSTEM_TIME AS OF ...

becomes ambiguous, but it's the same as with

SELECT ... UNION SELECT ... ORDER BY ...
2017-12-05 15:09:09 +03:00

41 lines
1.7 KiB
Plaintext

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;
select a from t for system_time as of timestamp now(6);
select a, b, b+0 from t for system_time as of timestamp now(6);
select * from t for system_time as of timestamp now(6);
select count(*) from t group by b for system_time as of timestamp now(6);
select * from t for system_time as of timestamp now(6) order by b asc;
select * from t for system_time as of timestamp now(6) order by b desc;
select * from t group by a having a=2 for system_time as of timestamp now(6);
select * from t group by b having b=2 for system_time as of timestamp now(6);
select a from t where b=2 for system_time as of timestamp now(6);
select a from t where b=NULL for system_time as of timestamp now(6);
select a from t where b is NULL for system_time as of timestamp now(6);
select count(*), b from t group by b having b=NULL for system_time as of timestamp now(6);
select a, b from t;
select count(*) from t for system_time as of timestamp now(6) group by b;
select * from t for system_time as of timestamp now(6) group by b having b=2;
select a from t for system_time as of timestamp now(6) where b=2;
select a from t for system_time as of timestamp now(6) where b=NULL;
select a from t for system_time as of timestamp now(6) where b is NULL;
select count(*), b from t for system_time as of timestamp now(6) group by b having b=NULL;
create or replace table t (
a int,
b int not null without system versioning
) with system versioning;
insert into t values (1, 2), (3, 4);
select * from t for system_time as of timestamp now(6);
select * from t for system_time as of timestamp now(6) where b is NULL;
drop table t;