# HG changeset patch # User Vincent Tondellier # Date 1480171723 -3600 # Node ID 2a86951f0c03ae621427e8273567171c7b37eb0f # Parent 39449f7dab997ce7b93195025de30218d8e219db Fix fuzzy search (by function), broken by the last commit diff -r 39449f7dab99 -r 2a86951f0c03 lib/CrashTest/Plugin/Storage/Sql/Utils.pm --- a/lib/CrashTest/Plugin/Storage/Sql/Utils.pm Sun Nov 20 20:57:40 2016 +0100 +++ b/lib/CrashTest/Plugin/Storage/Sql/Utils.pm Sat Nov 26 15:48:43 2016 +0100 @@ -36,7 +36,7 @@ # define a callback to collect values safely (without magic markers) my $cb = sub { my ($column, $this_op, $value) = @_; - my $sql = join('', $column->stringify, $this_op, '?'); + my $sql; if($column->type eq "fuzzy") { if ( $this_op =~ /!|NOT/ ) { @@ -49,6 +49,11 @@ $sql = $column->name; $sql =~ s/\s+\?op\?\s+/ $this_op /; } + + if(!defined($sql)) { + $sql = join('', $column->stringify, $this_op, '?'); + } + push @values, $value; return $sql; };