From da0b6c44881f85509822802e58774488d84a2059 Mon Sep 17 00:00:00 2001
From: Dan Scott <dan@coffeecode.net>
Date: Mon, 13 Jun 2011 09:45:39 -0400
Subject: [PATCH] Prevent uninit var warnings in QueryParser.pm

$suffix_op and $prefix_op would not be defined if $suffix or $prefix did
not evaluate to true, leading to warnings about undefined variables in
open-ils.storage_stderr.log.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
---
 .../lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm       | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
index b858fd55bd..8cd490cd26 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm
@@ -834,8 +834,11 @@ sub buildSQL {
     my $suffix = $self->suffix || '';
 
     $prefix = "'$prefix' ||" if $prefix;
-    my $suffix_op = ":$suffix" if $suffix;
-    my $suffix_after = "|| '$suffix_op'" if $suffix;
+    my $suffix_op = '';
+    my $suffix_after = '';
+
+    $suffix_op = ":$suffix" if $suffix;
+    $suffix_after = "|| '$suffix_op'" if $suffix;
 
     $sql = "to_tsquery('$classname', COALESCE(NULLIF($prefix '(' || btrim(regexp_replace($sql,E'(?:\\\\s+|:)','$suffix_op&','g'),'&|') $suffix_after || ')', '()'), ''))";
 
-- 
2.11.0