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

add support for update statements that contain tuple assignments #1317

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

lovasoa
Copy link
Contributor

@lovasoa lovasoa commented Jun 17, 2024

This allows the correct parsing of

UPDATE x SET (a, b) = (1, 2)

while also maintaining the parsing of

UPDATE x SET a.b = 1

This includes a change to the ast::Assignment struct

Fixes #1311
Fixes sqlpage/SQLPage#403

@coveralls
Copy link

coveralls commented Jun 17, 2024

Pull Request Test Coverage Report for Build 9552206864

Details

  • 71 of 72 (98.61%) changed or added relevant lines in 7 files are covered.
  • 12 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.1%) to 88.982%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser/mod.rs 10 11 90.91%
Files with Coverage Reduction New Missed Lines %
src/lib.rs 1 12.64%
src/parser/alter.rs 2 66.67%
tests/sqlparser_common.rs 4 89.59%
src/dialect/mod.rs 5 72.08%
Totals Coverage Status
Change from base Build 9439708625: 0.1%
Covered Lines: 26183
Relevant Lines: 29425

💛 - Coveralls

This allows the correct parsing of
UPDATE x SET (a, b) = (1, 2)

while also maintaining the parsing of
UPDATE x SET a.b = 1

This includes a change to the ast::Assignment struct
@coveralls
Copy link

coveralls commented Jun 17, 2024

Pull Request Test Coverage Report for Build 9552246194

Details

  • 71 of 72 (98.61%) changed or added relevant lines in 7 files are covered.
  • 59 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.1%) to 88.982%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser/mod.rs 10 11 90.91%
Files with Coverage Reduction New Missed Lines %
src/lib.rs 1 12.64%
src/parser/alter.rs 2 66.67%
tests/sqlparser_common.rs 4 89.59%
src/dialect/mod.rs 5 72.08%
src/ast/mod.rs 47 81.62%
Totals Coverage Status
Change from base Build 9439708625: 0.1%
Covered Lines: 26183
Relevant Lines: 29425

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 17, 2024

Pull Request Test Coverage Report for Build 9552267799

Details

  • 71 of 72 (98.61%) changed or added relevant lines in 7 files are covered.
  • 12 unchanged lines in 4 files lost coverage.
  • Overall coverage increased (+0.1%) to 88.982%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/parser/mod.rs 10 11 90.91%
Files with Coverage Reduction New Missed Lines %
src/lib.rs 1 12.64%
src/parser/alter.rs 2 66.67%
tests/sqlparser_common.rs 4 89.59%
src/dialect/mod.rs 5 72.08%
Totals Coverage Status
Change from base Build 9439708625: 0.1%
Covered Lines: 26183
Relevant Lines: 29425

💛 - Coveralls

@lovasoa
Copy link
Contributor Author

lovasoa commented Jun 17, 2024

@alamb Let me know what you think :) I have a SQLPage user who needs this.

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 for the contribution @lovasoa -- I left a suggestion, but I also think this method works too so we could merge the PR without changes too

Let me know what you think

src/ast/mod.rs Show resolved Hide resolved
@alamb alamb merged commit 345e209 into apache:main Jun 18, 2024
10 checks passed
@lovasoa lovasoa deleted the update_tuple branch June 18, 2024 13:51
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.

incorrect parsing of UPDATE statements using row values in SQLite SQL statement rendering problem
3 participants