Skip to content

Fix panic in EscapeQuotedString and parse_flush, clean up a few unwraps#2330

Open
Mrmaxmeier wants to merge 3 commits intoapache:mainfrom
Mrmaxmeier:fix-panics
Open

Fix panic in EscapeQuotedString and parse_flush, clean up a few unwraps#2330
Mrmaxmeier wants to merge 3 commits intoapache:mainfrom
Mrmaxmeier:fix-panics

Conversation

@Mrmaxmeier
Copy link
Copy Markdown

Hi,
I tried generating SQL inputs with sqlparser and ran into a few crashes. In the process of fixing these, I've also refactored some of the code in ast/ to avoid unwraps where applicable.
Let me know if I should add tests for the two commits that actually change behaviour.
Thanks!

Replace if x.is_some() { x.as_ref().unwrap() }
with if let Some(x) = x { x }
This could previously panick with multi-byte utf8 characters:

datafusion-sqlparser-rs-896df239ce2264c8/847ddf3/src/ast/value.rs:583:53:
end byte index 271 is not a char boundary; it is inside '�' (bytes 270..273 of string)
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.

1 participant