Skip to content

Commit

Permalink
Merge branch 'master' into compact-check
Browse files Browse the repository at this point in the history
  • Loading branch information
SpadeA-Tang authored Jul 5, 2023
2 parents c64fbd7 + fd88afe commit aabd43e
Show file tree
Hide file tree
Showing 80 changed files with 2,054 additions and 389 deletions.
1 change: 1 addition & 0 deletions .github/workflows/dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- ".github/**"
branches:
- master
- release-7.2
- release-7.1
- release-7.0
- release-6.6
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Currently, we maintain the following versions of TiDB documentation in different
| Branch name | TiDB docs version |
| :---------|:----------|
| [`master`](https://github.com/pingcap/docs/tree/master) | The latest development version |
| [`release-7.2`](https://github.com/pingcap/docs/tree/release-7.2) | 7.2 Development Milestone Release |
| [`release-7.1`](https://github.com/pingcap/docs/tree/release-7.1) | 7.1 LTS (Long-Term Support) version |
| [`release-7.0`](https://github.com/pingcap/docs/tree/release-7.0) | 7.0 Development Milestone Release |
| [`release-6.6`](https://github.com/pingcap/docs/tree/release-6.6) | 6.6 Development Milestone Release |
Expand Down
12 changes: 10 additions & 2 deletions TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
- [Docs Home](https://docs.pingcap.com/)
- About TiDB
- [TiDB Introduction](/overview.md)
- [TiDB 7.1 Release Notes](/releases/release-7.1.0.md)
- [TiDB 7.2 Release Notes](/releases/release-7.2.0.md)
- [Features](/basic-features.md)
- [MySQL Compatibility](/mysql-compatibility.md)
- [TiDB Limitations](/tidb-limitations.md)
Expand Down Expand Up @@ -116,6 +116,7 @@
- Migrate
- [Overview](/migration-overview.md)
- [Migration Tools](/migration-tools.md)
- [Import Best Practices](/tidb-lightning/data-import-best-practices.md)
- Migration Scenarios
- [Migrate from Aurora](/migrate-aurora-to-tidb.md)
- [Migrate MySQL of Small Datasets](/migrate-small-mysql-to-tidb.md)
Expand Down Expand Up @@ -552,7 +553,9 @@
- [TiCDC CSV Protocol](/ticdc/ticdc-csv.md)
- [TiCDC Open API v2](/ticdc/ticdc-open-api-v2.md)
- [TiCDC Open API v1](/ticdc/ticdc-open-api.md)
- [Guide for Developing a Storage Sink Consumer](/ticdc/ticdc-storage-consumer-dev-guide.md)
- TiCDC Data Consumption
- [TiCDC Row Data Checksum Verification Based on Avro](/ticdc/ticdc-avro-checksum-verification.md)
- [Guide for Developing a Storage Sink Consumer](/ticdc/ticdc-storage-consumer-dev-guide.md)
- [Compatibility](/ticdc/ticdc-compatibility.md)
- [Troubleshoot](/ticdc/troubleshoot-ticdc.md)
- [FAQs](/ticdc/ticdc-faq.md)
Expand Down Expand Up @@ -694,6 +697,7 @@
- [`BATCH`](/sql-statements/sql-statement-batch.md)
- [`BEGIN`](/sql-statements/sql-statement-begin.md)
- [`CALIBRATE RESOURCE`](/sql-statements/sql-statement-calibrate-resource.md)
- [`CANCEL IMPORT JOB`](/sql-statements/sql-statement-cancel-import-job.md)
- [`CHANGE COLUMN`](/sql-statements/sql-statement-change-column.md)
- [`COMMIT`](/sql-statements/sql-statement-commit.md)
- [`CHANGE DRAINER`](/sql-statements/sql-statement-change-drainer.md)
Expand Down Expand Up @@ -737,6 +741,7 @@
- [`FLUSH TABLES`](/sql-statements/sql-statement-flush-tables.md)
- [`GRANT <privileges>`](/sql-statements/sql-statement-grant-privileges.md)
- [`GRANT <role>`](/sql-statements/sql-statement-grant-role.md)
- [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md)
- [`INSERT`](/sql-statements/sql-statement-insert.md)
- [`KILL [TIDB]`](/sql-statements/sql-statement-kill.md)
- [`LOAD DATA`](/sql-statements/sql-statement-load-data.md)
Expand Down Expand Up @@ -783,6 +788,7 @@
- [`SHOW ERRORS`](/sql-statements/sql-statement-show-errors.md)
- [`SHOW [FULL] FIELDS FROM`](/sql-statements/sql-statement-show-fields-from.md)
- [`SHOW GRANTS`](/sql-statements/sql-statement-show-grants.md)
- [`SHOW IMPORT JOB`](/sql-statements/sql-statement-show-import-job.md)
- [`SHOW INDEX [FROM|IN]`](/sql-statements/sql-statement-show-index.md)
- [`SHOW INDEXES [FROM|IN]`](/sql-statements/sql-statement-show-indexes.md)
- [`SHOW KEYS [FROM|IN]`](/sql-statements/sql-statement-show-keys.md)
Expand Down Expand Up @@ -981,6 +987,8 @@
- [Release Timeline](/releases/release-timeline.md)
- [TiDB Versioning](/releases/versioning.md)
- [TiDB Installation Packages](/binary-package.md)
- v7.2
- [7.2.0-DMR](/releases/release-7.2.0.md)
- v7.1
- [7.1.0](/releases/release-7.1.0.md)
- v7.0
Expand Down
379 changes: 192 additions & 187 deletions basic-features.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion br/backup-and-restore-storages.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ This section provides some URI examples by using `external` as the `host` parame
**Back up snapshot data to Amazon S3**

```shell
./br restore full -u "${PD_IP}:2379" \
./br backup full -u "${PD_IP}:2379" \
--storage "s3://external/backup-20220915?access-key=${access-key}&secret-access-key=${secret-access-key}"
```

Expand Down
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 @@ With PITR, you can satisfy the preceding requirements.

## Deploy the TiDB cluster and BR

To use PITR, you need to deploy a TiDB cluster >= v6.2.0 and update BR to the same version as the TiDB cluster. This document uses v7.1.0 as an example.
To use PITR, you need to deploy a TiDB cluster >= v6.2.0 and update BR to the same version as the TiDB cluster. This document uses v7.2.0 as an example.

The following table shows the recommended hardware resources for using PITR in a TiDB cluster.

Expand All @@ -44,13 +44,13 @@ Install or upgrade BR using TiUP:
- Install:

```shell
tiup install br:v7.1.0
tiup install br:v7.2.0
```

- Upgrade:

```shell
tiup update br:v7.1.0
tiup update br:v7.2.0
```

## Configure backup storage (Amazon S3)
Expand Down
2 changes: 1 addition & 1 deletion command-line-flags-for-tidb-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ When you start the TiDB cluster, you can use command-line options or environment

## `--proxy-protocol-fallbackable`

- Controls whether to enable PROXY protocol fallback mode. When this parameter is set to `true`, TiDB accepts PROXY client connections and client connections without any PROXY protocol header. By default, TiDB only accepts client connections with a PROXY protocol header.
- Controls whether to enable PROXY protocol fallback mode. When this parameter is set to `true`, TiDB accepts client connections that belong to `--proxy-protocol-networks` without using the PROXY protocol specification or without sending a PROXY protocol header. By default, TiDB only accepts client connections that belong to `--proxy-protocol-networks` and send a PROXY protocol header.
- Default value: `false`

## `--proxy-protocol-networks`
Expand Down
9 changes: 9 additions & 0 deletions constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ Query OK, 1 row affected (0.03 sec)

## CHECK

> **Note:**
>
> The `CHECK` constraint feature is disabled by default. To enable it, you need to set the [`tidb_enable_check_constraint`](/system-variables.md#tidb_enable_check_constraint-new-in-v720) variable to `ON`.
A `CHECK` constraint restricts the values of a column in a table to meet your specified conditions. When the `CHECK` constraint is added to a table, TiDB checks whether the constraint is satisfied during the insertion or updates of data into the table. If the constraint is not met, an error is returned.

The syntax for the `CHECK` constraint in TiDB is the same as that in MySQL:
Expand Down Expand Up @@ -129,6 +133,11 @@ In addition to specifying `[NOT] ENFORCED` when adding the constraint, you can a
ALTER TABLE t ALTER CONSTRAINT c1 NOT ENFORCED;
```

### MySQL compatibility

- It is not supported to add a `CHECK` constraint while adding a column (for example, `ALTER TABLE t ADD COLUMN a CHECK(a > 0)`). In this case, only the column is added successfully, and TiDB ignores the `CHECK` constraint without reporting any error.
- It is not supported to use `ALTER TABLE t CHANGE a b int CHECK(b > 0)` to add a `CHECK` constraint. When this statement is executed, TiDB reports an error.

## UNIQUE KEY

Unique constraints mean that all non-null values in a unique index and a primary key column are unique.
Expand Down
2 changes: 1 addition & 1 deletion develop/dev-guide-aws-appflow-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,5 +244,5 @@ test> SELECT * FROM sf_account;

- If anything goes wrong, you can navigate to the [CloudWatch](https://console.aws.amazon.com/cloudwatch/home) page on the AWS Management Console to get logs.
- The steps in this document are based on [Building custom connectors using the Amazon AppFlow Custom Connector SDK](https://aws.amazon.com/blogs/compute/building-custom-connectors-using-the-amazon-appflow-custom-connector-sdk/).
- [TiDB Serverless](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-serverless-beta) is **NOT** a production environment.
- [TiDB Serverless](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-serverless) is **NOT** a production environment.
- To prevent excessive length, the examples in this document only show the `Insert` strategy, but `Update` and `Upsert` strategies are also tested and can be used.
4 changes: 2 additions & 2 deletions develop/dev-guide-build-cluster-in-cloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ This document walks you through the quickest way to get started with TiDB Cloud.

> **Note:**
>
> For [TiDB Serverless clusters](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-serverless-beta), when you connect to your cluster, you must include the prefix for your cluster in the user name and wrap the name with quotation marks. For more information, see [User name prefix](https://docs.pingcap.com/tidbcloud/select-cluster-tier#user-name-prefix).
> For [TiDB Serverless clusters](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-serverless), when you connect to your cluster, you must include the prefix for your cluster in the user name and wrap the name with quotation marks. For more information, see [User name prefix](https://docs.pingcap.com/tidbcloud/select-cluster-tier#user-name-prefix).
</CustomContent>

<CustomContent platform="tidb-cloud">

> **Note:**
>
> For [TiDB Serverless clusters](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-serverless-beta), when you connect to your cluster, you must include the prefix for your cluster in the user name and wrap the name with quotation marks. For more information, see [User name prefix](/tidb-cloud/select-cluster-tier.md#user-name-prefix).
> For [TiDB Serverless clusters](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-serverless), when you connect to your cluster, you must include the prefix for your cluster in the user name and wrap the name with quotation marks. For more information, see [User name prefix](/tidb-cloud/select-cluster-tier.md#user-name-prefix).
</CustomContent>

Expand Down
4 changes: 2 additions & 2 deletions develop/dev-guide-third-party-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ If you encounter problems when connecting to TiDB using the tools listed in this
<tr>
<td rowspan="4">Python</td>
<td><a href="https://pypi.org/project/Django/" target="_blank" referrerpolicy="no-referrer-when-downgrade">Django</a></td>
<td>v4.0.5</td>
<td>Compatible</td>
<td>v4.1</td>
<td>Full</td>
<td><a href="https://github.com/pingcap/django-tidb" target="_blank" referrerpolicy="no-referrer-when-downgrade">django-tidb</a></td>
<td>N/A</td>
</tr>
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 @@ -390,7 +390,7 @@ All operations above performed on the cluster machine use the SSH client embedde

Then you can use the `--native-ssh` command-line flag to enable the system-native command-line tool:

- Deploy a cluster: `tiup dm deploy <cluster-name> <version> <topo> --native-ssh`. Fill in the name of your cluster for `<cluster-name>`, the DM version to be deployed (such as `v7.1.0`) for `<version>` , and the topology file name for `<topo>`.
- Deploy a cluster: `tiup dm deploy <cluster-name> <version> <topo> --native-ssh`. Fill in the name of your cluster for `<cluster-name>`, the DM version to be deployed (such as `v7.2.0`) for `<version>` , and the topology file name for `<topo>`.
- Start a cluster: `tiup dm start <cluster-name> --native-ssh`.
- Upgrade a cluster: `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 @@ -74,7 +74,7 @@ To run a TiDB server, use the following command:
{{< copyable "shell-regular" >}}

```bash
wget https://download.pingcap.org/tidb-community-server-v7.1.0-linux-amd64.tar.gz
wget https://download.pingcap.org/tidb-community-server-v7.2.0-linux-amd64.tar.gz
tar -xzvf tidb-latest-linux-amd64.tar.gz
mv tidb-latest-linux-amd64/bin/tidb-server ./
./tidb-server
Expand Down
42 changes: 37 additions & 5 deletions error-codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,23 +364,55 @@ TiDB is compatible with the error codes in MySQL, and in most cases returns the

* Error Number: 8156

The file path of the `LOAD DATA` statement cannot be empty. You need to set the correct path before importing. See [`LOAD DATA`](/sql-statements/sql-statement-load-data.md).
The provided path cannot be empty. You need to set a correct path before the import.

* Error Number: 8157

The provided file format is unsupported. For the supported formats, see [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md#format).

* Error Number: 8158

The S3 or GCS path is invalid. See [external storage](/br/backup-and-restore-storages.md) to set a valid path.
The provided path is invalid. Refer to the specific error message for actions. For Amazon S3 or GCS path settings, see [External storage](/br/backup-and-restore-storages.md#uri-format).

* Error Number: 8159

TiDB cannot access the S3 or GCS path provided in the `LOAD DATA` statement. Make sure that the S3 or GCS bucket exists, and that you have used the correct access key and secret access key to let TiDB access the bucket.
TiDB cannot access the provided Amazon S3 or GCS path. Make sure that the specified S3 or GCS bucket exists and that you have provided the correct Access Key and Secret Access Key for TiDB to access the corresponding bucket.

* Error Number: 8160

`LOAD DATA` fails to read the data file. Refer to the specific error message for action.
Failed to read the data files. Refer to the specific error message for actions.

* Error Number: 8162

There is an error in the `LOAD DATA` statement. See [`LOAD DATA`](/sql-statements/sql-statement-load-data.md) for supported features.
There is an error in the statement. Refer to the specific error message for actions.

* Error Number: 8163

The provided option is unknown. For supported options, see [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md#parameter-description).

* Error Number: 8164

The provided option value is invalid. For valid values, see [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md#parameter-description).

* Error Number: 8165

Duplicate options are specified. Each option can only be specified once.

* Error Number: 8166

Certain options can only be used in specific conditions. Refer to the specific error message for actions. For supported options, see [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md#parameter-description).

* Error Number: 8170

The specified job does not exist.

* Error Number: 8171

The current operation cannot be performed for the current job status. Refer to the specific error message for actions.

* Error Number: 8173

When executing `IMPORT INTO`, TiDB checks the current environment, such as checking if the downstream table is empty. Refer to the specific error message for actions.

* Error Number: 8200

Expand Down
16 changes: 8 additions & 8 deletions hardware-and-software-requirements.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ As an open-source distributed SQL database with high performance, TiDB can be de
| <ul><li>Red Hat Enterprise Linux 7.3 or a later 7.x version</li><li>CentOS 7.3 or a later 7.x version</li></ul> | <ul><li>x86_64</li><li>ARM 64</li></ul> |
| Amazon Linux 2 | <ul><li>x86_64</li><li>ARM 64</li></ul> |
| Kylin Euler V10 SP1/SP2 | <ul><li>x86_64</li><li>ARM 64</li></ul> |
| UOS V20 | <ul><li>x86_64</li><li>ARM 64</li></ul> |
| UOS V20 | <ul><li>x86_64</li><li>ARM 64</li></ul> |
| openEuler 22.03 LTS SP1 | x86_64 |
| macOS Catalina or later | <ul><li>x86_64</li><li>ARM 64</li></ul> |
| Oracle Enterprise Linux 7.3 or a later 7.x version | x86_64 |
| Ubuntu LTS 18.04 or later | x86_64 |
| macOS 12 (Monterey) or later | <ul><li>x86_64</li><li>ARM 64</li></ul> |
| Oracle Enterprise Linux 7.3 or a later 7.x version | x86_64 |
| Ubuntu LTS 18.04 or later | x86_64 |
| CentOS 8 Stream | <ul><li>x86_64</li><li>ARM 64</li></ul> |
| Debian 9 (Stretch) or later | x86_64 |
| Fedora 35 or later | x86_64 |
| openSUSE Leap later than v15.3 (not including Tumbleweed) | x86_64 |
| SUSE Linux Enterprise Server 15 | x86_64 |
| Debian 9 (Stretch) or later | x86_64 |
| Fedora 35 or later | x86_64 |
| openSUSE Leap later than v15.3 (not including Tumbleweed) | x86_64 |
| SUSE Linux Enterprise Server 15 | x86_64 |

> **Note:**
>
Expand Down
2 changes: 1 addition & 1 deletion information-schema/information-schema-resource-groups.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ summary: Learn the `RESOURCE_GROUPS` information_schema table.

> **Note:**
>
> This feature is not available on [TiDB Serverless clusters](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-serverless-beta).
> This feature is not available on [TiDB Serverless clusters](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-serverless).
</CustomContent>

Expand Down
4 changes: 2 additions & 2 deletions information-schema/information-schema-slow-query.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ The `SLOW_QUERY` table provides the slow query information of the current node,

> **Note:**
>
> The `SLOW_QUERY` table is unavailable for [TiDB Serverless clusters](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-serverless-beta).
> The `SLOW_QUERY` table is unavailable for [TiDB Serverless clusters](https://docs.pingcap.com/tidbcloud/select-cluster-tier#tidb-serverless).
</CustomContent>

<CustomContent platform="tidb">
Expand Down
2 changes: 1 addition & 1 deletion information-schema/information-schema-tidb-servers-info.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ The output is as follows:
PORT: 4000
STATUS_PORT: 10080
LEASE: 45s
VERSION: 5.7.25-TiDB-v7.1.0
VERSION: 5.7.25-TiDB-v7.2.0
GIT_HASH: 827d8ff2d22ac4c93ae1b841b79d468211e1d393
BINLOG_STATUS: Off
LABELS:
Expand Down
5 changes: 1 addition & 4 deletions migrate-large-mysql-to-tidb.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ summary: Learn how to migrate MySQL of large datasets to TiDB.

When the data volume to be migrated is small, you can easily [use DM to migrate data](/migrate-small-mysql-to-tidb.md), both for full migration and incremental replication. However, because DM imports data at a slow speed (30~50 GiB/h), when the data volume is large, the migration might take a long time. "Large datasets" in this document usually mean data around one TiB or more.

This document describes how to migrate large datasets from MySQL to TiDB. The whole migration has two processes:

1. *Full migration*. Use Dumpling and TiDB Lightning to perform the full migration. TiDB Lightning's **local backend** mode can import data at a speed of up to 500 GiB/h.
2. *Incremental replication*. After the full migration is completed, you can replicate the incremental data using DM.
This document describes how to perform the full migration using Dumpling and TiDB Lightning. TiDB Lightning [Physical Import Mode](/tidb-lightning/tidb-lightning-physical-import-mode.md) can import data at a speed of up to 500 GiB/h. Note that this speed is affected by various factors such as hardware configuration, table schema, and the number of indexes. After the full migration is completed, you can replicate the incremental data using DM.

## Prerequisites

Expand Down
1 change: 1 addition & 0 deletions mysql-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,6 @@ Currently, the `help_topic` is NULL.
- `expr_pushdown_blacklist`: the blocklist for expression pushdown
- `opt_rule_blacklist`: the blocklist for logical optimization rules
- `table_cache_meta`: the metadata of cached tables
- `tidb_import_jobs`: the job information of [`IMPORT INTO`](/sql-statements/sql-statement-import-into.md)

</CustomContent>
2 changes: 1 addition & 1 deletion pd-control.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ To obtain `pd-ctl` of the latest version, download the TiDB server installation

> **Note:**
>
> `{version}` in the link indicates the version number of TiDB. For example, the download link for `v7.1.0` in the `amd64` architecture is `https://download.pingcap.org/tidb-community-server-v7.1.0-linux-amd64.tar.gz`.
> `{version}` in the link indicates the version number of TiDB. For example, the download link for `v7.2.0` in the `amd64` architecture is `https://download.pingcap.org/tidb-community-server-v7.2.0-linux-amd64.tar.gz`.
### Compile from source code

Expand Down
2 changes: 1 addition & 1 deletion post-installation-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The following information indicates successful login:
```sql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.25-TiDB-v7.1.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible
Server version: 5.7.25-TiDB-v7.2.0 TiDB Server (Apache License 2.0) Community Edition, MySQL 5.7 compatible
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
Expand Down
Loading

0 comments on commit aabd43e

Please sign in to comment.