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(sqlparser): allow single quoted value for set time zone #9962

Merged
merged 1 commit into from
May 23, 2023

Conversation

xiangjinwu
Copy link
Contributor

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Allow set time zone 'utc'; (in addition to set time zone utc; without quotes).

see #8572 (comment)
used by cube #9946

Checklist For Contributors

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

  • My PR DOES NOT contain user-facing changes.

@xiangjinwu xiangjinwu requested a review from TennyZhuang May 23, 2023 08:53
@github-actions github-actions bot added the type/fix Bug fix label May 23, 2023
Comment on lines -3588 to -3591
} else if let Ok(ident) = self.parse_identifier() {
SetTimeZoneValue::Ident(ident)
} else {
let value = self.parse_value()?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

parse_value() after a failed parse_identifier() does not work because the token position is not restored with prev_token(). But instead of using prev_token(), we follow the same pattern as parse_set_variable: use one peek_xxx and one parse_xxx

@codecov
Copy link

codecov bot commented May 23, 2023

Codecov Report

Merging #9962 (80523f8) into main (3e36979) will increase coverage by 0.00%.
The diff coverage is 77.77%.

@@           Coverage Diff           @@
##             main    #9962   +/-   ##
=======================================
  Coverage   71.16%   71.16%           
=======================================
  Files        1249     1249           
  Lines      209513   209514    +1     
=======================================
+ Hits       149100   149105    +5     
+ Misses      60413    60409    -4     
Flag Coverage Δ
rust 71.16% <77.77%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/sqlparser/src/parser.rs 86.77% <77.77%> (+0.03%) ⬆️

... and 13 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@TennyZhuang TennyZhuang added this pull request to the merge queue May 23, 2023
Merged via the queue into main with commit 728edd8 May 23, 2023
@TennyZhuang TennyZhuang deleted the fix-sqlparser-set-time-zone branch May 23, 2023 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/fix Bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants