go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.21k stars 5.5k forks source link

Dashboard heatmap always loading on mysql 8 #5220

Closed gaydin closed 6 years ago

gaydin commented 6 years ago

https://gist.github.com/gaydin/ee00f012fbefe913daa53a98c0c55f1c

Description

Maybe need changed https://github.com/go-gitea/gitea/blob/master/models/user_heatmap.go#L26 UNIX_TIMESTAMP(DATE_FORMAT(FROM_UNIXTIME(created_unix), '%Y%m%d')) to UNIX_TIMESTAMP(DATE(FROM_UNIXTIME(created_unix)))

kolaente commented 6 years ago

Does this also fail in mysql 5/ mariadb 10?

gaydin commented 6 years ago

I tested on MySQL 5.6.37 - work fine. Trouble with mysql 8.0.13 only. After changing DATE_FORMAT to DATE works fine on MySQL 5.6 and 8

sapk commented 6 years ago

@gaydin do you know how to make a PR ? If not maybe we could add a label good first issue to attract new contributor ?