Re: Unit tests and ordering

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Unit tests and ordering
Дата
Msg-id 49EBCB67.5080806@postnewspapers.com.au
обсуждение исходный текст
Ответ на Unit tests and ordering  (John Lister <john.lister-ps@kickstone.com>)
Список pgsql-jdbc
John Lister wrote:

> This seems to be an ordering problem.. The dates are inserted and then
> the test relies on them being returned in the same order they were
> inserted. I'm fairly sure that this isn't guaranteed when using SQL,

Correct. Your tests are broken, you REALLY need an ORDER BY clause if
you depend on the order of the result set. Alternately, adjust your
tests to not care about the result set order.

> however it looks like it probably worked before.

The only major change I can personally think of that might've affected
that is synchronized scans. If you have more than one backend reading
the table at once using a sequential scan, one of them will usually pick
up part-way through the table then go back to the beginning once it hits
the end. I'm not sure if that's likely to be related to what you're seeing.

In any case, you REALLY need an appropriate ORDER BY clause.

--
Craig Ringer

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: John Lister
Дата:
Сообщение: Unit tests and ordering
Следующее
От: "John Lister"
Дата:
Сообщение: Re: Unit tests and ordering