Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update "Type system differences" for MySQL Compatibility #4115

Merged
merged 1 commit into from
Nov 2, 2020

Conversation

dveeden
Copy link
Contributor

@dveeden dveeden commented Oct 30, 2020

What is changed, added or deleted? (Required)

The "Type system differences" section was updated as it TiDB supports some of the types that were listed as unsupported.

TiDB:

mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.8
Edition: Community
Git Commit Hash: 66ac9fc31f1733e5eb8d11891ec1b38f9c422817
Git Branch: heads/refs/tags/v4.0.8
UTC Build Time: 2020-10-30 08:21:16
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)

mysql> CREATE TABLE t1 (id SERIAL, y SQL_TSI_YEAR, f FIXED(4,2));
Query OK, 0 rows affected (0.11 sec)

mysql> SHOW CREATE TABLE t1\G
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE `t1` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `y` year(4) DEFAULT NULL,
  `f` decimal(4,2) DEFAULT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
1 row in set (0.01 sec)

MySQL:

mysql> SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 8.0.20    |
+-----------+
1 row in set (0.00 sec)

mysql> CREATE TABLE t1 (id SERIAL, y SQL_TSI_YEAR, f FIXED(4,2));
Query OK, 0 rows affected (0.06 sec)

mysql> SHOW CREATE TABLE t1\G
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE `t1` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `y` year DEFAULT NULL,
  `f` decimal(4,2) DEFAULT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
1 row in set (0.00 sec)

Which TiDB version(s) do your changes apply to? (Required)

  • master (the latest development version)
  • v4.0 (TiDB 4.0 versions)
  • v3.1 (TiDB 3.1 versions)
  • v3.0 (TiDB 3.0 versions)
  • v2.1 (TiDB 2.1 versions)

What is the related PR or file link(s)?

  • This PR is translated from:
  • Other reference link(s):

Do your changes match any of the following descriptions?

  • Delete files
  • Change aliases
  • Have version specific changes
  • Might cause conflicts

TiDB:
```
mysql> SELECT tidb_version()\G
*************************** 1. row ***************************
tidb_version(): Release Version: v4.0.8
Edition: Community
Git Commit Hash: 66ac9fc31f1733e5eb8d11891ec1b38f9c422817
Git Branch: heads/refs/tags/v4.0.8
UTC Build Time: 2020-10-30 08:21:16
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
1 row in set (0.00 sec)

mysql> CREATE TABLE t1 (id SERIAL, y SQL_TSI_YEAR, f FIXED(4,2));
Query OK, 0 rows affected (0.11 sec)

mysql> SHOW CREATE TABLE t1\G
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE `t1` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `y` year(4) DEFAULT NULL,
  `f` decimal(4,2) DEFAULT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin
1 row in set (0.01 sec)
```

MySQL:
```
mysql> SELECT VERSION();
+-----------+
| VERSION() |
+-----------+
| 8.0.20    |
+-----------+
1 row in set (0.00 sec)

mysql> CREATE TABLE t1 (id SERIAL, y SQL_TSI_YEAR, f FIXED(4,2));
Query OK, 0 rows affected (0.06 sec)

mysql> SHOW CREATE TABLE t1\G
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE `t1` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `y` year DEFAULT NULL,
  `f` decimal(4,2) DEFAULT NULL,
  UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
1 row in set (0.00 sec)
```
@ti-srebot ti-srebot added the first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. label Oct 30, 2020
@CLAassistant
Copy link

CLAassistant commented Oct 30, 2020

CLA assistant check
All committers have signed the CLA.

@ghost
Copy link

ghost commented Oct 30, 2020

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Oct 30, 2020
Copy link
Contributor

@TomShawn TomShawn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
@dveeden Thanks!

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Nov 2, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Nov 2, 2020
@TomShawn TomShawn added the translation/doing This PR's assignee is translating this PR. label Nov 2, 2020
@TomShawn TomShawn merged commit 0b5c6b3 into pingcap:master Nov 2, 2020
@TomShawn TomShawn added the size/small Changes of a small size. label Nov 2, 2020
ti-srebot pushed a commit to ti-srebot/docs that referenced this pull request Nov 2, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot
Copy link
Contributor

cherry pick to release-4.0 in PR #4118

TomShawn pushed a commit that referenced this pull request Nov 2, 2020
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>

Co-authored-by: Daniël van Eeden <github@myname.nl>
@Joyinqin
Copy link
Contributor

Joyinqin commented Nov 2, 2020

/label translation/done

@ti-srebot ti-srebot added the translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR. label Nov 2, 2020
@Joyinqin
Copy link
Contributor

Joyinqin commented Nov 2, 2020

/unlabel translation/doing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first-time-contributor Indicates that the PR was contributed by an external member and is a first-time contributor. size/small Changes of a small size. status/LGT2 Indicates that a PR has LGTM 2. translation/done This PR has been translated from English into Chinese and updated to pingcap/docs-cn in a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants