Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-15496

SQL Error in PostgreSQL Fulltext search when results displayed as topics

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.1
    • Fix Version/s: 3.2.2
    • Component/s: Search
    • Environment:
      PHP 7.0.19, PostgreSQL 9.6, Debian 9

      Description

      When issuing a SELECT DISTINCT ... ORDER BY, PostgreSQL requires that the column being ordered also appears in the SELECT statement. The phpBB Postgres fulltext search backend issues a SELECT DISTINCT when displaying results as topic, but does not add the sorted column to the SELECT, resulting in the error:

      ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list LINE 5: ORDER BY t.topic_last_post_time DESC ^ []

      To reproduce:

      1. Have a forum using PostgreSQL as its database, and the search backend as PostgreSQL Fulltext.
      2. Perform any kind of search with 'Display results as:' set to Topics.

        Attachments

          Activity

            People

            • Assignee:
              Marc Marc
              Reporter:
              Void Chicken Void Chicken
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: