pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@postnewspapers.com.au>
To: John Lister <john.lister-ps@kickstone.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Unit tests and ordering
Date: Mon, 20 Apr 2009 09:09:59 +0800
Message-ID: <49EBCB67.5080806@postnewspapers.com.au> (raw)
In-Reply-To: <49EB6ABD.7020308@kickstone.com>
References: <49E72C90.9010903@enterprisedb.com>
	<49EB6ABD.7020308@kickstone.com>

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



view thread (3+ messages)  latest in thread

Message-ID: <49EBCB67.5080806@postnewspapers.com.au>
Permalink:  ../49EBCB67.5080806@postnewspapers.com.au/
Also on:    postgresql.org/message-id/49EBCB67.5080806@postnewspapers.com.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: craig@postnewspapers.com.au, john.lister-ps@kickstone.com
  Subject: Re: Unit tests and ordering
  In-Reply-To: <49EBCB67.5080806@postnewspapers.com.au>
  References: <49E72C90.9010903@enterprisedb.com> <49EB6ABD.7020308@kickstone.com> <49EBCB67.5080806@postnewspapers.com.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox