Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0#3248
Merged
morozov merged 1 commit intodoctrine:developfrom Aug 12, 2018
Merged
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0#3248morozov merged 1 commit intodoctrine:developfrom
morozov merged 1 commit intodoctrine:developfrom
Conversation
morozov
commented
Aug 11, 2018
| { | ||
| if ($limit === null && $offset > 0) { | ||
| return $query . ' LIMIT -1 OFFSET ' . $offset; | ||
| $limit = -1; |
Member
Author
There was a problem hiding this comment.
Not strictly related to the issue, just a code duplication cleanup.
cd4e8b1 to
1ffceaa
Compare
1ffceaa to
980a01f
Compare
morozov
added a commit
that referenced
this pull request
Sep 29, 2018
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Oct 7, 2018
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Oct 7, 2018
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Nov 14, 2018
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Nov 14, 2018
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Nov 25, 2018
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Dec 6, 2018
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Jan 20, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
to morozov/dbal
that referenced
this pull request
Feb 6, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
to morozov/dbal
that referenced
this pull request
Feb 6, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Feb 7, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Feb 20, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Feb 22, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Mar 15, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Mar 15, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Mar 18, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Apr 16, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
May 6, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
May 23, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
to morozov/dbal
that referenced
this pull request
May 31, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Jun 13, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Jun 27, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
to morozov/dbal
that referenced
this pull request
Aug 26, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
morozov
added a commit
that referenced
this pull request
Nov 2, 2019
Made the OFFSET in LIMIT queries non-nullable integer defaulting to 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Semantically, the absence of the offset in a
LIMITed query ($offset = null) means "start from the beginning", i.e. with the zero offset. Therefore,$offset = nulland$offset = 0are semantically equivalent.From the practical standpoint, allowing
$offset = nullmeans that we have to cast it to an(int)or consider its nullability during strict comparison.This patch makes the offset non-nullable defaulting to
0. The usage of theNULLoffset in DBAL 2.x will be deprecated in favor of using0.