1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-21 21:22:27 +03:00
Commit Graph

22 Commits

Author SHA1 Message Date
7841a7eb09 Merge branch '10.3' into 10.4 2021-07-31 22:59:58 +02:00
1423cf5e3d fix MDEV-16026 MDEV-16481 embedded server results and rests 2021-07-29 17:16:52 +02:00
c6bff46958 MDEV-16026 MDEV-16481 refactor Sys_var_vers_asof
MDEV-16026: Forbid global system_versioning_asof in non-default time zone

* store `system_versioning_asof` in unix time;
* both session and global vars are processed in session timezone;
* setting `default` does not copy global variable anymore. Instead, it sets
  system_time to SYSTEM_TIME_UNSPECIFIED, which means that no 'AS OF' time
  is applied and `now()` can be assumed

As a regression, we cannot assign values below 1970 (UTC) anymore

MDEV-16481: set global system_versioning_asof=sf() crashes in specific case

* sys_vars.h: add `MYSQL_TIME` field to `set_var::save_result`
* sys_vars.ic: get rid of calling `var->value->get_date()` from
 `Sys_var_vers_asof::update()`
* versioning.sysvars: add test; remove double warning

refactor Sys_var_vers_asof

* inherit from sys_var rather than Sys_var_enum
* remove junk "DEFAULT" keyword. There is DEFAULT in SQL grammar for it.
* make all conversions in check() to avoid possible errors
* avoid double var->value evaluation, which could
  consequence in undefined behavior
2021-07-27 14:15:01 +03:00
329301d2e6 MDEV-23562 Assertion `time_type == MYSQL_TIMESTAMP_DATETIME' failed upon SELECT from versioned table
The code in vers_select_conds_t::init_from_sysvar() assumed that
the value of the system_versioning_asof is DATETIME.
But it also could be DATE after a query like this:
  SET system_versioning_asof = DATE(NOW());

Fixing Sys_var_vers_asof::update() to convert the value
of the assignment source to DATETIME if it returned DATE.

Now vers_select_conds_t::init_from_sysvar() always gets a DATETIME value.
2020-08-24 22:55:39 +04:00
f347b3e0e6 Merge 10.3 into 10.4 2020-07-02 07:39:33 +03:00
b633b6a9d8 MDEV-22906 Disallow system_versioning_asof in DML
system_versioning_asof does not influence on multi-delete,
multi-update, insert-select, replace-select.
2020-06-16 10:43:53 +03:00
57f7b4866f MDEV-16937 Strict SQL with system versioned tables causes issues (10.4)
Respect system fields in NO_ZERO_DATE mode.

This is the subject for refactoring in MDEV-19597

Conflict resolution from 7d5223310789f967106d86ce193ef31b315ecff0
2020-05-29 11:45:19 +03:00
19da9a51ae MDEV-16937 Strict SQL with system versioned tables causes issues
Respect system fields in NO_ZERO_DATE mode.

This is the subject for refactoring in MDEV-19597
2020-05-28 22:22:20 +03:00
b615d275b8 MDEV-17798 System variable system_versioning_asof accepts wrong values (10.4) 2020-02-02 17:13:58 +03:00
006f6f97b1 MDEV-17798 System variable system_versioning_asof accepts wrong values 2020-02-02 15:13:29 +03:00
4447a02cf1 MDEV-16991 Rounding vs truncation for TIME, DATETIME, TIMESTAMP 2018-11-26 08:10:47 +04:00
fddaaf7295 MDEV-15978 Add Feature_system_versioning status variable 2018-05-12 10:16:46 +02:00
e6a7457653 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
2018-01-09 14:12:41 +03:00
04451f0f8a MDEV-14765 Server crashes in Sys_var_vers_asof::update 2017-12-26 15:25:39 +03:00
ee68d019d1 SQL: removed VERS_HIDDEN_FLAG [closes #409] 2017-12-19 16:12:56 +03:00
f149013393 rename versioning_* variables 2017-12-14 11:31:44 +01:00
c9520cb0c4 SQL: sysvar versioning_asof_timestamp [fixes #292, #279] 2017-11-13 19:11:02 +03:00
d3d2ea9fd5 SQL, Parser: system_time logic and syntax fixes [closes #237] 2017-08-08 17:12:16 +03:00
72de7721b9 SQL: No implicit versioning when created from SELECT [closes #219] 2017-07-03 17:38:59 +03:00
44506f2669 SQL: vers_ sysvars renamed to versioning_ 2017-05-05 20:36:40 +03:00
9e9af76eaf SQL: vers_current_time refactoring [closes #117]
* session sysvars;
* moved value parsing to set variable phase;
* renamed 'temporal_current_timestamp' to 'vers_current_time'.
2017-05-05 20:36:34 +03:00
67cd92b6f4 SQL, IB: Copy history via CREATE .. SELECT [closes #157, #152] 2017-05-05 20:36:33 +03:00