summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2018-12-06 10:47:05 +0100
committerYorhel <git@yorhel.nl>2018-12-06 10:47:07 +0100
commit2586f9c78693705807d6c8122ec36eae5de4a33d (patch)
tree24027f62585eb1b090320e2494138715db8170c8
parentd46eeec63a5bb1416fe9ca7a10607f3be0bd8851 (diff)
DB::Chars: Fix SQL operator precedence bug in search filter
This would cause other filters to sometimes be ignored, depending on the order in which the %where hash was being serialized. https://vndb.org/t11605.3 Broken in 8802eac4f.
-rw-r--r--lib/VNDB/DB/Chars.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/VNDB/DB/Chars.pm b/lib/VNDB/DB/Chars.pm
index 167ee223..923d1e94 100644
--- a/lib/VNDB/DB/Chars.pm
+++ b/lib/VNDB/DB/Chars.pm
@@ -42,7 +42,7 @@ sub dbCharGet {
defined $o{weight_min} ? ( 'c.weight >= ?' => $o{weight_min} ) : (),
defined $o{weight_max} ? ( 'c.weight <= ? AND c.weight > 0' => $o{weight_max} ) : (),
$o{search} ? (
- "(c.name ILIKE ? OR translate(c.original,' ','') ILIKE translate(?,' ','')) OR c.alias ILIKE ?", [ map '%'.$o{search}.'%', 1..3 ] ) : (),
+ "(c.name ILIKE ? OR translate(c.original,' ','') ILIKE translate(?,' ','') OR c.alias ILIKE ?)", [ map '%'.$o{search}.'%', 1..3 ] ) : (),
$o{char} ? (
'LOWER(SUBSTR(c.name, 1, 1)) = ?' => $o{char} ) : (),
defined $o{char} && !$o{char} ? (