Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-15496

SQL Error in PostgreSQL Fulltext search when results displayed as topics

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.2.2
    • 3.2.1
    • Search
    • PHP 7.0.19, PostgreSQL 9.6, Debian 9

      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.

            Marc Marc
            Void Chicken Void Chicken [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: