[MDEV-22588] Document WITHOUT OVERLAPS feature and clean up Application-time Periods section Created: 2020-05-16  Updated: 2020-05-16

Status: Open
Project: MariaDB Server
Component/s: Documentation
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Elena Stepanova Assignee: Ian Gilfillan
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates

 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 expression

    It 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.


Generated at Thu Feb 08 09:15:55 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.