-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Error: "Incorrect datetime value: '0000-00-00' for column..." on mysql 5.7 and above #725
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
Comments
It's MySQL's spec and there are nothing we can. |
1 similar comment
It's MySQL's spec and there are nothing we can. |
Hi, thanks! |
This is not MySQL user forum... |
I know much about MySQL protocol, but I don't know much about MySQL's behavior. |
Related issue: #346 |
Amygos
added a commit
to nethesis/icaro
that referenced
this issue
Aug 6, 2019
From Tuesday April 23rd, 2019, Travis-ci started to use Ubuntu Xenial as default distro[1], this introduce new mysql version 5.7.x[2] and incompatible datetime format[3]. [1] https://blog.travis-ci.com/2019-04-15-xenial-default-build-environment [2] https://docs.travis-ci.com/user/database-setup/#mysql [3] go-sql-driver/mysql#725
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue description
I've inserted a "zero" time.Time object to a table with a DATETIME column, and get
Incorrect datetime value: '0000-00-00' for column
error.Example code
The below code fails:
Replacing
time.Time{}
withtime.Now()
will cause the code not to fail.Configuration
*Driver version (or git SHA): 9181e3a (master)
*Go version: go version go1.9 linux/amd64
*Server version: mysql 8.0.3, 5.7.20
*Server OS: fedora 26
The text was updated successfully, but these errors were encountered: