Bill Erickson's fix for my breakage of QueryParser.pm for the speedup
via the WITH common table expression usage inadvertently left out
the commas required to delimit multiple WITH clauses, resulting in SQL
query errors.
This fixes that oversight. Note that the fts-replacement.pl script came
in quite handy for testing this; recommended.
Signed-off-by: Dan Scott <dan@coffeecode.net>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
$from .= "\n\t\t\tJOIN config.metabib_field AS fe_weight ON (fe_weight.id = fe.field)";
if ($node->dummy_count < @{$node->only_atoms} ) {
- #$with.= "\n\t\t\tWITH ${talias}_xq AS (SELECT ". $node->tsquery ." AS tsq )";
- $with.= "${talias}_xq AS (SELECT ". $node->tsquery ." AS tsq )";
+ $with .= ",\n" if $with;
+ $with .= "${talias}_xq AS (SELECT ". $node->tsquery ." AS tsq )";
$from .= "\n\t\t\tJOIN ${talias}_xq ON (fe.index_vector @@ ${talias}_xq.tsq)";
} else {
$from .= "\n\t\t\t, (SELECT NULL::tsquery AS tsq ) AS x";