1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

SQL: derived, hiding, error messages

Many related changes.

Note that AS OF condition must always be pushed down to physical tables,
it cannot be applied to a derived or a view. Thus:

* no versioning for internal temporary tables, they can never store
  historical data.
* remove special versioning code from mysql_derived_prepare and
  remove ER_VERS_DERIVED_PROHIBITED - derived can have no historical
  data and cannot be prohibited for system versioning related reasons.
* do not expand select list for derived/views with sys vers fields,
  derived/views can never have historical data.
* remove special invisiblity rules for sys vers fields, they are no
  longer needed after the previous change
* remove system_versioning_hide, it lost the meaning after the
  previous change.
* remove ER_VERS_SYSTEM_TIME_CLASH, it's no "clash", the inner
  AS OF clause always wins.
* non-versioned fields in a historical query

reword the warning text, downgrade to note, don't
replace values with NULLs
This commit is contained in:
Sergei Golubchik
2017-12-30 13:40:36 +01:00
committed by Aleksey Midenkov
parent b06b5c3eab
commit e6a7457653
35 changed files with 98 additions and 451 deletions

View File

@@ -104,14 +104,10 @@ set system_versioning_asof= DEFAULT;
select @@global.system_versioning_asof, @@system_versioning_asof;
@@global.system_versioning_asof @@system_versioning_asof
DEFAULT DEFAULT
show variables where variable_name = "system_versioning_hide";
Variable_name Value
system_versioning_hide IMPLICIT
select * from t for system_time all;
a
2
1
set system_versioning_hide= AUTO;
select * from t;
a
2
@@ -119,39 +115,15 @@ select * from t for system_time as of timestamp current_timestamp(6);
a
2
select * from t for system_time all;
a sys_trx_start sys_trx_end
2 TIMESTAMP TIMESTAMP
1 TIMESTAMP TIMESTAMP
select * from t for system_time from '0-0-0' to current_timestamp(6);
a sys_trx_start sys_trx_end
2 TIMESTAMP TIMESTAMP
1 TIMESTAMP TIMESTAMP
select * from t for system_time between '0-0-0' and current_timestamp(6);
a sys_trx_start sys_trx_end
2 TIMESTAMP TIMESTAMP
1 TIMESTAMP TIMESTAMP
set system_versioning_hide= NEVER;
select * from t;
a sys_trx_start sys_trx_end
2 TIMESTAMP TIMESTAMP
set system_versioning_hide= FULL;
create or replace table t (
x int,
st timestamp(6) as row start invisible,
en timestamp(6) as row end invisible,
period for system_time (st, en))
with system versioning;
show create table t;
Table Create Table
t CREATE TABLE `t` (
`x` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
insert into t values (2);
delete from t;
select * from t;
x
select * from t for system_time all;
x
a
2
1
select * from t for system_time from '0-0-0' to current_timestamp(6);
a
2
1
select * from t for system_time between '0-0-0' and current_timestamp(6);
a
2
1
drop table t;
set system_versioning_hide= IMPLICIT;