The Wayback Machine - https://web.archive.org/web/20201020110504/https://github.com/go-sql-driver/mysql/pull/1145
Skip to content
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

return sql.NullTime if it available #1145

Merged

Conversation

@shogo82148
Copy link
Contributor

@shogo82148 shogo82148 commented Aug 13, 2020

Description

related to #960 (comment)

Will rows.ColumnTypes() (first value from db.Query()) return sql.NullTime instead of mysql.NullTime too?

My answer is yes.
rows.ColumnTypes() should return sql.NullTime.

Checklist

  • Code compiles correctly
  • Created tests which fail without the change (if possible)
  • All tests passing
  • Extended the README / documentation, if necessary
  • Added myself / the copyright holder to the AUTHORS file
@shogo82148
Copy link
Contributor Author

@shogo82148 shogo82148 commented Aug 13, 2020

Can we drop this line?

dsn + "&parseTime=false",

I think it is misuse of mysql.NullTime or sql.NullTime.
They should be treated like time.Time, and used with the parseTime=true option.

previous discussion is here #1049 (comment)

@shogo82148 shogo82148 marked this pull request as draft Aug 13, 2020
@shogo82148
Copy link
Contributor Author

@shogo82148 shogo82148 commented Aug 13, 2020

Thanks for reviewing, but now tests fail.
I will fix it.

@shogo82148 shogo82148 marked this pull request as ready for review Aug 13, 2020
@shogo82148 shogo82148 requested a review from methane Aug 13, 2020
@julienschmidt julienschmidt added this to the v1.6.0 milestone Aug 14, 2020
@shogo82148 shogo82148 merged commit 84241ad into go-sql-driver:master Aug 16, 2020
3 checks passed
3 checks passed
Travis CI - Pull Request Build Passed
Details
WIP Ready for review
Details
coverage/coveralls Coverage increased (+0.2%) to 82.034%
Details
@shogo82148 shogo82148 deleted the shogo82148:scan-type-return-sql-null-time branch Aug 16, 2020
tz70s added a commit to tz70s/mysql that referenced this pull request Sep 5, 2020
* return sql.NullTime if it available

* NullTime should be used with parseTime=true option
tz70s added a commit to tz70s/mysql that referenced this pull request Sep 5, 2020
* return sql.NullTime if it available

* NullTime should be used with parseTime=true option
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.