-
Notifications
You must be signed in to change notification settings - Fork 287
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
🐛 Bug Report: SqliteDatabase::prepareSql does not handle CRLF line endings #1300
Labels
D1
D1 Database
Comments
So I'm getting this error (only started recently) when running a d1 execute from my Windows machine (only when I run it on prod; local wrangler dev works fine). The file I'm running does not have CRLF line endings -- is this problem only for when the actual file contains CRLF, or is this just a bug with how wrangler is sending the file from Windows? |
e.g.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
workerd will reject prepared statements executed in
SINGLE
mode appear to have more than one statement.workerd/src/workerd/util/sqlite.c++
Lines 392 to 396 in d9ed653
However, the code for incrementing
tail
seems to only account for\n
(LF) whereas users on Windows will have\r\n
(CRLF).workerd/src/workerd/util/sqlite.c++
Line 390 in d9ed653
The issue can be seen when using Wrangler and providing a file with a newline, when saved with CRLF line endings:
It can also be reproduced in a Cloudflare Worker:
The text was updated successfully, but these errors were encountered: