It's somewhat misleading, because you've used '3' everywhere.
Please rewrite your tests (all of them, also tests below) to identify
every operation uniquely.
Nice idea, thanks!
I don't think IODKU is defined via MERGE. Unfortunately.
Yes, the idea behind these comments was to describe a certain statement through MERGE.
But now I see it confuses more. Thanks to you for that.
Here you do DELETE FOR PERIOD. But above you didn't do UPDATE FOR PERIOD.
Add also this: replace into t values(1, 6, '2003-01-01', '2003-02-01');
And tests for INSERT SELECT (also with IGNORE, REPLACE, ODKU) and for
LOAD DATA (also with IGNORE and REPLACE).
> +drop table t;
Now, about semantics. It is very arguable here. One options is to do,
literally, "insert, if fails delete/update the conflicting row". No
periods involved here. The other option is to use FOR PERIOD implicitly
for updates and deletes.
Sure, option two should be chosen. I rewrote the code
Also, added more tests: for double execution, auto_increment, insert..select and load data as well.
Check out branch bb-10.5-MDEV-17395-replace.
--