Moodle

Blog block sql error

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9, 2.0
  • Component/s: Blog
  • Labels:
    None
  • Environment:
    Linux, PostgreSQL
  • Database:
    PostgreSQL
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE, MOODLE_20_STABLE

Description

This is not dissimilar to the resolved MDL-8614, but this error is generated with Moodle 1.9 beta code on a PostgreSQL database (more fussy than MySQL I think):

ERROR: column "tg.rawname" must appear in the GROUP BY clause or be used in an aggregate function

SELECT tg.rawname, tg.id, tg.name, COUNT(ti.id) AS count, tg.flag FROM hlearn_tag_instance ti INNER JOIN hlearn_tag tg ON tg.id = ti.tagid GROUP BY tagid ORDER BY count DESC

  • line 779 of lib/dmllib.php: call to debugging()
  • line 1020 of lib/dmllib.php: call to get_recordset_sql()
  • line 1125 of tag/lib.php: call to get_records_sql() ....

Issue Links

Activity

Hide
Yu Zhang added a comment -

Thanks John for the report. I have added them into the group by clause.

Cheers, Yu

Show
Yu Zhang added a comment - Thanks John for the report. I have added them into the group by clause. Cheers, Yu
Hide
Nick Freear added a comment -

Also missing " tg.flag " in GROUP BY clause in "popular_tags_count" function.

Show
Nick Freear added a comment - Also missing " tg.flag " in GROUP BY clause in "popular_tags_count" function.
Hide
Nick Freear added a comment -

I've committed a fix for the above on HEAD/ 2.0 and 1.9 branch, tagged MERGED. (OU Bug 3938)

Show
Nick Freear added a comment - I've committed a fix for the above on HEAD/ 2.0 and 1.9 branch, tagged MERGED. (OU Bug 3938)
Hide
Nick Freear added a comment -

Similar GROUP BY problems found in, tag/manage.php - reassign to me.

Show
Nick Freear added a comment - Similar GROUP BY problems found in, tag/manage.php - reassign to me.
Hide
Nick Freear added a comment -

Just committed another follow-up for tag/manage.php (see previous comment), to HEAD and 1.9 branch, tagged MERGED.

Show
Nick Freear added a comment - Just committed another follow-up for tag/manage.php (see previous comment), to HEAD and 1.9 branch, tagged MERGED.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: