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

Escape path queries for SQLite #1146

Closed
sampsyo opened this issue Dec 16, 2014 · 0 comments
Closed

Escape path queries for SQLite #1146

sampsyo opened this issue Dec 16, 2014 · 0 comments
Labels
bug bugs that are confirmed and actionable

Comments

@sampsyo
Copy link
Member

sampsyo commented Dec 16, 2014

Path queries in beets use the SQLite LIKE operator to search subdirectories. For example, beet ls /foo generates an SQL expression like path LIKE '/foo/%'. This can fail when the path contains characters that SQLite wants to interpret specially. Specifically, if there's an underscore in the path, SQLite matches any character in that position.

We should escape _ and % in these strings before sending them to SQLite.

@sampsyo sampsyo added the bug bugs that are confirmed and actionable label Dec 16, 2014
geigerzaehler pushed a commit that referenced this issue Dec 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs that are confirmed and actionable
Projects
None yet
Development

No branches or pull requests

1 participant