Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
Description
MDEV-16978 extended functionality of application-time periods by introducing WITHOUT OVERLAPS clause in 10.5.3. The feature hasn't been documented in the KB, at least there is nothing about it in the Application-time Periods section, and the KB search only finds OVERLAPS as a GIS function.
While documenting it, please also check the existing contents of Application-time Periods. I've spotted a few irregularities, maybe there are more.
- parts for UPDATE and DELETE seem to be swapped. "Deletion" goes first, but it starts from "In addition to updates...", it is odd.
- there is an example in "Adding and Removing Time Periods" section which may cause confusion. It suggests creating a table as
CREATE TABLE test.t2 (
id INT PRIMARY KEY,
time_1 TIMESTAMP(6),
time_2 TIMESTAMP(6)
);
Â
ALTER TABLE test.t2 ADD PERIOD FOR time_period(time_1, time_2);
But then it doesn't say what can be further done with the table. It can indeed be created this way, but given that it has only one column which is a primary key, it cannot really have any meaningful contents. I think it can be confusing.
- "Deletion by Portion" has a great explanation of how deletion works. It would be good to add a similar one to "Updating by Portion", because it isn't quite the same, and probably even less obvious.
- Limitations for DELETE say
Multi-delete is now supported
Probably should be not supported (I think it isn't).
- Limitations for UPDATE say
Multi-delete is not supported
It probably doesn't belong there, as it's about DELETE.
- Limitations for UPDATE also say
Operation cannot modify the two temporal columns used by the time period
Operation cannot reference period values in the SET expressionIt seems to be the same; if it meant to be different, maybe it needs to be re-phrased.
- Both limitations sections say
The FROM...TO clause must be constant
This is a tricky part, I think it needs to be accompanied with examples (or possibly there are bugs in there, I can't say as it's unclear from the documentation).
E.g. this works:
MariaDB [test]> delete from t1 for portion of p from sysdate() to sysdate(); |
Query OK, 0 rows affected (0.001 sec) |
but this doesn't:
MariaDB [test]> update t1 for portion of p from sysdate() to sysdate() set a = 1; |
ERROR 1487 (HY000): Expression in FOR PORTION OF must be constant |
yet this does:
MariaDB [test]> update t1 for portion of p from curdate() to curdate() set a = 1; |
Query OK, 0 rows affected (0.001 sec) |
While CURDATE and SYSDATE indeed have different semantics, the former being "more constant" than the latter, it doesn't explain why SYSDATE works for DELETE, but not for UPDATE.