Uploaded image for project: 'Crucible'
  1. Crucible
  2. CRUC-2343

Activity Stream produces incorrect results when upgrading from 1.6.x to 2.0.x

    XMLWordPrintable

Details

    Description

      The SQL upgrade task produces incorrect results for sql/HSQL/upgrade/upgrade_36.sql and so all reviews will look like they were created by the first user.

      The bug is in the following:

      insert into new_cru_state_change (select cru_id, cru_time_stamp, cru_superseded, cru_review_id,cru_new_state,
        (SELECT p.cru_user FROM cru_review_participant p WHERE cru_review_id = p.cru_review_id AND p.cru_moderator = true limit 1) from cru_state_change);

      The nested query seems to be joining on itself cru_review_id = p.cru_review_id.

      Changing the statement to the following fixes it:

      insert into new_cru_state_change (select cru_id, cru_time_stamp, cru_superseded, cru_review_id,cru_new_state,
        (SELECT p.cru_user FROM cru_review_participant p WHERE cs.cru_review_id = p.cru_review_id AND p.cru_moderator = true limit 1) from cru_state_change cs);

      Attachments

        Activity

          People

            evzijst Erik van Zijst (Inactive)
            andrew.myers Andrew Myers [Atlassian]
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 2h
                2h
                Remaining:
                Remaining Estimate - 2h
                2h
                Logged:
                Time Spent - Not Specified
                Not Specified