Skip to content

Account for CR in prepared statements, add tests #1322

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
Jul 4, 2024

Conversation

KianNH
Copy link
Contributor

@KianNH KianNH commented Oct 20, 2023

Closes #1300

This PR adds \r into the logic that makes sure there is nothing more than whitespace at the end of a prepared statement, otherwise it will throw an error indicating that a prepared statement can only contain one statement.

Accompanying tests have been added to make sure that spaces, CR, LF and CRLF are accepted as whitespace as well that multiple statements are rejected.

@KianNH KianNH requested review from a team as code owners October 26, 2023 11:37
@KianNH KianNH requested review from fhanau and vickykont October 26, 2023 11:37
@Cherry
Copy link
Contributor

Cherry commented Jul 2, 2024

Users are somewhat regularly still hitting this in the Discord - is there anything left before this can be merged?

Copy link
Contributor

@fhanau fhanau left a comment

Choose a reason for hiding this comment

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

Looks like all concerns here have been addressed – merging this.

@fhanau fhanau merged commit de0c66d into cloudflare:main Jul 4, 2024
ns476 pushed a commit to ns476/workerd that referenced this pull request Aug 2, 2024
…cloudflare#1322)

* Account for CR in prepared statements tail, add tests
* Add additional whitespace characters
* Add \r\n into whitespace test
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.

🐛 Bug Report: SqliteDatabase::prepareSql does not handle CRLF line endings
6 participants