-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
double type precision does not display in show create table
while D is 0
#22604
Comments
In MySQL8.0, it is the same result. |
In TiDB, you can view the HTTP API via
the description above is for decimal type rather than double. |
This is documented here: https://docs.pingcap.com/tidb/stable/mysql-compatibility#incompatibility-caused-by-deprecated-features Because the feature is deprecated in MySQL, there are no current plans to support it. |
I run this again in MySQL mysql> create table t0(a double(10,0));
Query OK, 0 rows affected, 1 warning (0.03 sec)
mysql> show create table t0;
+-------+------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+------------------------------------------------------------------------------------------------------------------------+
| t0 | CREATE TABLE `t0` (
`a` double(10,0) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci |
+-------+------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql> select version();
+-----------+
| version() |
+-----------+
| 8.0.23 |
+-----------+
1 row in set (0.00 sec) |
I run this using test> create table t0(a decimal);
Query OK, 0 rows affected
Time: 0.359s
test> show create table t0;
+-------+--------------------------------------------------------------------------------------------------------------------+
| Table | Create Table |
+-------+--------------------------------------------------------------------------------------------------------------------+
| t0 | CREATE TABLE `t0` (\n `a` decimal(11,0) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin |
+-------+--------------------------------------------------------------------------------------------------------------------+
1 row in set
Time: 0.059s
test> desc t0;
+-------+---------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+---------------+------+-----+---------+-------+
| a | decimal(11,0) | YES | | <null> | |
+-------+---------------+------+-----+---------+-------+
1 row in set
Time: 0.080s
mysql root@172.16.4.131:test> select tidb_version()\G
***************************[ 1. row ]***************************
tidb_version() | Release Version: v4.0.10
Edition: Community
Git Commit Hash: dbade8cda4c5a329037746e171449e0a1dfdb8b3
Git Branch: heads/refs/tags/v4.0.10
UTC Build Time: 2021-01-15 02:59:27
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false
|
seems it is ok in current master |
To confirm, there are two separate issues here:
I am going to close this issue now, but please feel free to reopen if you have any additional questions. Thanks! |
Please edit this comment or add a new comment to complete the following informationNot a bug
Duplicate bug
BugNote: Make Sure that 'component', and 'severity' labels are added 1. Root Cause Analysis (RCA) (optional)2. Symptom (optional)3. All Trigger Conditions (optional)4. Workaround (optional)5. Affected versions[v4.0.10] 6. Fixed versionsmaster |
Bug Report
Please answer these questions before submitting your issue. Thanks!
1. Minimal reproduce step (Required)
As the TiDB Doc description, while D is omitted, the default is 0. but the type
double
has different behavior fromdouble(10, 0)
for insert some data.if there are differences, the
show create table
should not be same.2. What did you expect to see? (Required)
show create table should have the precision while D is 0
3. What did you see instead (Required)
see above.
4. What is your TiDB version? (Required)
The text was updated successfully, but these errors were encountered: