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

RSS feeds does not work on Postgres

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 3.0.8-RC1
    • 3.0.7
    • Viewing posts
    • None
    • PHP Environment:
      Database: PostgreSQL 8.3.9

      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(

            bantu Andreas Fischer [X] (Inactive)
            tkopal tkopal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: