From 7705a2b7d751943ef9d0c7379ec34f8530b99310 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Thu, 29 Nov 2018 22:50:32 +0100 Subject: [PATCH] Fix search with database prefix wrap() only adds a table prefix when referencing a column with a table name (such as `foo.bar`) - when only a single identifier is provided, it is assumed to be a column name, which does not need a prefix. Fixes #1659. --- src/Discussion/Search/Gambit/FulltextGambit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Discussion/Search/Gambit/FulltextGambit.php b/src/Discussion/Search/Gambit/FulltextGambit.php index 9f701934b..46e4b3da1 100644 --- a/src/Discussion/Search/Gambit/FulltextGambit.php +++ b/src/Discussion/Search/Gambit/FulltextGambit.php @@ -53,7 +53,7 @@ class FulltextGambit implements GambitInterface $query ->addSelect('posts_ft.most_relevant_post_id') ->join( - new Expression('('.$subquery->toSql().') '.$grammar->wrap('posts_ft')), + new Expression('('.$subquery->toSql().') '.$grammar->wrapTable('posts_ft')), 'posts_ft.discussion_id', '=', 'discussions.id' ) ->addBinding($subquery->getBindings(), 'join')