Skip to content

Comments

Support expressions in LIMIT/OFFSET#567

Merged
alamb merged 1 commit intoapache:mainfrom
cube-js:upstream-patch/limit-offset-expr
Aug 11, 2022
Merged

Support expressions in LIMIT/OFFSET#567
alamb merged 1 commit intoapache:mainfrom
cube-js:upstream-patch/limit-offset-expr

Conversation

@MazterQyou
Copy link
Contributor

LIMIT and OFFSET allow usage of complex expressions, such as 1+2, or placeholders for prepared statements, whereas sqlparser only accepts numbers. This PR adds support for any kind of expression in LIMIT and OFFSET, and adds related tests.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 2829377994

  • 22 of 22 (100.0%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.01%) to 89.962%

Files with Coverage Reduction New Missed Lines %
src/parser.rs 1 83.37%
Totals Coverage Status
Change from base Build 2805421159: 0.01%
Covered Lines: 9115
Relevant Lines: 10132

💛 - Coveralls

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @MazterQyou -- we are on a roll today!

Ok(None)
} else {
Ok(Some(Expr::Value(self.parse_number_value()?)))
Ok(Some(self.parse_expr()?))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@alamb alamb merged commit 8176561 into apache:main Aug 11, 2022
@MazterQyou MazterQyou deleted the upstream-patch/limit-offset-expr branch August 11, 2022 11:13
mcheshkov pushed a commit to cube-js/sqlparser-rs that referenced this pull request Sep 2, 2024
Can drop this after rebase on commit 8176561 "Support expressions in LIMIT/OFFSET (apache#567)", first released in 0.21.0
mcheshkov pushed a commit to cube-js/sqlparser-rs that referenced this pull request Sep 2, 2024
Can leave only test after rebase on commit 8176561 "Support expressions in LIMIT/OFFSET (apache#567)", first released in 0.21.0
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