Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into 6.3-RN
Browse files Browse the repository at this point in the history
  • Loading branch information
shichun-0415 committed Sep 13, 2022
2 parents be2aacd + 198d385 commit db54fa2
Show file tree
Hide file tree
Showing 18 changed files with 842 additions and 296 deletions.
11 changes: 8 additions & 3 deletions TOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
- Cloud Native Development Environment
- [Gitpod](/develop/dev-guide-playground-gitpod.md)
- Third-party Support
- [Third-Party Libraries Support](/develop/dev-guide-third-party-support.md)
- [Third-Party Tools Supported by TiDB](/develop/dev-guide-third-party-support.md)
- [Integrate with ProxySQL](/develop/dev-guide-proxysql-integration.md)
- Deploy
- [Software and Hardware Requirements](/hardware-and-software-requirements.md)
Expand Down Expand Up @@ -359,18 +359,24 @@
- Key Features
- [Checkpoints](/tidb-lightning/tidb-lightning-checkpoints.md)
- [Table Filter](/table-filter.md)
- [CSV Support](/tidb-lightning/migrate-from-csv-using-tidb-lightning.md)
- [Backends](/tidb-lightning/tidb-lightning-backends.md)
- [Physical Import Mode](/tidb-lightning/tidb-lightning-physical-import-mode.md)
- [Physical Import Mode Usage](/tidb-lightning/tidb-lightning-physical-import-mode-usage.md)
- [Import Data in Parallel](/tidb-lightning/tidb-lightning-distributed-import.md)
- [Error Resolution](/tidb-lightning/tidb-lightning-error-resolution.md)
- [Web Interface](/tidb-lightning/tidb-lightning-web-interface.md)
- Data Sources
- [Data Match Rules](/tidb-lightning/tidb-lightning-data-source.md)
- [CSV](/tidb-lightning/tidb-lightning-data-source.md#csv)
- [SQL](/tidb-lightning/tidb-lightning-data-source.md#sql)
- [Parquet](/tidb-lightning/tidb-lightning-data-source.md#parquet)
- [Customized File](/tidb-lightning/tidb-lightning-data-source.md#match-customized-files)
- [Tutorial](/get-started-with-tidb-lightning.md)
- [Deploy](/tidb-lightning/deploy-tidb-lightning.md)
- [Configure](/tidb-lightning/tidb-lightning-configuration.md)
- [Monitor](/tidb-lightning/monitor-tidb-lightning.md)
- [FAQ](/tidb-lightning/tidb-lightning-faq.md)
- [Troubleshooting](/tidb-lightning/troubleshoot-tidb-lightning.md)
- [Glossary](/tidb-lightning/tidb-lightning-glossary.md)
- TiDB Data Migration
- [About TiDB Data Migration](/dm/dm-overview.md)
Expand Down Expand Up @@ -518,7 +524,6 @@
- [Integrate TiDB with Confluent and Snowflake](/ticdc/integrate-confluent-using-ticdc.md)
- [FAQs](/ticdc/ticdc-faq.md)
- [Glossary](/ticdc/ticdc-glossary.md)
- [Dumpling](/dumpling-overview.md)
- sync-diff-inspector
- [Overview](/sync-diff-inspector/sync-diff-inspector-overview.md)
- [Data Check for Tables with Different Schema/Table Names](/sync-diff-inspector/route-diff.md)
Expand Down
2 changes: 1 addition & 1 deletion best-practices/pd-scheduling-best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ The processes of scale-down and failure recovery are basically the same. `replic

Region merge refers to the process of merging adjacent small regions. It serves to avoid unnecessary resource consumption by a large number of small or even empty regions after data deletion. Region merge is performed by `mergeChecker`, which processes in a similar way to `replicaChecker`: PD continuously scans all regions in the background, and generates an operator when contiguous small regions are found.

Specifically, when a newly split Region exists for more than the value of [`split-merge-interval`](/pd-configuration-file.md#split-merge-interval) (`1h` by default), if any of the following conditions occurs, this Region triggers the Region merge scheduling:
Specifically, when a newly split Region exists for more than the value of [`split-merge-interval`](/pd-configuration-file.md#split-merge-interval) (`1h` by default), if the following conditions occur at the same time, this Region triggers the Region merge scheduling:

- The size of this Region is smaller than the value of the [`max-merge-region-size`](/pd-configuration-file.md#max-merge-region-size) (20 MiB by default)

Expand Down
94 changes: 51 additions & 43 deletions binary-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,69 +7,77 @@ summary: Learn about TiDB installation packages and the specific components incl

Before [deploying TiUP offline](/production-deployment-using-tiup.md#deploy-tiup-offline), you need to download the binary packages of TiDB at the [official download page](https://en.pingcap.com/download/).

TiDB provides two binary packages: `TiDB-community-server` and `TiDB-community-toolkit`
TiDB binary packages are available in amd64 and arm64 architectures. In either architecture, TiDB provides two binary packages: `TiDB-community-server` and `TiDB-community-toolkit`.

The `TiDB-community-server` package contains the following contents.

| Content | Change history |
|---|---|
| tidb-{version}-linux-amd64.tar.gz | |
| tikv-{version}-linux-amd64.tar.gz | |
| tiflash-{version}-linux-amd64.tar.gz | |
| pd-{version}-linux-amd64.tar.gz | |
| ctl-{version}-linux-amd64.tar.gz | |
| grafana-{version}-linux-amd64.tar.gz | |
| alertmanager-{version}-linux-amd64.tar.gz | |
| blackbox_exporter-{version}-linux-amd64.tar.gz | |
| prometheus-{version}-linux-amd64.tar.gz | |
| node_exporter-{version}-linux-amd64.tar.gz | |
| tiup-linux-amd64.tar.gz | |
| tiup-{version}-linux-amd64.tar.gz | |
| tidb-{version}-linux-{arch}.tar.gz | |
| tikv-{version}-linux-{arch}.tar.gz | |
| tiflash-{version}-linux-{arch}.tar.gz | |
| pd-{version}-linux-{arch}.tar.gz | |
| ctl-{version}-linux-{arch}.tar.gz | |
| grafana-{version}-linux-{arch}.tar.gz | |
| alertmanager-{version}-linux-{arch}.tar.gz | |
| blackbox_exporter-{version}-linux-{arch}.tar.gz | |
| prometheus-{version}-linux-{arch}.tar.gz | |
| node_exporter-{version}-linux-{arch}.tar.gz | |
| tiup-linux-{arch}.tar.gz | |
| tiup-{version}-linux-{arch}.tar.gz | |
| local_install.sh | |
| cluster-{version}-linux-amd64.tar.gz | |
| insight-{version}-linux-amd64.tar.gz | |
| diag-{version}-linux-amd64.tar.gz | New in v6.0.0 |
| influxdb-{version}-linux-amd64.tar.gz | |
| playground-{version}-linux-amd64.tar.gz | |
| cluster-{version}-linux-{arch}.tar.gz | |
| insight-{version}-linux-{arch}.tar.gz | |
| diag-{version}-linux-{arch}.tar.gz | New in v6.0.0 |
| influxdb-{version}-linux-{arch}.tar.gz | |
| playground-{version}-linux-{arch}.tar.gz | |

> **Note**:
>
> `{version}` depends on the version of the component or server you are installing. `{arch}` depends on the architecture of the system, which can be `amd64` or `arm64`.
The `TiDB-community-toolkit` package contains the following contents.

| Content | Change history |
|---|---|
| tikv-importer-{version}-linux-amd64.tar.gz | |
| pd-recover-{version}-linux-amd64.tar.gz | |
| tikv-importer-{version}-linux-{arch}.tar.gz | |
| pd-recover-{version}-linux-{arch}.tar.gz | |
| etcdctl | New in v6.0.0 |
| tiup-linux-amd64.tar.gz | |
| tiup-{version}-linux-amd64.tar.gz | |
| tidb-lightning-{version}-linux-amd64.tar.gz | |
| tiup-linux-{arch}.tar.gz | |
| tiup-{version}-linux-{arch}.tar.gz | |
| tidb-lightning-{version}-linux-{arch}.tar.gz | |
| tidb-lightning-ctl | |
| dumpling-{version}-linux-amd64.tar.gz | |
| cdc-{version}-linux-amd64.tar.gz | |
| dm-{version}-linux-amd64.tar.gz | |
| dm-worker-{version}-linux-amd64.tar.gz | |
| dm-master-{version}-linux-amd64.tar.gz | |
| dmctl-{version}-linux-amd64.tar.gz | |
| br-{version}-linux-amd64.tar.gz | |
| dumpling-{version}-linux-{arch}.tar.gz | |
| cdc-{version}-linux-{arch}.tar.gz | |
| dm-{version}-linux-{arch}.tar.gz | |
| dm-worker-{version}-linux-{arch}.tar.gz | |
| dm-master-{version}-linux-{arch}.tar.gz | |
| dmctl-{version}-linux-{arch}.tar.gz | |
| br-{version}-linux-{arch}.tar.gz | |
| spark-{version}-any-any.tar.gz | |
| tispark-{version}-any-any.tar.gz | |
| package-{version}-linux-amd64.tar.gz | |
| bench-{version}-linux-amd64.tar.gz | |
| errdoc-{version}-linux-amd64.tar.gz | |
| dba-{version}-linux-amd64.tar.gz | |
| PCC-{version}-linux-amd64.tar.gz | |
| pump-{version}-linux-amd64.tar.gz | |
| drainer-{version}-linux-amd64.tar.gz | |
| package-{version}-linux-{arch}.tar.gz | |
| bench-{version}-linux-{arch}.tar.gz | |
| errdoc-{version}-linux-{arch}.tar.gz | |
| dba-{version}-linux-{arch}.tar.gz | |
| PCC-{version}-linux-{arch}.tar.gz | |
| pump-{version}-linux-{arch}.tar.gz | |
| drainer-{version}-linux-{arch}.tar.gz | |
| binlogctl | New in v6.0.0 |
| sync_diff_inspector | |
| reparo | |
| arbiter | |
| mydumper | New in v6.0.0 |
| server-{version}-linux-amd64.tar.gz | New in v6.2.0 |
| grafana-{version}-linux-amd64.tar.gz | New in v6.2.0 |
| alertmanager-{version}-linux-amd64.tar.gz | New in v6.2.0 |
| prometheus-{version}-linux-amd64.tar.gz | New in v6.2.0 |
| blackbox_exporter-{version}-linux-amd64.tar.gz | New in v6.2.0 |
| node_exporter-{version}-linux-amd64.tar.gz | New in v6.2.0 |
| server-{version}-linux-{arch}.tar.gz | New in v6.2.0 |
| grafana-{version}-linux-{arch}.tar.gz | New in v6.2.0 |
| alertmanager-{version}-linux-{arch}.tar.gz | New in v6.2.0 |
| prometheus-{version}-linux-{arch}.tar.gz | New in v6.2.0 |
| blackbox_exporter-{version}-linux-{arch}.tar.gz | New in v6.2.0 |
| node_exporter-{version}-linux-{arch}.tar.gz | New in v6.2.0 |

> **Note**:
>
> `{version}` depends on the version of the tool you are installing. `{arch}` depends on the architecture of the system, which can be `amd64` or `arm64`.
## See also

Expand Down
142 changes: 119 additions & 23 deletions character-set-and-collation.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,31 @@ SELECT 'A' = 'a';
```

```sql
mysql> SELECT 'A' = 'a';
SELECT 'A' = 'a';
```

```sql
+-----------+
| 'A' = 'a' |
+-----------+
| 0 |
+-----------+
1 row in set (0.00 sec)
```

mysql> SET NAMES utf8mb4 COLLATE utf8mb4_general_ci;
```sql
SET NAMES utf8mb4 COLLATE utf8mb4_general_ci;
```

```sql
Query OK, 0 rows affected (0.00 sec)
```

```sql
SELECT 'A' = 'a';
```

mysql> SELECT 'A' = 'a';
```sql
+-----------+
| 'A' = 'a' |
+-----------+
Expand Down Expand Up @@ -73,18 +86,26 @@ SHOW CHARACTER SET;
TiDB supports the following collations:

```sql
mysql> show collation;
+-------------+---------+------+---------+----------+---------+
| Collation | Charset | Id | Default | Compiled | Sortlen |
+-------------+---------+------+---------+----------+---------+
| utf8mb4_bin | utf8mb4 | 46 | Yes | Yes | 1 |
| latin1_bin | latin1 | 47 | Yes | Yes | 1 |
| binary | binary | 63 | Yes | Yes | 1 |
| ascii_bin | ascii | 65 | Yes | Yes | 1 |
| utf8_bin | utf8 | 83 | Yes | Yes | 1 |
| gbk_bin | gbk | 87 | Yes | Yes | 1 |
+-------------+---------+------+---------+----------+---------+
6 rows in set (0.00 sec)
SHOW COLLATION;
```

```sql
+--------------------+---------+------+---------+----------+---------+
| Collation | Charset | Id | Default | Compiled | Sortlen |
+--------------------+---------+------+---------+----------+---------+
| ascii_bin | ascii | 65 | Yes | Yes | 1 |
| binary | binary | 63 | Yes | Yes | 1 |
| gbk_bin | gbk | 87 | | Yes | 1 |
| gbk_chinese_ci | gbk | 28 | Yes | Yes | 1 |
| latin1_bin | latin1 | 47 | Yes | Yes | 1 |
| utf8_bin | utf8 | 83 | Yes | Yes | 1 |
| utf8_general_ci | utf8 | 33 | | Yes | 1 |
| utf8_unicode_ci | utf8 | 192 | | Yes | 1 |
| utf8mb4_bin | utf8mb4 | 46 | Yes | Yes | 1 |
| utf8mb4_general_ci | utf8mb4 | 45 | | Yes | 1 |
| utf8mb4_unicode_ci | utf8mb4 | 224 | | Yes | 1 |
+--------------------+---------+------+---------+----------+---------+
11 rows in set (0.00 sec)
```

> **Warning:**
Expand Down Expand Up @@ -125,25 +146,54 @@ By default, TiDB provides the same 3-byte limit on `utf8` to ensure that data cr
The following demonstrates the default behavior when inserting a 4-byte emoji character into a table. The `INSERT` statement fails for the `utf8` character set, but succeeds for `utf8mb4`:

```sql
mysql> CREATE TABLE utf8_test (
CREATE TABLE utf8_test (
-> c char(1) NOT NULL
-> ) CHARACTER SET utf8;
```

```sql
Query OK, 0 rows affected (0.09 sec)
```

mysql> CREATE TABLE utf8m4_test (
```sql
CREATE TABLE utf8m4_test (
-> c char(1) NOT NULL
-> ) CHARACTER SET utf8mb4;
```

```sql
Query OK, 0 rows affected (0.09 sec)
```

```sql
INSERT INTO utf8_test VALUES ('😉');
```

mysql> INSERT INTO utf8_test VALUES ('😉');
```sql
ERROR 1366 (HY000): incorrect utf8 value f09f9889(😉) for column c
mysql> INSERT INTO utf8m4_test VALUES ('😉');
```

```sql
INSERT INTO utf8m4_test VALUES ('😉');
```

```sql
Query OK, 1 row affected (0.02 sec)
```

```sql
SELECT char_length(c), length(c), c FROM utf8_test;
```

mysql> SELECT char_length(c), length(c), c FROM utf8_test;
```sql
Empty set (0.01 sec)
```

```sql
SELECT char_length(c), length(c), c FROM utf8m4_test;
```

mysql> SELECT char_length(c), length(c), c FROM utf8m4_test;
```sql
+----------------+-----------+------+
| char_length(c) | length(c) | c |
+----------------+-----------+------+
Expand Down Expand Up @@ -400,15 +450,40 @@ Before v4.0, you can specify most of the MySQL collations in TiDB, and these col

```sql
CREATE TABLE t(a varchar(20) charset utf8mb4 collate utf8mb4_general_ci PRIMARY KEY);
```

```sql
Query OK, 0 rows affected
```

```sql
INSERT INTO t VALUES ('A');
```

```sql
Query OK, 1 row affected
```

```sql
INSERT INTO t VALUES ('a');
Query OK, 1 row affected # In TiDB, it is successfully executed. In MySQL, because utf8mb4_general_ci is case-insensitive, the `Duplicate entry 'a'` error is reported.
```

```sql
Query OK, 1 row affected
```

In TiDB, the preceding statement is successfully executed. In MySQL, because `utf8mb4_general_ci` is case-insensitive, the `Duplicate entry 'a'` error is reported.

```sql
INSERT INTO t1 VALUES ('a ');
Query OK, 1 row affected # In TiDB, it is successfully executed. In MySQL, because comparison is performed after the spaces are filled in, the `Duplicate entry 'a '` error is returned.
```

```sql
Query OK, 1 row affected
```

In TiDB, the preceding statement is successfully executed. In MySQL, because comparison is performed after the spaces are filled in, the `Duplicate entry 'a '` error is returned.

### New framework for collations

Since TiDB v4.0, a complete framework for collations is introduced.
Expand Down Expand Up @@ -448,12 +523,33 @@ When one of `utf8_general_ci`, `utf8mb4_general_ci`, `utf8_unicode_ci`, `utf8mb4
```sql
CREATE TABLE t(a varchar(20) charset utf8mb4 collate utf8mb4_general_ci PRIMARY KEY);
```
```sql
Query OK, 0 rows affected (0.00 sec)
```
```sql
INSERT INTO t VALUES ('A');
```
```sql
Query OK, 1 row affected (0.00 sec)
```
```sql
INSERT INTO t VALUES ('a');
```
```sql
ERROR 1062 (23000): Duplicate entry 'a' for key 'PRIMARY' # TiDB is compatible with the case-insensitive collation of MySQL.
```
```sql
INSERT INTO t VALUES ('a ');
```
```sql
ERROR 1062 (23000): Duplicate entry 'a ' for key 'PRIMARY' # TiDB modifies the `PADDING` behavior to be compatible with MySQL.
```
Expand Down
2 changes: 1 addition & 1 deletion clustered-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ For statements that do not explicitly specify the keyword `CLUSTERED`/`NONCLUSTE
- `ON` indicates that primary keys are created as clustered indexes by default.
- `INT_ONLY` indicates that the behavior is controlled by the configuration item `alter-primary-key`. If `alter-primary-key` is set to `true`, primary keys are created as non-clustered indexes by default. If it is set to `false`, only the primary keys which consist of an integer column are created as clustered indexes.

The default value of `@@global.tidb_enable_clustered_index` is `INT_ONLY`.
The default value of `@@global.tidb_enable_clustered_index` is `ON`.

### Add or drop clustered indexes

Expand Down
Loading

0 comments on commit db54fa2

Please sign in to comment.