Skip to content

Commit

Permalink
Fix search with database prefix
Browse files Browse the repository at this point in the history
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 7705a2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Discussion/Search/Gambit/FulltextGambit.php
Expand Up @@ -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')
Expand Down

0 comments on commit 7705a2b

Please sign in to comment.