mirror of
https://github.com/qgis/QGIS.git
synced 2025-07-14 00:04:06 -04:00
When adding logging via db manager to an existing layer, all the time_start of existing features are still null. When we modify one feature for the first time, the update trigger fires and insert a row for the past state of the feature. In turn, this fires the INSERT trigger for this row, and the execution goes inside the `if NEW.time_start is NULL`, which set the end timestamp to NULL, making the old row still visible in the _current view. In other word, the insert trigger makes the assumption that a null start timestamp means now, which is not true in the case described above. This commit fixes this assumption by initially setting it to `-infinity` for existing rows.