8000 Escape regex special characters in the completion mode by melgenek · Pull Request #174 · risinglightdb/sqllogictest-rs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Escape regex special characters in the completion mode #174

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

Merged
merged 3 commits into from
Mar 25, 2023

Conversation

melgenek
Copy link
Contributor

This pr updates the autocompletion logic for the regex special characters.
Currently, the issues lead to cryptic errors like

Error: query is expected to fail with error:
	DataFusion error: Error during planning: arrow_cast requires its second argument to be a constant string, got Int64(43)
but got error:
	DataFusion error: Error during planning: arrow_cast requires its second argument to be a constant string, got Int64(43)
[SQL] SELECT arrow_cast('1', 43)
at tests/sqllogictests/test_files/arrow_typeof.slt:98

The problem is that the autocompletion mode added the plain brachets () in the example above. And it should've escaped the brackets with \(\). Otherwise, they are treated as a regex group.

For more details about the issue, please, see apache/datafusion#5727

Signed-off-by: Yevhenii Melnyk <melnyk.yevhenii@gmail.com>
Copy link
Member
@xxchan xxchan left a comment

Choose a reason for hiding this comment

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

🤣 LGTM. Thanks!

Could you please help update the version and the changelog? Then I can publish a patch for you.

@melgenek
Copy link
Contributor Author
melgenek commented Mar 24, 2023

Could you please help update the version and the changelog? Then I can publish a patch for you.

Updated the version and the changelog. I did it in this pr similar to how it was done before in the 9311624.

Signed-off-by: Yevhenii Melnyk <melnyk.yevhenii@gmail.com>
@xxchan xxchan merged commit 07b11cc into risinglightdb:main Mar 25, 2023
@xxchan
Copy link
Member
xxchan commented Mar 25, 2023

published

@melgenek melgenek deleted the escape_autocomplete_regex branch March 25, 2023 09:05
@melgenek
Copy link
Contributor Author

Thank you!

@alamb
Copy link
Contributor
alamb commented Mar 25, 2023

Could you please help update the version and the changelog? Then I can publish a patch for you.

Wow -- thank you both so much!

@alamb
Copy link
Contributor
alamb commented Mar 25, 2023

For the record, I think https://crates.io/crates/sqllogictest/0.13.2 contains the fix

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.

3 participants
0