Skip to content
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

MySQL escaping issues #13

Open
PMunch opened this issue May 25, 2017 · 2 comments
Open

MySQL escaping issues #13

PMunch opened this issue May 25, 2017 · 2 comments

Comments

@PMunch
Copy link

PMunch commented May 25, 2017

I'm working on a server that uses a MySQL backend and I wanted to add pagination. Typically with the MySQL wrapper you would do something like this:

db.getAllRows(sql"SELECT * FROM table LIMIT 100 OFFSET ?", page*100)

However the dbFormat procedure that is applied to all such statements wraps all inputs in single quotes. This means that the SQL statement gets incorrectly converted to SELECT * FROM table LIMIT 100 OFFSET '200' which isn't a valid statement.

Another issue is that the dbQuote procedure that the formatting procedure applies seems to assume that the database is in ANSI_QUOTES mode and only escapes a small subset of things that should be escaped.

@stale
Copy link

stale bot commented Aug 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. If you think it is still a valid issue, write a comment below; otherwise it will be closed. Thank you for your contributions.

@PMunch
Copy link
Author

PMunch commented Aug 4, 2020

This issue still exists, for most of the discussion regarding it see nim-lang/Nim#5885

@ringabout ringabout transferred this issue from nim-lang/Nim Dec 8, 2022
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 a pull request may close this issue.

1 participant