HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlMinor

Null instead '0000-00-00 00:00:00' in mysql 5.7

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
insteadnullmysql0000

Problem

Before: mysql 5.6. One of the columns in the table is created as follows:

`f_stamp` datetime NOT NULL DEFAULT '0000-00-00 00:00:00'


When i view this field in mysql client or using DataGrip, this field is displayed correctly.

Now: mysql 5.7. The field is not displayed correctly (more precisely, it is causes en error). I delete from mysql config following flags: NO_ZERO_DATE, NP_ZERO_IN_DATE and STRICT_TRANS_TABLES. And now, looking at this field i see:

  • Using mysql-client: 0000-00-00 00:00:00



  • DataGrip: null



How to change server's option for support this non-standard datetime value, initialize by '0000-00-00 00:00:00' ?

UPD: https://youtrack.jetbrains.com/issue/DBE-3377

Solution

It is the JDBC driver option we changed in DataGrip by default. But you can configure it the way you like:

Context

StackExchange Database Administrators Q#139896, answer score: 6

Revisions (0)

No revisions yet.