Help Center/ Database and Application Migration UGO/ User Guide/ Syntax Conversion/ Conversion Error Codes/ Error Codes Generated During Conversion from MySQL to GaussDB/ U0400035: GaussDB (M-compatible mode) does not support default value 0000-00-00 00:00:00 for TIMESTAMP data type
Updated on 2025-06-07 GMT+08:00

U0400035: GaussDB (M-compatible mode) does not support default value 0000-00-00 00:00:00 for TIMESTAMP data type

Description

Database Type and Version

  • Source database type and version: MySQL 5.5, 5.6, 5.7, and 8.0
  • Target database type and version: GaussDB (M-compatible mode)

Syntax Example

When the strict mode is not enabled for MySQL (that is, the value of sql_mode does not contain NO_ZERO_DATE), columns of the TIMESTAMP data type can store 0000-00-00 00:00:00. However, values of the TIMESTAMP data type of GaussDB (M-compatible mode) range from 1970-01-01 00:00:01 UTC to 2038-01-19 03:14:07 UTC. The value cannot be 0000-00-00 00:00:00. The following example is not supported in GaussDB (M-compatible mode).

create table test_timestamp (
    id int, 
    c_timestamp timestamp not null default '0000-00-00 00:00:00'
);

Suggestion

Modify TIMESTAMP '0000-00-00 00:00:00' conversion to convert 0000-00-00 00:00:00 to 1970-01-02 00:00:00.

In MySQL, 0000-00-00 00:00:00 indicates that the value has not been specified. In some cases, 0000-00-00 00:00:00 indicates an invalid date and time. If this value is used in service data, after the conversion, you need to check and replace the value with the converted time and date.