pingcap / pingcap/docs-cn

缺少 alter column 的描述

Open
#15,931 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1.8k
Forks
1.2k
Avg merge
1d 16h
Merged PRs (30d)
31

Description

Change Request

This repository is ONLY used to solve problems related to DOCS-CN.
For other issues (TiDB, TiKV, etc), please move to other repositories.

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

  1. Describe what you find is inappropriate or missing in the existing docs.

缺少 alter column 的描述,mysql 官方是有的
image

tidb 也是支持的

mysql> show create table t;
+-------+----------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                             |
+-------+----------------------------------------------------------------------------------------------------------+
| t     | CREATE TABLE `t` (
  `a` int(11) DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+----------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> alter table t alter column set default 2;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your TiDB version for the right syntax to use line 1 column 30 near "set default 2" 
mysql> alter table t alter column a set default 2;
Query OK, 0 rows affected (0.15 sec)

mysql> show create table t;
+-------+----------------------------------------------------------------------------------------------------------+
| Table | Create Table                                                                                             |
+-------+----------------------------------------------------------------------------------------------------------+
| t     | CREATE TABLE `t` (
  `a` int(11) DEFAULT '2'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+----------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> select tidb_version();
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                   |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v7.6.0-alpha-599-g24fcf71e7e-dirty
Edition: Community
Git Commit Hash: 24fcf71e7e3419ae5d6064ff2ba6df370fa70574
Git Branch: bdr-bwlist-2
UTC Build Time: 2023-12-27 07:25:23
GoVersion: go1.21.0
Race Enabled: false
Check Table Before Drop: false
Store: tikv |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
  1. Describe your suggestion or addition.

补充上

  1. Provide some reference materials (documents, websites, etc) if you could.

https://dev.mysql.com/doc/refman/8.0/en/alter-table.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

No target file is named. Search the docs-cn repository for the existing ALTER TABLE documentation, then compare its coverage with the MySQL ALTER TABLE reference linked in the issue. Add the missing Chinese description and example for ALTER TABLE ... ALTER COLUMN ... SET DEFAULT, and verify the documentation build or rendering.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, sql
Domain
databases, documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
Half a day
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.