Skip to content

desc is not compatible with MySQL #10337

Closed
@lonng

Description

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
➜ tidiff --mysql.db=tt --tidb.db=tt 'select version()'
MySQL(127.0.0.1:3306)> select version()
+-----------+
| version() |
+-----------+
| 8.0.16    |
+-----------+
1 row in set (0.001 sec)

TiDB(127.0.0.1:4000)> select version()
+------------------------------------------+
| version()                                |
+------------------------------------------+
| 5.7.25-TiDB-v3.0.0-beta.1-187-g5876abd70 |
+------------------------------------------+
1 row in set (0.004 sec)

➜ tidiff --mysql.db=tt --tidb.db=tt 'create table t2 (a timestamp default current_timestamp on update current_timestamp)'
MySQL(127.0.0.1:3306)> create table t2 (a timestamp default current_timestamp on update current_timestamp)
Empty set
0 row in set (0.007 sec)

TiDB(127.0.0.1:4000)> create table t2 (a timestamp default current_timestamp on update current_timestamp)
Empty set
0 row in set (0.010 sec)

➜ tidiff --mysql.db=tt --tidb.db=tt desc t2
MySQL(127.0.0.1:3306)> desc t2
+----------------------------------------------------------------------------------------------------+
| Field | Type      | Null | Key | Default           | Extra                                         |
+----------------------------------------------------------------------------------------------------+
| a     | timestamp | YES  |     | CURRENT_TIMESTAMP | DEFAULT_GENERATED on update CURRENT_TIMESTAMP |
+----------------------------------------------------------------------------------------------------+
1 row in set (0.004 sec)

TiDB(127.0.0.1:4000)> desc t2
+----------------------------------------------------------------------------------+
| Field | Type      | Null | Key | Default           | Extra                       |
+----------------------------------------------------------------------------------+
| a     | timestamp | YES  |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
+----------------------------------------------------------------------------------+
1 row in set (0.004 sec)
  1. What did you expect to see?

The result shoud be same as MySQL

  1. What did you see instead?

Showing above.

  1. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| tidb_version()                                                                                                                                                                                                                                                                                                                                           |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Release Version: v3.0.0-beta.1-187-g5876abd70
Git Commit Hash: 5876abd70ccc054704ab0e8cbf02ed129c6efc76
Git Branch: refine-point-get-failpoint
UTC Build Time: 2019-04-30 03:35:49
GoVersion: go version go1.12 darwin/amd64
Race Enabled: false
TiKV Min Version: 2.1.0-alpha.1-ff3dd160846b7d1aed9079c389fc188f7f5ea13e
Check Table Before Drop: false |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.003 sec)

Metadata

Assignees

No one assigned

    Labels

    good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.type/compatibility

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions