risinglightdb / sqllogictest-rs

Sqllogictest parser and runner in Rust.
Apache License 2.0
168 stars 42 forks source link

Escape regex special characters in the completion mode #174

Closed melgenek closed 1 year ago

melgenek commented 1 year ago

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 https://github.com/apache/arrow-datafusion/issues/5727

melgenek commented 1 year ago

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 https://github.com/risinglightdb/sqllogictest-rs/commit/9311624212234a6a7e74b2cb47723f4212c20f3b.

xxchan commented 1 year ago

published

melgenek commented 1 year ago

Thank you!

alamb commented 1 year ago

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 commented 1 year ago

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