MariaDB [test]> select *, row_start, row_end from t3 for system_time all;
|
+------+----------------------------+----------------------------+
|
| a | row_start | row_end |
|
+------+----------------------------+----------------------------+
|
| 1 | 2018-04-22 02:21:24.283521 | 2018-04-22 02:21:27.809661 |
|
| 2 | 2018-04-22 02:21:24.283521 | 2038-01-19 05:14:07.999999 |
|
+------+----------------------------+----------------------------+
|
2 rows in set (0.00 sec)
|
|
MariaDB [test]> truncate table t3;
|
Query OK, 0 rows affected (0.20 sec)
|
|
MariaDB [test]> select *, row_start, row_end from t3 for system_time all;
|
Empty set (0.00 sec)
|
TRUNCATE TABLE on a versioned table removes all table contents, including historical records. I can only assume it's expected behavior, I can't find it documented anywhere in the KB, and there is no MTR test for TRUNCATE – I found only one test which uses the command, partition.test, but it does not check the result of truncation, it only executes the statement as a regression test for a crash.
If it works as designed, please add a test and have it documented. If not, then please fix.