Uploaded image for project: 'MusicBrainz Server'
  1. MusicBrainz Server
  2. MBS-12647

RG artist sort in collections causes ISE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 2023-02-28
    • None
    • None
    • None

      This is implemented, but wrongly, so it is ISEing. It's also, for some reason, hidden anyway, but someone hit it (I assume by trying it in the URL).

      Sentry Issue: MUSICBRAINZ-SERVER-351

      None: DBD::Pg::st execute failed: ERROR:  invalid reference to FROM-clause entry for table "release_group"
      LINE 17:         ORDER BY id, ac.name COLLATE musicbrainz, release_gr...
                                                                 ^
      HINT:  Perhaps you meant to reference the table alias "rg". [for Statement "
                  WITH x AS (
            SELECT *
            FROM (
            SELECT DISTINCT ON (rg.id)
              rg.id, rg.gid, rg.type AS primary_type_id, rg.name COLLATE musicbrainz,
                  rg.artist_credit AS artist_credit_id,
                  rg.comment, rg.edits_pending, rg.last_updated,
                  rgm.first_release_date_year,
                  rgm.first_release_date_month,
                  rgm.first_release_date_day, ac.name AS ac_name
              FROM release_group rg
                  JOIN release_group_meta rgm ON rgm.id = rg.id
              JOIN editor_collection_release_group ec ON rg.id = ec.release_group
              JOIN artist_credit ac ON ac.id = rg.artist_credit
              WHERE ec.collection = ?
              ORDER BY id, ac.name COLLATE musicbrainz, release_group.name COLLATE musicbrainz
            ) release_group
            ORDER BY ac_name COLLATE musicbrainz, release_group.name COLLATE musicbrainz, id OFFSET ?)
                  SELECT x.*, c.count AS total_row_count
                  FROM x, (SELECT count(*) FROM x) c
               LIMIT ?" with ParamValues: 1='2758861', 2='0', 3='100']
        File "Connector.pm", line 50, in Sql::select_list_of_hashes
          $exception->throw( sqlstate => $state, message => decode_utf8($msg) );
        File "QueryToList.pm", line 80, in MusicBrainz::Server::Data::Role::QueryToList::query_to_list_limited
          } @{$self->c->sql->select_list_of_hashes($query, @args)};
        File "Collection.pm", line 30, in MusicBrainz::Server::Data::Role::Collection::find_by_collection
          $self->query_to_list_limited($query, [$collection_id], $limit, $offset);
        File "Collection.pm", line 122, in MusicBrainz::Server::Controller::Collection::__ANON__
          $model->find_by_collection($collection->id, shift, shift, $order);
        File "Controller.pm", line 244, in MusicBrainz::Server::Controller::_load_paged
          my ($data, $total) = $loader->($LIMIT, ($page - 1) * $LIMIT);
      ...
      (6 additional frame(s) were not displayed)
      

            reosarevok Nicolás Tamargo
            dev-sentry Dev through Sentry
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2023-02-28