| Summary: | searching for _v in filename to detect versions returns erroneous results | ||
|---|---|---|---|
| Product: | [Applications] digikam | Reporter: | Steve Franks <stevef48> |
| Component: | Searches-Advanced | Assignee: | Digikam Developers <digikam-bugs-null> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | normal | CC: | caulier.gilles, metzpinguin |
| Priority: | NOR | ||
| Version First Reported In: | 8.8.0 | ||
| Target Milestone: | --- | ||
| Platform: | Microsoft Windows | ||
| OS: | Microsoft Windows | ||
| Latest Commit: | Version Fixed/Implemented In: | 9.0.0 | |
| Sentry Crash Report: | |||
|
Description
Steve Franks
2025-11-28 15:26:37 UTC
OBSERVED RESULT EXPECTED RESULT SOFTWARE/OS VERSIONS Windows: 11 macOS: (available in the Info Center app, or by running `kinfo` in a terminal window) Linux/KDE Plasma: Fedora 43 KDE Plasma Version : 6.5.3 KDE Frameworks Version: 6.20.0 Qt Version: 6.10.1 ADDITIONAL INFORMATION It's a "LIKE" database search. You need to escape such characters with a "\" at the front. So type: \_v Maik This is the old Bug 430147 from when we added the escape function to SQLite as well. Maik Hi Maik, Can we do the special characters escape automatically ? As i know, if we search file name with these characters must be prepared previously: - _ : \_ - % : \% - ' : '' - " : "" - ; : must be removed as it close an sql instruction. I'm right ? Gilles There aren't many characters that need to be escaped in a LIKE SQL statement; see this MS Doc. The underscore is one of them. https://learn.microsoft.com/en-us/sql/t-sql/language-elements/like-transact-sql?view=sql-server-ver15#using-wildcard-characters-as-literals The semicolon (";") as the end character is generally unproblematic, since we already encapsulate the search strings in the SQL statement. I'll look into whether we can escape characters in SQL statements in general and whether there might be any side effects. Maik |