Skip to content

fix(sql-execute): the offset of the last sql goes wrong when it doesn't end with the delimiter#1970

Merged
yhilmare merged 4 commits into
dev/4.2.xfrom
lebie_424_fix_sql_execute_0319
Mar 19, 2024
Merged

fix(sql-execute): the offset of the last sql goes wrong when it doesn't end with the delimiter#1970
yhilmare merged 4 commits into
dev/4.2.xfrom
lebie_424_fix_sql_execute_0319

Conversation

@MarkPotato777
Copy link
Copy Markdown
Contributor

What type of PR is this?

type-bug

What this PR does / why we need it:

The issue is that when we execute sqls in sql console. If the last sql does NOT end with the delimiter, the allocating of violating sql-check rules is not accurate.

The root reason is that the splitter will add the last sql in the buffer rather than directly add it into spliited sqls. Then the caller wrongly calculates the offset of the last sql.

The solution is that if there is a buffer after splitting, we obtain the buffer's index in the original sql.

Which issue(s) this PR fixes:

Fixes #1758

Special notes for your reviewer:

Additional documentation e.g., usage docs, etc.:


@MarkPotato777 MarkPotato777 added the type-bug Something isn't working label Mar 19, 2024
@MarkPotato777 MarkPotato777 added this to the ODC 4.2.4 milestone Mar 19, 2024
@MarkPotato777 MarkPotato777 self-assigned this Mar 19, 2024
Copy link
Copy Markdown
Contributor

@yhilmare yhilmare left a comment

Choose a reason for hiding this comment

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

lgtm

@yhilmare yhilmare merged commit 61bb86c into dev/4.2.x Mar 19, 2024
@yhilmare yhilmare deleted the lebie_424_fix_sql_execute_0319 branch March 19, 2024 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug Something isn't working

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants