[MDEV-17448] Support DATETIME(6) for ROW START, ROW END Created: 2018-10-14 Updated: 2023-02-11 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Versioned Tables |
| Affects Version/s: | 10.3 |
| Fix Version/s: | 10.4 |
| Type: | Bug | Priority: | Minor |
| Reporter: | Federico Razzoli | Assignee: | Aleksey Midenkov |
| Resolution: | Unresolved | Votes: | 3 |
| Labels: | system_versioned_tables | ||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
If I try to create a system-versioned table with ROW START and ROW END columns of type DATETIME(6), the table is created. This is different from what happens if I try, for example, VARCHAR, in which case I get a clear error message. But then, the table is unusable.
And the reason is easy to find out:
If DATETIME is not supposed to work, it shouldn't be allowed. |
| Comments |
| Comment by Aleksey Midenkov [ 2018-10-26 ] |
|
It is already disallowed in 10.3. But `DATETIME` is not prohibited by standard, so it should be supported in 10.4. |
| Comment by Alexander Barkov [ 2018-12-27 ] |
|
4.41.3 Properties of SQL-transactions says:
We use MariaDB's TIMESTAMP data type (which is timestamp with local time zone) as this implementation defined type.
It's not possible to restore the original TIMESTAMP value once it was converted to DATETIME, because the reverse conversion can already use a different @@time_zone value. For me it does not seem to be useful storing ROW START / ROW END data in DATETIME or DATE columns. We'll be adding TIMESTAMP WITH TIME ZONE soon. This new data type will support the full datetime range from '0001-01-01 00:00:00' to '9999-12-31 23:59:59' and will preserve both TIMESTAMP parts:
so round trip conversion TIMESTAMP -> TIMESTAMP WITH TIME ZONE -> TIMESTAMP will be non-lossy. |
| Comment by Aleksey Midenkov [ 2018-12-28 ] |
|
Possible solution for DATETIME row_start, row_end might be to store in UTC. System fields independent from time_zone can be an advantage for certain deployments. |
| Comment by Robert Palm [ 2023-01-10 ] |
|
Hi, I w'd love to see a time range extension. When is it going to happen? Thank you. |
| Comment by Rick James [ 2023-02-11 ] |
|
@Alexander – "TIMESTAMP data type (which is timestamp with local time zone)" – I thought that `TIMESTAMP` was stored in UTC, without any timezone. (When viewing (SELECTing) it, the current timezone is used to modify what you see.) That is, `TIMESTAMP` should be adequate, as is, for use in ROW_START, etc. |