Permalink
Browse files

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.
  • Loading branch information...
franzliedke committed Nov 29, 2018
1 parent f591585 commit 7705a2b7d751943ef9d0c7379ec34f8530b99310
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/Discussion/Search/Gambit/FulltextGambit.php
@@ -53,7 +53,7 @@ public function apply(AbstractSearch $search, $bit)
$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')

0 comments on commit 7705a2b

Please sign in to comment.