Order DiffCommits by primary key by default

Review Request #10521 — Created April 9, 2019 and submitted

Information

Review Board
release-4.0.x

Reviewers

There are a few places where we are querying for DiffCommits but aren't
providing an ORDER BY clause, so we get them in whatever order the
database provides. SQLite returns them by primary key, but MySQL does
not, which leads to commits being out of order is certain places (such
as the CommitListField in change descriptions).

We always want DiffCommits ordered by primary key, so we make that the
default. Any query in which this is not the case can explicitly provide
an ORDER BY clause.

Ran unit tests.

Summary ID
Order DiffCommits by primary key by default
There are a few places where we are querying for DiffCommits but aren't providing an `ORDER BY` clause, so we get them in whatever order the database provides. SQLite returns them by primary key, but MySQL does not, which leads to commits being out of order is certain places (such as the CommitListField in change descriptions). We *always* want DiffCommits ordered by primary key, so we make that the default. Any query in which this is not the case can explicitly provide an `ORDER BY` clause.
53a4e07cb3954ee583c79f4d6d79cd42ca553210
Description From Last Updated

Can you add a unit test for this?

daviddavid

Extra space at the end.

chipx86chipx86

I'd feel more comfortable if we asserted the exact order of the commits we get back. There are many sort …

chipx86chipx86
brennie
david
  1. 
      
  2. Show all issues

    Can you add a unit test for this?

    1. The original patch does include a unit test.

  3. 
      
chipx86
  1. 
      
  2. Show all issues

    Extra space at the end.

  3. Show all issues

    I'd feel more comfortable if we asserted the exact order of the commits we get back. There are many sort orders in which this statement could still be true.

  4. 
      
brennie
chipx86
  1. Ship It!
  2. 
      
brennie
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-4.0.x (346b662)
Loading...