QueryParser Driver: Use proper table alias
authorThomas Berezansky <tsbere@mvlc.org>
Tue, 11 Sep 2012 13:21:36 +0000 (09:21 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Fri, 15 Feb 2013 20:39:48 +0000 (15:39 -0500)
When all atoms are dummy atoms we need the correct table alias.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm

index cc2304d..de68579 100644 (file)
@@ -876,7 +876,7 @@ sub flatten {
                     $with .= "${talias}_xq AS (SELECT ". $node->tsquery ." AS tsq )";
                     $from .= "\n${spc}${spc}${spc}${spc}${spc}${spc}JOIN ${talias}_xq ON (fe.index_vector @@ ${talias}_xq.tsq)";
                 } else {
-                    $from .= "\n${spc}${spc}${spc}${spc}${spc}${spc}, (SELECT NULL::tsquery AS tsq ) AS x";
+                    $from .= "\n${spc}${spc}${spc}${spc}${spc}${spc}, (SELECT NULL::tsquery AS tsq ) AS ${talias}_xq";
                 }
 
                 my @bump_fields;