Bug tracker

This ticket has been moved to our new tracker. Open Ticket PHPBB3-7886 now.

Topic-oriented search fails with PostgreSQL (fix completed in vcs)

Searching on a single search term with all defaults except "Search within" changed to 'Topic titles only' will fail with this message:

General Error
SQL ERROR [ postgres ]

ERROR: invalid reference to FROM-clause entry for table "m0" LINE 1: ...ordmatch m0, v3_topics t LEFT JOIN v3_posts p ON (m0.post_id... ^ HINT: There is an entry for table "m0", but it cannot be referenced from this part of the query. []

SQL

SELECT COUNT(DISTINCT p.post_id) AS total_results FROM v3_search_wordmatch m0, v3_topics t LEFT JOIN v3_posts p ON (m0.post_id = p.post_id) WHERE p.post_id = t.topic_first_post_id AND m0.word_id = 5158 AND m0.title_match = 1

BACKTRACE

FILE: includes/db/postgres.php
LINE: 177
CALL: dbal->sql_error()

FILE: includes/search/fulltext_native.php
LINE: 666
CALL: dbal_postgres->sql_query()

FILE: search.php
LINE: 418
CALL: fulltext_native->keyword_search()


Similarly, searching on a single search term with all defaults except "Display results as" changed to 'Topics' will fail with a similar message:

General Error
SQL ERROR [ postgres ]

ERROR: invalid reference to FROM-clause entry for table "m0" LINE 1: ...ordmatch m0, v3_topics t LEFT JOIN v3_posts p ON (m0.post_id... ^ HINT: There is an entry for table "m0", but it cannot be referenced from this part of the query. []

SQL

SELECT COUNT(DISTINCT p.topic_id) AS total_results FROM v3_search_wordmatch m0, v3_topics t LEFT JOIN v3_posts p ON (m0.post_id = p.post_id) WHERE p.topic_id = t.topic_id AND m0.word_id = 5158

BACKTRACE

FILE: includes/db/postgres.php
LINE: 177
CALL: dbal->sql_error()

FILE: includes/search/fulltext_native.php
LINE: 666
CALL: dbal_postgres->sql_query()

FILE: search.php
LINE: 418
CALL: fulltext_native->keyword_search()


Post-oriented searches (i.e. all default settings) work just fine.

Comments / History

Changed ticket status from "New" to "Awaiting information"

Action performed by Acyd Burn (Server Manager) on Nov 22nd 2008, 19:44

Posted by Acyd Burn (Server Manager) on Nov 22nd 2008, 19:44

Was this really on 3.0.3? IIRC we changed this for postgresql in 3.0.3, but i am not entirely sure.

Posted by RiffRaff on Nov 22nd 2008, 21:12

Yes, 3.0.3 is the only phpBB3 version I've used. This was a fresh conversion from a phpBB2 site.

Posted by A_Jelly_Doughnut (MOD Team Member) on Nov 29th 2008, 18:21

A user on #phpbb just reported this bug on postgres as well.

Assigned ticket to user "naderman"

Action performed by Acyd Burn (Server Manager) on Nov 30th 2008, 17:41

Changed ticket severity from "Uncategorised/normal" to "Severe"

Action performed by Acyd Burn (Server Manager) on Nov 30th 2008, 17:41

Changed ticket status from "Awaiting information" to "Reviewed"

Action performed by Acyd Burn (Server Manager) on Nov 30th 2008, 17:41

Changed ticket status from "Reviewed" to "Fix in progress"

Action performed by naderman (Development Team Leader) on Dec 4th 2008, 16:53

Linked ticket with changeset: r9172

Action performed by naderman (Development Team Leader) on Dec 4th 2008, 16:56

Changed ticket status from "Fix in progress" to "Fix completed in SVN"

Action performed by naderman (Development Team Leader) on Dec 4th 2008, 17:13

Ticket details

Related SVN changesets