[Koha-bugs] [Bug 31565] Patron search filter by category code with special character returns no results

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Sep 14 16:43:00 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31565

Lari Taskula <lari.taskula at hypernova.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|koha-bugs at lists.koha-commun |lari.taskula at hypernova.fi
                   |ity.org                     |

--- Comment #2 from Lari Taskula <lari.taskula at hypernova.fi> ---
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30393#c0 refers to
MySQL documentation
https://dev.mysql.com/doc/refman/8.0/en/string-literals.html

On this page it is also mentioned that
"The \% and \_ sequences are used to search for literal instances of % and _ in
pattern-matching contexts where they would otherwise be interpreted as wildcard
characters. See the description of the LIKE operator in Section 12.8.1, “String
Comparison Functions and Operators”. If you use \% or \_ outside of
pattern-matching contexts, they evaluate to the strings \% and \_, not to % and
_. "

So as I understand it escaping % and _ characters should be escaped in LIKE
queries, but not in exact searches because they already evaluate to strings \%
and \_. I've attached a patch implementing this.

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list