Bug 322479 - SQL errors due to apostrophes in directory names not being escaped during scanning
Summary: SQL errors due to apostrophes in directory names not being escaped during sca...
Status: RESOLVED DUPLICATE of bug 322415
Alias: None
Product: amarok
Classification: Applications
Component: Collections/Local (show other bugs)
Version: 2.7.90
Platform: Arch Linux Linux
: NOR grave
Target Milestone: 2.8
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-17 10:30 UTC by Aaron
Modified: 2013-07-17 12:15 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aaron 2013-07-17 10:30:13 UTC
Doing a full rescan on my local collection, I get MySQL errors due to the apostrophes in directory names not being escaped, e.g.:

GREPME MySQL-server query failed! (1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 's Voyage/_%'' at line 1 on SELECT id, deviceid, dir FROM directories WHERE deviceid = 2 AND dir LIKE './aaron/Music/Buckethead/Captain EO's Voyage/_%'

I'm not that familiar with the inner workings of Amarok and Qt, but I have traced this error to line 589 in src/core-impl/collections/db/sql/SqlScanResultProcessor.cpp, where it looks like the arguments are passed unescaped.

Reproducible: Always

Steps to Reproduce:
1. Start with a clean database
2. Have directories containing apostrophes in their names in your collection dir
3. Do a full rescan
Actual Results:  
Error messages like the one mentioned above pop up; the database is left nearly empty.
Comment 1 Myriam Schweingruber 2013-07-17 12:15:10 UTC

*** This bug has been marked as a duplicate of bug 322415 ***