Skip to content

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

Merged
sushantdhiman merged 2 commits into
sequelize:masterfrom
bl42:fix-offset-subqueries
Jul 23, 2018
Merged

sushantdhiman merged 2 commits into
sequelize:masterfrom
bl42:fix-offset-subqueries

Conversation

@bl42

@bl42 bl42 commented Jun 22, 2018

Copy link
Copy Markdown
Contributor

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

codecov Bot commented Jun 22, 2018 •

Copy link
Copy Markdown

Codecov Report

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

@sushantdhiman
sushantdhiman requested a review from janmeier June 23, 2018 08:29
@sushantdhiman
sushantdhiman merged commit c003871 into sequelize:master Jul 23, 2018
@schie

schie commented Nov 11, 2018

Copy link
Copy Markdown

@bl42 @sushantdhiman @janmeier ,

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

@bl42

bl42 commented Nov 12, 2018

Copy link
Copy Markdown
Contributor Author

@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants