[TiDB Usage Environment] Production Environment
[TiDB Version] v5.2.3
[Encountered Problem] The upstream business sets a default value for the DATE type to the current day. In MySQL, this can be achieved by configuring the curdate() function to automatically get the current day’s value. The field SQL is:
create_date date DEFAULT curdate() COMMENT ‘Creation Date’
[Reproduction Path] Attempted to change the SQL syntax configuration for the DATE type default value in TiDB, but all attempts were unsuccessful.
[Problem Phenomenon and Impact]
The data table cannot add a DATE type field with a default value of the current day.
[Attachment]
It should be. I just checked and it is still at MySQL 5.7.
In this scenario, if the upstream is synchronizing to TiDB, and there are default values, can TiDB consider non-null as well? However, it might be a bit troublesome every time the table structure changes during synchronization.
TiDB is currently mainly compatible with MySQL 5.7.