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(parser): wrong error code. #5414

Merged
merged 2 commits into from
May 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion query/src/sql/statements/query/query_normalizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ impl QueryNormalizer {
match item {
SelectItem::Wildcard => {
if query.from.is_empty() {
return Err(ErrorCode::LogicalError(
return Err(ErrorCode::SemanticError(
"SELECT * with no tables specified is not valid",
));
}
Expand Down
2 changes: 1 addition & 1 deletion query/tests/it/sql/plan_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ async fn test_plan_parser() -> Result<()> {
name: "select-without-table",
sql: "SELECT *",
expect: "",
error: "Code: 1015, displayText = SELECT * with no tables specified is not valid (while in analyze select projection)."
error: "Code: 1065, displayText = SELECT * with no tables specified is not valid (while in analyze select projection)."
}
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ SELECT TRUE;
SELECT FALSE;
SELECT NOT(TRUE);
SELECT 'That\'s good.';
SELECT *; -- {ErrorCode 1015}
SELECT *; -- {ErrorCode 1065}