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

Documentation does not mention TRUNCATE PARTITION syntax

    XMLWordPrintable

    Details

      Description

      KB pages:

      https://mariadb.com/kb/en/library/alter-table/
      https://mariadb.com/kb/en/library/partitioning-overview/

      do not mention truncating partitions or TRUNCATE PARTITION syntax, even though it surely works:

      C:\Program Files\MariaDB 10.3\bin>mysql -uroot -proot -P3316 test
      Welcome to the MariaDB monitor.  Commands end with ; or \g.
      Your MariaDB connection id is 9
      Server version: 10.3.7-MariaDB-log mariadb.org binary distribution
       
      Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
       
      Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
       
      MariaDB [test]> CREATE TABLE t1 (
          ->     id INT,
          ->     year_col INT
          -> )
          -> PARTITION BY RANGE (year_col) (
          ->     PARTITION p0 VALUES LESS THAN (1991),
          ->     PARTITION p1 VALUES LESS THAN (1995),
          ->     PARTITION p2 VALUES LESS THAN (1999),
          ->     PARTITION p3 VALUES LESS THAN (2003),
          ->     PARTITION p4 VALUES LESS THAN (2007)
          -> );
      Query OK, 0 rows affected (2.994 sec)
       
      MariaDB [test]> insert into t1 values (1, 1990), (2, 200), (3, 2001), (4, 2005);
      Query OK, 4 rows affected (0.158 sec)
      Records: 4  Duplicates: 0  Warnings: 0
       
      MariaDB [test]> select * from t1;
      +------+----------+
      | id   | year_col |
      +------+----------+
      |    1 |     1990 |
      |    2 |      200 |
      |    3 |     2001 |
      |    4 |     2005 |
      +------+----------+
      4 rows in set (0.001 sec)
      

      Please, fix this and provide examples of TRUNCATE PARTITION among other p[artition maintenance commands.

        Attachments

          Activity

            People

            Assignee:
            KennethDyer Kenneth Dyer
            Reporter:
            valerii Valerii Kravchuk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: