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

(fix): Offset in UNION'ed queries #9577

Merged
merged 2 commits into from Jul 23, 2018

Conversation

@bl42
Copy link
Contributor

@bl42 bl42 commented Jun 22, 2018

Fixed an issue when passing limit/offset inside a subquery.

Pull Request check-list

Please make sure to review and check all of these items:

  • [ x ] Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • [ - ] Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • [ - ] Have you added new tests to prevent regressions?
  • [ - ] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • [ x ] Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

When executing a query like so, the offset value would not get passed to the UNION ALL Generated query.

models.tblLeague.findAll({
      include: [
        {
          model: models.tblPost,
          order: [['createdDate', 'DESC']],
          offset: 5,
          limit: 10,
          where: { isActive: state.active },
        },
      ],
      where: { leagueId: [1,2,3] },
    });
Fixed an issue when passing limit/offset inside a subquery.
@codecov
Copy link

@codecov codecov bot commented Jun 22, 2018

Codecov Report

Merging #9577 into master will not change coverage.
The diff coverage is n/a.

@sushantdhiman sushantdhiman requested a review from janmeier Jun 23, 2018
@sushantdhiman sushantdhiman merged commit c003871 into sequelize:master Jul 23, 2018
4 checks passed
4 checks passed
codecov/patch Coverage not affected when comparing 9b46f91...39ffc6a
Details
codecov/project 95.98% remains the same compared to 9b46f91
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@schie
Copy link

@schie schie commented Nov 11, 2018

@bl42 @sushantdhiman @janmeier ,

Do any of you see why this wouldn't also work for Sequelize v4?

@bl42
Copy link
Contributor Author

@bl42 bl42 commented Nov 12, 2018

@bl42 @sushantdhiman @janmeier ,

Do any of you see why this wouldn't also work for Sequelize v4?

I don't see any reason why it wouldn't work for v4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants