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

RSS feeds does not work on Postgres

    Details

    • Type: Bug
    • Status: Unverified Fix
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.7
    • Fix Version/s: 3.0.8-RC1
    • Component/s: Viewing posts
    • Labels:
      None
    • Environment:
      PHP Environment:
      Database: PostgreSQL 8.3.9

      Description

      Postgres returns error when a feed is open:
      ERROR: invalid reference to FROM-clause entry for table "p" at character 285
      HINT: There is an entry for table "p", but it cannot be referenced from this part of the query.
      STATEMENT: SELECT f.forum_id, f.forum_name, p.post_id, p.topic_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield,
      p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, u.username, u.user_id FROM phpbb_posts p, phpbb_users u
      LEFT JOIN phpbb_forums f ON (f.forum_id = p.forum_id) WHERE p.topic_id IN (3666, 3832, 3830, 1655, 3587, 3828, 2876, 3815,
      3829, 367, 3761, 3827, 3826, 3175, 3451, 3632, 3822, 3823, 3597, 3824)
      AND (p.post_approved = 1
      OR p.forum_id IN (2, 3, 4, 6, 7, 8, 10, 11, 14, 15, 16, 17, 18, 23, 24))
      AND p.post_time >= 1266952354
      AND u.user_id = p.poster_id ORDER BY p.post_time DESC
      LIMIT 20 OFFSET 0

      Switching the two tables in the FROM part did the trick:

      — feed-old.php 2010-03-03 23:49:23.637834100 +0100
      +++ feed.php 2010-03-03 23:49:30.523762619 +0100
      @@ -783,8 +783,8 @@
      'p.post_id, p.topic_id, p.post_time, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, ' .
      'u.username, u.user_id',
      'FROM' => array(

      • POSTS_TABLE => 'p',
        USERS_TABLE => 'u',
        + POSTS_TABLE => 'p',
        ),
        'LEFT_JOIN' => array(
        array(

        Issue Links

          Activity

          Hide
          Oleg Oleg [X] (Inactive) added a comment -

          I don't use feeds but I reproduced the issue and the supplied fix does fix it.

          I run postgresql 8.4.2.

          Attached is the fix as patch file.

          Show
          Oleg Oleg [X] (Inactive) added a comment - I don't use feeds but I reproduced the issue and the supplied fix does fix it. I run postgresql 8.4.2. Attached is the fix as patch file.
          Show
          bantu Andreas Fischer added a comment - - edited http://github.com/bantu/phpbb3/compare/bug/9108
          Hide
          Oleg Oleg [X] (Inactive) added a comment -
          Show
          Oleg Oleg [X] (Inactive) added a comment - Duplicated by http://tracker.phpbb.com/browse/PHPBB3-9569 .

            People

            • Assignee:
              bantu Andreas Fischer
              Reporter:
              tkopal tkopal
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:

                Development