Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-15966

Behavior for TRUNCATE versioned table is not documented and not covered by tests

    XMLWordPrintable

    Details

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              serg Sergei Golubchik
              Reporter:
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.