Skip to content

Conversation

Hanwn
Copy link
Contributor

@Hanwn Hanwn commented Mar 27, 2023

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

fix for issue #6188 (comment)

User Case Description

when execute db.Limit(0).Offset(0).Where("id > ?", 10).Find(&users), it will return all data satified where condition. Namely, sql generated is select * from users where id > 10, but not select * from users where id > 10 limit 0, which is diff from sql semantics.

@Hanwn Hanwn changed the title fix: limit(0).offset(0) return all data fix: limit(0).offset(0) return all data (https://github.com/go-gorm/gorm/issues/6188#issue-1641432003) Mar 27, 2023
@Hanwn Hanwn changed the title fix: limit(0).offset(0) return all data (https://github.com/go-gorm/gorm/issues/6188#issue-1641432003) fix: limit(0).offset(0) return all data https://github.com/go-gorm/gorm/issues/6188#issue-1641432003 Mar 27, 2023
@Hanwn Hanwn changed the title fix: limit(0).offset(0) return all data https://github.com/go-gorm/gorm/issues/6188#issue-1641432003 fix: limit(0).offset(0) return all data Mar 27, 2023
@Hanwn Hanwn changed the title fix: limit(0).offset(0) return all data fix: limit(0).offset(b) return all data, where b >= 0 Mar 28, 2023
@Hanwn Hanwn changed the title fix: limit(0).offset(b) return all data, where b >= 0 fix: limit(0).offset(b) return all data, where b <= 0 Mar 28, 2023
@jinzhu jinzhu merged commit 59ca46d into go-gorm:master Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants