Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
Currently when there is no unit specifier in AS OF query like:
select * from t1 for system_time as of @p1; |
it will do some heuristics to detect whether it should treat @p1 is trx_id or timestamp.
Such semantic complexity should be removed in favour of default TIMESTAMP because:
1. rare practical use and doubtful advantage;
2. it conflicts with MDEV-16226.
Attachments
Issue Links
- blocks
-
MDEV-16226 TRX_ID-based System Versioning refactoring
-
- Stalled
-
- is blocked by
-
MDEV-15408 Confusing error message upon ER_VERS_FIELD_WRONG_TYPE while omitting UNSIGNED in BIGINT
-
- Closed
-
- relates to
-
MDEV-16094 Crash when using AS OF with a stored function
-
- Closed
-
-
MDEV-16100 FOR SYSTEM_TIME erroneously resolves string user variables as transaction IDs
-
- Closed
-
Changes from
MDEV-16100that added new methods in Type_handler are needed anyway, to disallow various non-relevant data types in FOR SYSTEM_TIME, such as GEOMETRY, ROW, ENUM/SET. And we'll be adding new data types soon (e.g. INET4, INET6, UUID), which are also non-relevant in timestamp context.I think it's fine to make undefined units to resolve to timestamp by default.
But in this case the following expressions in FOR SYSTEM_TIME should probably return an error when used without explicit unit:
because the user is obviously doing something wrong. These expressions can very rarely represent a valid TIMESTAMP.
So they should require either an explicit unit, or even an explicit CAST.