-
Notifications
You must be signed in to change notification settings - Fork 13
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
possible problem with double qouted data after a named placeholder #2
Comments
what's the result of resolving named placeholders? can you print |
looks like a bug in named_placeholders compiler ( might be caused by "0000-00-00 00:00:00" ) |
it's ok if I delete ":" from date, so probably bug in parser in "in quote" state. Might be also the case for @mscdex node-mariasql |
Seems very likely... but it depends on, whether it is placed before or after the other named placeholders (also for more complex queries - as long as the fixed date is before any named placeholders, there is no problem) |
@sidorares you still want unnamed? |
no, no need, run it locally myself |
Perfect - let me know, if there is anything I can do. As said, the workaround is simply to place the date string part prior to any named placeholders, so everything works right now, but we should try to find a way to handle this in the module. |
it's definitely a bug, I'll try to fix it |
I've tried to create the most minimal case, where this happens (used with
node-mysql2
):conn.execute('SELECT * FROM items WHERE id = :id AND deleted = "0000-00-00 00:00:00";', { id: Number(id) })
fails, butconn.execute('SELECT * FROM items WHERE deleted = "0000-00-00 00:00:00" AND id = :id;', { id: Number(id) })
works fine.For some reason the first one is converted to:
SELECT * FROM items WHERE id = ?";
The text was updated successfully, but these errors were encountered: