GORM Playground Link

https://github.com/go-gorm/playground/pull/505

Test Data

start_time,end_time,id
2022-06-24 10:18:03,2022-06-24 10:18:03,4
2022-07-01 00:00:00,2022-07-01 01:00:00,6
2022-07-01 05:00:00,2022-08-01 00:00:00,10

gorm result: 1

2022/08/16 20:41:10 test.go:57
[0.219ms] [rows:1] SELECT * FROM `test` WHERE start_time >= "2022-07-01 00:00:00"

sqlite teminal result: 2

sqlite> SELECT * FROM `test` WHERE start_time >= "2022-07-01 00:00:00";
2022-07-01 00:00:00|2022-07-01 01:00:00|6
2022-07-01 05:00:00|2022-08-01 00:00:00|10

gorm result: 3

[0.195ms] [rows:3] SELECT * FROM `test` WHERE e_time < "2022-08-01 00:00:00"

sqlite terminal result: 2

sqlite> SELECT * FROM `test` WHERE e_time < "2022-08-01 00:00:00";
2022-06-24 10:18:03|2022-06-24 10:18:03|4
2022-07-01 00:00:00|2022-07-01 01:00:00|6

Inconsistent results were detected using the same SQL

sqlite> .version SQLite 3.39.2 2022-07-21 15:24:47 698edb77537b67c41adc68f9b892db56bcf9a55e00371a61420f3ddd668e6603 zlib version 1.2.12 gcc-5.4.0 20160609

go version go version go1.19 linux/amd64

gorm.io/driver/sqlite v1.3.6 gorm.io/gorm v1.23.8 github.com/mattn/go-sqlite3 v1.14.14

Comment From: github-actions[bot]

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking

Comment From: github-actions[bot]

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking

Comment From: Jacky-YC

Gorm Inconsistent results were detected using the same SQL

使用golang原生的sql查询 结果与预期相符;所以确定问题是由gorm导致的

Comment From: github-actions[bot]

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking

Comment From: Jacky-YC

sqlite 查询time.Time 被转为:”2022-07-01 00:00:00+00:00“ 串,查出结果与”2022-07-01 00:00:00“ 结果不一致 Gorm Inconsistent results were detected using the same SQL

Comment From: github-actions[bot]

The issue has been automatically marked as stale as it missing playground pull request link, which is important to help others understand your issue effectively and make sure the issue hasn't been fixed on latest master, checkout https://github.com/go-gorm/playground for details. it will be closed in 30 days if no further activity occurs. if you are asking question, please use the Question template, most likely your question already answered https://github.com/go-gorm/gorm/issues or described in the document https://gorm.io ✨ Search Before Asking

Comment From: a631807682

It's a time zone issue, it has nothing to do with gorm, even if you use other drivers, it only depends on whether you use the interpolate params or not.