So far I couldn't find an answer in the KB to what DELETE HISTORY is meant to do if BEFORE SYSTEM_TIME specifies a value greater than ROW END of the active records.
It is not a trivial question, because unless it is defined by the standard (which I also can't find), there are different possible outcomes, each of which is logically justifiable:
- DELETE HISTORY doesn't touch active rows at all, regardless the ROW END (because it only affects historical records, and active ones are not that);
- DELETE HISTORY purges everything (because it affects all records with ROW END less than the specified SYSTEM_TIME, and it includes active rows);
- DELETE HISTORY drops the historical records and deletes previously active records (because it does DELETE, which for historical records means elimination, while for active records it means moving them to history).
Currently the server uses the last option, which seems the least obvious, although still explainable:
If it's intended, please document it. If it's not intended, please fix and then document the intended behavior.