pingcap / pingcap/docs

ALTER TABLE t ADD PARTITION needs 'PARTITIONS n' for KEY and HASH partitioning, just a number is not parsed.

Open
#17,835 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
617
Forks
724
Avg merge
2d 10h
Merged PRs (30d)
223

Description

Change Request

Please answer the following questions before submitting your issue. Thanks!

  1. Describe what you find is inappropriate or missing in the existing docs.
    In https://docs.pingcap.com/tidb/stable/partitioned-table it says:
Increase the number of partitions using the `ALTER TABLE <table name> ADD PARTITION <number of partitions to increase by | (additional partition definitions)>` statement.

But it needs to be

Increase the number of partitions using the `ALTER TABLE <table name> ADD PARTITION {PARTITIONS <number of partitions to increase by> | (<additional partition definitions>)}` statement.

I.e. ALTER TABLE t ADD PARTITION 2 is not valid syntax, while ALTER TABLE t ADD PARTITION PARTITIONS 2 is.

  1. Describe your suggestion or addition.

  2. Provide some reference materials (such as documents and websites) if you could.
    https://docs.pingcap.com/tidb/stable/partitioned-table
    https://dev.mysql.com/doc/refman/8.0/en/partitioning-management-hash-key.html

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open the stable/partitioned-table documentation page and compare its ALTER TABLE ... ADD PARTITION syntax with the MySQL partitioning reference linked in the issue. Update the statement to show PARTITIONS before the count for KEY and HASH partitioning, then verify that the examples distinguish this form from additional partition definitions.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, sql
Domain
databases, documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.