Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions dev/reference/mysql-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ TiDB supports both the MySQL wire protocol and the majority of its syntax. This

Currently TiDB Server advertises itself as MySQL 5.7 and works with most MySQL database tools such as PHPMyAdmin, Navicat, MySQL Workbench, mysqldump, and mydumper/myloader.

However, TiDB does not support some of MySQL features or behaves differently from MySQL because these features cannot be easily implemented in a distributed system. For some MySQL syntax, TiDB can parse but does not process it. For example, `Engine` in the `CREATE TABLE` statement can be parsed but is ignored.

> **Note:**
>
> This page refers to general differences between MySQL and TiDB. Please also see the dedicated pages for [Security](/reference/security/compatibility.md) and [Transaction Model](/reference/transactions/transaction-model.md) compatibility.
Expand All @@ -23,7 +25,7 @@ Currently TiDB Server advertises itself as MySQL 5.7 and works with most MySQL d
+ `FOREIGN KEY` constraints
+ `FULLTEXT` functions and indexes
+ `SPATIAL` functions and indexes
+ Character sets other than `utf8mb4`
+ Character sets other than `utf8mb4` and `utf8`
+ Collations other than `BINARY`
+ Add primary key
+ Drop primary key
Expand Down Expand Up @@ -95,7 +97,7 @@ In TiDB DDL does not block reads or writes to tables while in operation. However
+ Alter Database
- Only supports changing the `CHARACTER SET` attribute from `utf8` to `utf8mb4`.
+ `LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}`: the syntax is supported, but is not applicable to TiDB. All DDL changes that are supported do not lock the table.
+ `ALGORITHM [=] {DEFAULT|INSTANT|INPLACE|COPY}`: the syntax for `ALGORITHM=INSTANT` and `ALGORITHM=INPLACE` is fully supported, but will work differently than MySQL since some operations that are `INPLACE` in MySQL are `INSTANT` in TiDB. The syntax `ALGORITHM=COPY` is not applicable to TIDB and returns a warning.
+ `ALGORITHM [=] {DEFAULT|INSTANT|INPLACE|COPY}`: the syntax for `ALGORITHM=INSTANT` and `ALGORITHM=INPLACE` is fully supported, but it works differently from MySQL because some operations that are `INPLACE` in MySQL are `INSTANT` in TiDB. The syntax `ALGORITHM=COPY` is not applicable to TIDB and returns a warning.

For more information, see [Online Schema Changes](/key-features.md#online-schema-changes).

Expand Down
8 changes: 4 additions & 4 deletions v3.0/reference/mysql-compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
title: Compatibility with MySQL
summary: Learn about the compatibility of TiDB with MySQL, and the unsupported and different features.
category: reference
aliases: ['/docs/sql/mysql-compatibility/']
---

# Compatibility with MySQL
Expand All @@ -11,6 +10,8 @@ TiDB supports both the MySQL wire protocol and the majority of its syntax. This

Currently TiDB Server advertises itself as MySQL 5.7 and works with most MySQL database tools such as PHPMyAdmin, Navicat, MySQL Workbench, mysqldump, and mydumper/myloader.

However, TiDB does not support some of MySQL features or behaves differently from MySQL because these features cannot be easily implemented in a distributed system. For some MySQL syntax, TiDB can parse but does not process it. For example, `Engine` in the `CREATE TABLE` statement can be parsed but is ignored.

> **Note:**
>
> This page refers to general differences between MySQL and TiDB. Please also see the dedicated pages for [Security](/reference/security/compatibility.md) and [Transaction Model](/reference/transactions/transaction-model.md) compatibility.
Expand All @@ -24,7 +25,7 @@ Currently TiDB Server advertises itself as MySQL 5.7 and works with most MySQL d
+ `FOREIGN KEY` constraints
+ `FULLTEXT` functions and indexes
+ `SPATIAL` functions and indexes
+ Character sets other than `utf8mb4`
+ Character sets other than `utf8mb4` and `utf8`
+ Collations other than `BINARY`
+ Add primary key
+ Drop primary key
Expand All @@ -37,7 +38,6 @@ Currently TiDB Server advertises itself as MySQL 5.7 and works with most MySQL d
+ `CREATE TABLE tblName AS SELECT stmt` syntax
+ `CREATE TEMPORARY TABLE` syntax
+ `XA` syntax (TiDB uses a two-phase commit internally, but this is not exposed via an SQL interface)
+ `LOCK TABLE` syntax (TiDB uses `tidb_snapshot` to [produce backups](/reference/tools/mydumper.md))
+ `CHECK TABLE` syntax
+ `CHECKSUM TABLE` syntax
+ `GET_LOCK` and `RELEASE_LOCK` functions
Expand Down Expand Up @@ -97,7 +97,7 @@ In TiDB DDL does not block reads or writes to tables while in operation. However
+ Alter Database
- Only supports changing the `CHARACTER SET` attribute from `utf8` to `utf8mb4`.
+ `LOCK [=] {DEFAULT|NONE|SHARED|EXCLUSIVE}`: the syntax is supported, but is not applicable to TiDB. All DDL changes that are supported do not lock the table.
+ `ALGORITHM [=] {DEFAULT|INSTANT|INPLACE|COPY}`: the syntax for `ALGORITHM=INSTANT` and `ALGORITHM=INPLACE` is fully supported, but will work differently than MySQL since some operations that are `INPLACE` in MySQL are `INSTANT` in TiDB. The syntax `ALGORITHM=COPY` is not applicable to TIDB and returns a warning.
+ `ALGORITHM [=] {DEFAULT|INSTANT|INPLACE|COPY}`: the syntax for `ALGORITHM=INSTANT` and `ALGORITHM=INPLACE` is fully supported, but it works differently from MySQL because some operations that are `INPLACE` in MySQL are `INSTANT` in TiDB. The syntax `ALGORITHM=COPY` is not applicable to TIDB and returns a warning.

For more information, see [Online Schema Changes](/key-features.md#online-schema-changes).

Expand Down