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(frontend): refine error messages for invalid operations #6548

Merged
merged 5 commits into from
Nov 24, 2022

Conversation

xxchan
Copy link
Member

@xxchan xxchan commented Nov 23, 2022

I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.

What's changed and what's your intention?

close #3258 (replace)

Checklist

  • 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)

@xxchan xxchan requested a review from BugenZhao November 23, 2022 20:50
@github-actions github-actions bot added the type/fix Bug fix label Nov 23, 2022
table: TableWithJoins,
table_name: ObjectName,
Copy link
Member Author

Choose a reason for hiding this comment

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

Update joins is mysql's syntax

Copy link
Member

Choose a reason for hiding this comment

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

Update is very hard. 🤣

@@ -136,53 +136,6 @@ fn parse_update() {
);
}

#[test]
fn parse_update_with_table_alias() {
let sql = "UPDATE users AS u SET u.username = 'new_user' WHERE u.username = 'old_user'";
Copy link
Member Author

Choose a reason for hiding this comment

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

pg support this (and also DELETE .. AS .., which is not supported by parser now), but maybe let's do it later.

@codecov
Copy link

codecov bot commented Nov 23, 2022

Codecov Report

Merging #6548 (fe43f2f) into main (2d87383) will decrease coverage by 0.07%.
The diff coverage is 67.03%.

@@            Coverage Diff             @@
##             main    #6548      +/-   ##
==========================================
- Coverage   74.07%   73.99%   -0.08%     
==========================================
  Files         989      993       +4     
  Lines      161850   162086     +236     
==========================================
+ Hits       119888   119941      +53     
- Misses      41962    42145     +183     
Flag Coverage Δ
rust 73.99% <67.03%> (-0.08%) ⬇️

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

Impacted Files Coverage Δ
src/batch/src/error.rs 0.00% <ø> (ø)
src/common/src/catalog/schema.rs 78.12% <0.00%> (-6.34%) ⬇️
src/compute/src/server.rs 0.00% <0.00%> (ø)
src/expr/src/error.rs 25.00% <ø> (ø)
src/frontend/src/catalog/root_catalog.rs 72.76% <0.00%> (-2.52%) ⬇️
src/frontend/src/handler/drop_index.rs 59.70% <0.00%> (-5.88%) ⬇️
src/frontend/src/handler/drop_source.rs 0.00% <0.00%> (-85.15%) ⬇️
src/risedevtool/src/config.rs 0.00% <0.00%> (ø)
src/risedevtool/src/service_config.rs 0.00% <0.00%> (ø)
src/risedevtool/src/task.rs 0.00% <ø> (ø)
... and 53 more

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

Copy link
Contributor

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

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

LGTM

@BugenZhao BugenZhao changed the title fix(frontend): refine error messages for invaliad operations fix(frontend): refine error messages for invalid operations Nov 24, 2022
table: TableWithJoins,
table_name: ObjectName,
Copy link
Member

Choose a reason for hiding this comment

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

Update is very hard. 🤣

@@ -0,0 +1,394 @@
# 1. drop non-existent relation

statement error table not found
Copy link
Member

Choose a reason for hiding this comment

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

Can we maintain these error messages without pain? 🥵

Copy link
Member Author

Choose a reason for hiding this comment

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

What is the pain you mean?

Copy link
Member

Choose a reason for hiding this comment

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

Do we have to manually update all these error messages if we change them in the future?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but since it’s regexp match instead of full match, and it won’t be frequently changed, I think it won’t be a huge pain 🫣

@mergify mergify bot merged commit 011258a into main Nov 24, 2022
@mergify mergify bot deleted the xxchan/final-felidae branch November 24, 2022 08:29
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.

3 participants