Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
hfxsd committed May 28, 2024
2 parents dd83a95 + 9f37e6d commit 7011274
Show file tree
Hide file tree
Showing 63 changed files with 792 additions and 350 deletions.
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ By default, **CHOOSE MASTER ONLY** so your changes will be applied to the next T
For details, see [tips for choosing the affected versions (in Chinese)](https://github.com/pingcap/docs-cn/blob/master/CONTRIBUTING.md#版本选择指南).

- [ ] master (the latest development version)
- [ ] v8.2 (TiDB 8.2 versions)
- [ ] v8.1 (TiDB 8.1 versions)
- [ ] v8.0 (TiDB 8.0 versions)
- [ ] v7.6 (TiDB 7.6 versions)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
| 文档仓库 branch | 对应 TiDB 文档版本 |
|:---------|:----------|
| [`master`](https://github.com/pingcap/docs-cn/tree/master) | dev 最新开发版 |
| [`release-8.1`](https://github.com/pingcap/docs-cn/tree/release-8.1) | 8.1 长期支持版 (LTS) |
| [`release-8.0`](https://github.com/pingcap/docs-cn/tree/release-8.0) | 8.0 开发里程碑版 (DMR) |
| [`release-7.6`](https://github.com/pingcap/docs-cn/tree/release-7.6) | 7.6 开发里程碑版 (DMR) |
| [`release-7.5`](https://github.com/pingcap/docs-cn/tree/release-7.5) | 7.5 长期支持版 (LTS) |
Expand Down
4 changes: 3 additions & 1 deletion TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- [文档中心](https://docs.pingcap.com/zh)
- 关于 TiDB
- [TiDB 简介](/overview.md)
- [TiDB 8.0 Release Notes](/releases/release-8.0.0.md)
- [TiDB 8.1 Release Notes](/releases/release-8.1.0.md)
- [功能概览](/basic-features.md)
- [与 MySQL 的兼容性](/mysql-compatibility.md)
- [使用限制](/tidb-limitations.md)
Expand Down Expand Up @@ -1051,6 +1051,8 @@
- [版本发布时间线](/releases/release-timeline.md)
- [TiDB 版本规则](/releases/versioning.md)
- [TiDB 离线包](/binary-package.md)
- v8.1
- [8.1.0](/releases/release-8.1.0.md)
- v8.0
- [8.0.0-DMR](/releases/release-8.0.0.md)
- v7.6
Expand Down
2 changes: 1 addition & 1 deletion auto-increment.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ CREATE TABLE t(a int AUTO_INCREMENT key) AUTO_ID_CACHE 1;
> - 对于 v6.4.0 及以上版本,由于引入了中心化的分配服务,`AUTO_INCREMENT` 值的修改只是在 TiDB 服务进程中的一个内存操作,相较于之前版本更快。
> -`AUTO_ID_CACHE` 设置为 `0` 表示 TiDB 使用默认的缓存大小 `30000`
使用 MySQL 兼容模式后,能保证 ID **唯一****单调递增**,行为几乎跟 MySQL 完全一致。即使跨 TiDB 实例访问,ID 也不会出现回退。只有当中心化服务的“主” TiDB 实例异常崩溃时,才有可能造成少量 ID 不连续。这是因为主备切换时,“备” 节点需要丢弃一部分之前的“主” 节点可能已经分配的 ID,以保证 ID 不出现重复。
使用 MySQL 兼容模式后,能保证 ID **唯一****单调递增**,行为几乎跟 MySQL 完全一致。即使跨 TiDB 实例访问,ID 也不会出现回退。只有在中心化分配自增 ID 服务的“主” TiDB 实例进程退出(如该 TiDB 节点重启)或者异常崩溃时,才有可能造成部分 ID 不连续。这是因为主备切换时,“备” 节点需要丢弃一部分之前的“主” 节点已经分配的 ID,以保证 ID 不出现重复。

## 使用限制

Expand Down
422 changes: 210 additions & 212 deletions basic-features.md

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions br/backup-and-restore-use-cases.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ aliases: ['/docs-cn/dev/br/backup-and-restore-use-cases/','/docs-cn/dev/referenc

## 部署 TiDB 集群和 br 命令行工具

使用 PITR 功能,需要部署 v6.2.0 或以上版本的 TiDB 集群,并且更新 br 命令行工具到与 TiDB 集群相同的版本,本文假设使用的是 v8.0.0 版本。
使用 PITR 功能,需要部署 v6.2.0 或以上版本的 TiDB 集群,并且更新 br 命令行工具到与 TiDB 集群相同的版本,本文假设使用的是 v8.1.0 版本。

下表介绍了在 TiDB 集群中使用日志备份功能的推荐配置。

Expand All @@ -44,13 +44,13 @@ aliases: ['/docs-cn/dev/br/backup-and-restore-use-cases/','/docs-cn/dev/referenc
- 安装:

```shell
tiup install br:v8.0.0
tiup install br:v8.1.0
```

- 升级:

```shell
tiup update br:v8.0.0
tiup update br:v8.1.0
```

## 配置备份存储 (Amazon S3)
Expand Down
2 changes: 1 addition & 1 deletion br/br-snapshot-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ tiup br restore full \

- 统计信息表 (`mysql.stat_*`) (但可以恢复统计信息,详细参考[备份统计信息](/br/br-snapshot-manual.md#备份统计信息))
- 系统变量表 (`mysql.tidb``mysql.global_variables`)
- [其他系统表](https://github.com/pingcap/tidb/blob/master/br/pkg/restore/systable_restore.go#L31)
- [其他系统表](https://github.com/pingcap/tidb/blob/master/br/pkg/restore/snap_client/systable_restore.go#L31)

```
+-----------------------------------------------------+
Expand Down
2 changes: 1 addition & 1 deletion ddl-introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ TiDB 采用在线异步变更的方式执行 DDL 语句,从而实现 DDL 语

- **物理 DDL 语句**:不但会修改变更对象的元数据,同时也修改变更对象所存储的用户数据。例如,为表创建索引,不仅需要变更表的定义,同时也需要做一次全表扫描以构建新增加的索引。

在 TiDB 中,物理 DDL 被称为 Reorg DDL(Reorg 即 Reorganization)。目前物理 DDL 只包含 `ADD INDEX` 以及有损列类型变更(例如从 `INT` 转成 `CHAR` 类型)这两种类型。物理 DDL 的特点是执行时间较长,且执行时间与表的数据量、机器配置以及业务负载有关。
在 TiDB 中,物理 DDL 被称为 Reorg DDL(Reorg 即 Reorganization)。目前物理 DDL 只包含 `ADD INDEX` 以及有损列类型变更(例如从 `INT` 转成 `CHAR` 类型)这两种类型。物理 DDL 的特点是执行时间较长,且执行时间与表的数据量、机器配置以及业务负载有关。

执行物理 DDL 会影响业务负载,具体有两个方面。一方面需要从 TiKV 中读取数据并写入新数据,因此会消耗 TiKV 的 CPU 及 I/O 资源。另一方面,**DDL Owner 所在的 TiDB 节点**或者**被 TiDB 分布式执行框架调度而执行 `ADD INDEX` 任务的 TiDB 节点**需要进行相应的计算,因此会消耗 TiDB 的 CPU 资源。

Expand Down
4 changes: 2 additions & 2 deletions develop/dev-guide-sample-application-nodejs-mysql2.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ npm install mysql2 dotenv --save

1. 在 TiDB Cloud 的 [**Clusters**](https://tidbcloud.com/console/clusters) 页面中,选择你的 TiDB Dedicated 集群,进入集群的 **Overview** 页面。
2. 点击右上角的 **Connect** 按钮,将会出现连接对话框。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download TiDB cluster CA** 下载 TiDB Cloud 提供的 CA 证书。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download CA cert** 下载 TiDB Cloud 提供的 CA 证书。

更多配置细节,可参考 [TiDB Dedicated 标准连接教程(英文)](https://docs.pingcap.com/tidbcloud/connect-via-standard-connection)。

Expand Down Expand Up @@ -180,7 +180,7 @@ npm run start
如果连接成功,你的终端将会输出所连接集群的版本信息:

```
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v8.0.0)
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v8.1.0)
⏳ Loading sample game data...
✅ Loaded sample game data.

Expand Down
4 changes: 2 additions & 2 deletions develop/dev-guide-sample-application-nodejs-mysqljs.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ npm install mysql dotenv --save

1. 在 TiDB Cloud 的 [**Clusters**](https://tidbcloud.com/console/clusters) 页面中,选择你的 TiDB Dedicated 集群,进入集群的 **Overview** 页面。
2. 点击右上角的 **Connect** 按钮,将会出现连接对话框。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download TiDB cluster CA** 下载 TiDB Cloud 提供的 CA 证书。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download CA cert** 下载 TiDB Cloud 提供的 CA 证书。

更多配置细节,可参考 [TiDB Dedicated 标准连接教程(英文)](https://docs.pingcap.com/tidbcloud/connect-via-standard-connection)。

Expand Down Expand Up @@ -180,7 +180,7 @@ npm run start
如果连接成功,你的终端将会输出所连接集群的版本信息:

```
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v8.0.0)
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v8.1.0)
⏳ Loading sample game data...
✅ Loaded sample game data.

Expand Down
2 changes: 1 addition & 1 deletion develop/dev-guide-sample-application-nodejs-prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ npm install prisma typescript ts-node @types/node --save-dev

1. 在 TiDB Cloud 的 [**Clusters**](https://tidbcloud.com/console/clusters) 页面中,选择你的 TiDB Dedicated 集群,进入集群的 **Overview** 页面。
2. 点击右上角的 **Connect** 按钮,将会出现连接对话框。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download TiDB cluster CA** 下载 TiDB Cloud 提供的 CA 证书。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download CA cert** 下载 TiDB Cloud 提供的 CA 证书。

更多配置细节,可参考 [TiDB Dedicated 标准连接教程(英文)](https://docs.pingcap.com/tidbcloud/connect-via-standard-connection)。

Expand Down
2 changes: 1 addition & 1 deletion develop/dev-guide-sample-application-nodejs-sequelize.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ npm install

1. 在 TiDB Cloud 的 [**Clusters**](https://tidbcloud.com/console/clusters) 页面中,选择你的 TiDB Dedicated 集群,进入集群的 **Overview** 页面。
2. 点击右上角的 **Connect** 按钮,将会出现连接对话框。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download TiDB cluster CA** 下载 TiDB Cloud 提供的 CA 证书。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download CA cert** 下载 TiDB Cloud 提供的 CA 证书。

更多配置细节,可参考 [TiDB Dedicated 标准连接教程(英文)](https://docs.pingcap.com/tidbcloud/connect-via-standard-connection)。

Expand Down
4 changes: 2 additions & 2 deletions develop/dev-guide-sample-application-nodejs-typeorm.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ npm install @types/node ts-node typescript --save-dev

1. 在 TiDB Cloud 的 [**Clusters**](https://tidbcloud.com/console/clusters) 页面中,选择你的 TiDB Dedicated 集群,进入集群的 **Overview** 页面。
2. 点击右上角的 **Connect** 按钮,将会出现连接对话框。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download TiDB cluster CA** 下载 TiDB Cloud 提供的 CA 证书。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download CA cert** 下载 TiDB Cloud 提供的 CA 证书。

更多配置细节,可参考 [TiDB Dedicated 标准连接教程(英文)](https://docs.pingcap.com/tidbcloud/connect-via-standard-connection)。

Expand Down Expand Up @@ -227,7 +227,7 @@ npm start
如果连接成功,你的终端将会输出所连接集群的版本信息:

```
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v8.0.0)
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v8.1.0)
🆕 Created a new player with ID 2.
ℹ️ Got Player 2: Player { id: 2, coins: 100, goods: 100 }
🔢 Added 50 coins and 50 goods to player 2, now player 2 has 100 coins and 150 goods.
Expand Down
2 changes: 1 addition & 1 deletion develop/dev-guide-sample-application-python-django.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ pip install -r requirements.txt

2. 点击右上角的 **Connect** 按钮,将会出现连接对话框。

3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download TiDB cluster CA** 下载 TiDB Cloud 提供的 CA 证书。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download CA cert** 下载 TiDB Cloud 提供的 CA 证书。

更多配置细节,可参考 [TiDB Dedicated 标准连接教程(英文)](https://docs.pingcap.com/tidbcloud/connect-via-standard-connection)。

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pip install -r requirements.txt

2. 点击右上角的 **Connect** 按钮,将会出现连接对话框。

3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download TiDB cluster CA** 下载 TiDB Cloud 提供的 CA 证书。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download CA cert** 下载 TiDB Cloud 提供的 CA 证书。

更多配置细节,可参考 [TiDB Dedicated 标准连接教程(英文)](https://docs.pingcap.com/tidbcloud/connect-via-standard-connection)。

Expand Down
2 changes: 1 addition & 1 deletion develop/dev-guide-sample-application-python-mysqlclient.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pip install -r requirements.txt

2. 点击右上角的 **Connect** 按钮,将会出现连接对话框。

3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download TiDB cluster CA** 下载 TiDB Cloud 提供的 CA 证书。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download CA cert** 下载 TiDB Cloud 提供的 CA 证书。

更多配置细节,可参考 [TiDB Dedicated 标准连接教程(英文)](https://docs.pingcap.com/tidbcloud/connect-via-standard-connection)。

Expand Down
2 changes: 1 addition & 1 deletion develop/dev-guide-sample-application-python-peewee.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ peewee 是一个支持多种数据库的 ORM 库。它是对数据库的高层

2. 点击右上角的 **Connect** 按钮,将会出现连接对话框。

3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download TiDB cluster CA** 下载 TiDB Cloud 提供的 CA 证书。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download CA cert** 下载 TiDB Cloud 提供的 CA 证书。

更多配置细节,可参考 [TiDB Dedicated 标准连接教程(英文)](https://docs.pingcap.com/tidbcloud/connect-via-standard-connection)。

Expand Down
2 changes: 1 addition & 1 deletion develop/dev-guide-sample-application-python-pymysql.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pip install -r requirements.txt

2. 点击右上角的 **Connect** 按钮,将会出现连接对话框。

3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download TiDB cluster CA** 下载 TiDB Cloud 提供的 CA 证书。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download CA cert** 下载 TiDB Cloud 提供的 CA 证书。

更多配置细节,可参考 [TiDB Dedicated 标准连接教程(英文)](https://docs.pingcap.com/tidbcloud/connect-via-standard-connection)。

Expand Down
2 changes: 1 addition & 1 deletion develop/dev-guide-sample-application-python-sqlalchemy.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ SQLAlchemy 是一个支持多种数据库的 ORM 库。它是对数据库的高

2. 点击右上角的 **Connect** 按钮,将会出现连接对话框。

3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download TiDB cluster CA** 下载 TiDB Cloud 提供的 CA 证书。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download CA cert** 下载 TiDB Cloud 提供的 CA 证书。

更多配置细节,可参考 [TiDB Dedicated 标准连接教程(英文)](https://docs.pingcap.com/tidbcloud/connect-via-standard-connection)。

Expand Down
4 changes: 2 additions & 2 deletions develop/dev-guide-sample-application-ruby-mysql2.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ bundle add mysql2 dotenv

2. 点击右上角的 **Connect** 按钮,将会弹出连接对话框。

3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download TiDB cluster CA** 下载 TiDB Cloud 提供的 CA 证书。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download CA cert** 下载 TiDB Cloud 提供的 CA 证书。

更多配置细节,可参考 [TiDB Dedicated 标准连接教程(英文)](https://docs.pingcap.com/tidbcloud/connect-via-standard-connection)。

Expand Down Expand Up @@ -180,7 +180,7 @@ ruby app.rb
如果连接成功,你的终端将会输出所连接集群的版本信息:

```
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v8.0.0)
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v8.1.0)
⏳ Loading sample game data...
✅ Loaded sample game data.

Expand Down
4 changes: 2 additions & 2 deletions develop/dev-guide-sample-application-ruby-rails.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ bundle add mysql2 dotenv

2. 点击右上角的 **Connect** 按钮,将会弹出连接对话框。

3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download TiDB cluster CA** 下载 TiDB Cloud 提供的 CA 证书。
3. 在对话框中点击 **Allow Access from Anywhere**,然后点击 **Download CA cert** 下载 TiDB Cloud 提供的 CA 证书。

更多配置细节,可参考 [TiDB Dedicated 标准连接教程(英文)](https://docs.pingcap.com/tidbcloud/connect-via-standard-connection)。

Expand Down Expand Up @@ -173,7 +173,7 @@ bundle add mysql2 dotenv
如果连接成功,你的终端将会输出所连接集群的版本信息:

```
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v8.0.0)
🔌 Connected to TiDB cluster! (TiDB version: 8.0.11-TiDB-v8.1.0)
⏳ Loading sample game data...
✅ Loaded sample game data.

Expand Down
2 changes: 1 addition & 1 deletion dm/maintain-dm-using-tiup.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ tiup dmctl --master-addr master1:8261 operate-source create /tmp/source1.yml

此时可以通过命令行参数 `--native-ssh` 启用系统自带命令行:

- 部署集群:`tiup dm deploy <cluster-name> <version> <topo> --native-ssh`,其中 `<cluster-name>` 为集群名称,`<version>` 为 DM 集群版本(例如 `v8.0.0`),`<topo>` 为拓扑文件路径
- 部署集群:`tiup dm deploy <cluster-name> <version> <topo> --native-ssh`,其中 `<cluster-name>` 为集群名称,`<version>` 为 DM 集群版本(例如 `v8.1.0`),`<topo>` 为拓扑文件路径
- 启动集群:`tiup dm start <cluster-name> --native-ssh`
- 升级集群:`tiup dm upgrade ... --native-ssh`

Expand Down
2 changes: 1 addition & 1 deletion dm/quick-start-create-task.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ docker run --rm --name mysql-3307 -p 3307:3307 -e MYSQL_ALLOW_EMPTY_PASSWORD=tru
{{< copyable "shell-regular" >}}

```bash
wget https://download.pingcap.org/tidb-community-server-v8.0.0-linux-amd64.tar.gz
wget https://download.pingcap.org/tidb-community-server-v8.1.0-linux-amd64.tar.gz
tar -xzvf tidb-latest-linux-amd64.tar.gz
mv tidb-latest-linux-amd64/bin/tidb-server ./
./tidb-server -P 4000 --store mocktikv --log-file "./tidb.log" &
Expand Down
2 changes: 1 addition & 1 deletion faq/backup-and-restore-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ br restore full -f 'mysql.usertable' -s $external_storage_url --with-sys-table
- 统计信息表(`mysql.stat_*`)(但可以恢复统计信息,详细参考[备份统计信息](/br/br-snapshot-manual.md#备份统计信息))
- 系统变量表(`mysql.tidb``mysql.global_variables`
- [其他系统表](https://github.com/pingcap/tidb/blob/master/br/pkg/restore/systable_restore.go#L31)
- [其他系统表](https://github.com/pingcap/tidb/blob/master/br/pkg/restore/snap_client/systable_restore.go#L31)
### 恢复的时候,报错 `cannot file rewrite rule`,该如何处理?
Expand Down
2 changes: 1 addition & 1 deletion foreign-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ Create Table | CREATE TABLE `child` (
- [DM](/dm/dm-overview.md) 不兼容外键功能。DM 在同步数据到下游 TiDB 时,会显式关闭下游 TiDB 的 [`foreign_key_checks`](/system-variables.md#foreign_key_checks),所以由外键产生的级联操作不会从上游同步到下游,这会导致上下游数据不一致。
- [TiCDC](/ticdc/ticdc-overview.md) v6.6.0 兼容外键功能。旧版本的 TiCDC 在同步带外键的表时,可能会报错,建议使用 v6.6.0 之前版本 TiCDC 时先关闭下游 TiDB 集群的 `foreign_key_checks`
- [BR](/br/backup-and-restore-overview.md) v6.6.0 兼容外键功能。之前版本的 BR 在恢复带外键的表到 v6.6.0 及之后版本的集群时,可能会报错,建议先关闭下游 TiDB 集群的 `foreign_key_checks` 后再恢复集群。
- [TiDB Lightning](/tidb-lightning/tidb-lightning-overview.md) 导入数据到 TiDB 前,建议先关闭 TiDB 集群的 `foreign_key_checks`
- [TiDB Lightning](/tidb-lightning/tidb-lightning-overview.md) 导入数据到 TiDB 前,如果目标表使用了外键,建议先关闭 TiDB 集群的 `foreign_key_checks`。对于 v6.6.0 之前的版本,关闭该系统变量也不会生效,你需要为下游数据库用户添加 `REFERENCES` 权限,或者提前手动在下游数据库中创建好目标表,以确保顺利导入数据
- [Dumpling](/dumpling-overview.md) 兼容外键功能。
- [sync-diff-inspector](/sync-diff-inspector/sync-diff-inspector-overview.md) 在对比上下游数据时,如果上下游数据库的版本不一样,且下游 TiDB 中存在[不生效的外键](#tidb-版本间兼容性),则 sync-diff-inspector 可能会报上下游表结构不一致的错误。因为 TiDB v6.6.0 会对表结构中不生效的外键添加一条 `/* FOREIGN KEY INVALID */` 注释。

Expand Down
4 changes: 2 additions & 2 deletions functions-and-operators/set-operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ TiDB 支持使用括号修改集合运算的优先级,如同[四则运算](htt
1 rows in set (0.00 sec)
```

## `ORDER BY``Limit` 结合
## `ORDER BY``LIMIT` 结合

TiDB 支持单独为整个集合运算进行 [`ORDER BY`](/media/sqlgram/OrderByOptional.png) 或者 [`LIMIT`](/media/sqlgram/LimitClause.png)
TiDB 支持对整个集合运算的结果使用 `ORDER BY``LIMIT` 子句。这两个子句必须位于整个语句的末尾

```sql
(SELECT * FROM t1 UNION ALL SELECT * FROM t1 INTERSECT SELECT * FROM t2) ORDER BY a LIMIT 2;
Expand Down
2 changes: 1 addition & 1 deletion get-started-with-tidb-lightning.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ tiup install tidb-lightning
nohup tiup tidb-lightning -config tidb-lightning.toml > nohup.out &
```

### 第 5 步:检查数据
## 第 5 步:检查数据

导入完毕后,TiDB Lightning 会自动退出。若导入成功,日志的最后一行会显示 `tidb lightning exit`

Expand Down
Loading

0 comments on commit 7011274

Please sign in to comment.