[MDEV-17798] System variable system_versioning_asof accepts wrong values Created: 2018-11-22 Updated: 2020-02-03 Resolved: 2020-02-03 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Versioned Tables |
| Affects Version/s: | 10.3, 10.4 |
| Fix Version/s: | 10.3.23, 10.4.13 |
| Type: | Bug | Priority: | Major |
| Reporter: | Alexander Barkov | Assignee: | Aleksey Midenkov |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
It probably should reject values with zeros, or be even more strict: accept only values in the valid TIMESTAMP range. |
| Comments |
| Comment by Alexander Barkov [ 2018-12-27 ] | ||||||||||||||||||||||||
|
Alexey, I think that this patch is incomplete: It's not enough to add a test for TIME_NO_ZERO_IN_DATE|TIME_NO_ZERO_DATE. You can check it using either TIME_to_timestamp() or using this Timestamp constructor: Timestamp(THD *thd, const MYSQL_TIME *ltime, uint *error_code); | ||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2018-12-27 ] | ||||||||||||||||||||||||
|
serg, please verify that my understanding ^^^ is correct. | ||||||||||||||||||||||||
| Comment by Aleksey Midenkov [ 2018-12-27 ] | ||||||||||||||||||||||||
|
If we restrict `system_versioning_asof` to some range, that means we also must restrict `FOR SYSTEM_TIME` values in queries to that range. OTOH TIMESTAMP range will be expanded in `TIMESTAMP WITH TIME ZONE`. | ||||||||||||||||||||||||
| Comment by Alexander Barkov [ 2018-12-28 ] | ||||||||||||||||||||||||
|
I think the variable system_versioning_asof should be of the data type TIMESTAMP, not DATETIME, and therefore store the timestamp value in my_time_t format, and thus be in the supported TIMESTAMP range. Something like this:
We'll later change it to TIMESTAMP WITH TIME ZONE, when we add the latter. Note, this script:
returns
for both SELECT queries.
| ||||||||||||||||||||||||
| Comment by Robert Bindar [ 2019-12-13 ] | ||||||||||||||||||||||||
|
Hi midenok, are you still willing to work on this? There are 2 PRs open for this bug (1049 and 1048) that I'd very much like to see solved. |