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.
This commit is contained in:
Franz Liedke 2018-11-29 22:50:32 +01:00
parent f591585d02
commit 7705a2b7d7
No known key found for this signature in database
GPG Key ID: 9A0231A879B055F4

View File

@ -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')