pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: yamt@mwd.biglobe.ne.jp
To: pgsql-bugs@postgresql.org
Subject: ERROR:  comparetup_datum() should not be called
Date: Fri,  6 Apr 2012 14:04:25 +0000 (UTC)
Message-ID: <20120406140425.49EAC14A1FA@mail.netbsd.org> (raw)

hi,

commit 337b6f5ecf05b21b5e997986884d097d60e4e3d0 marked comparetup_datum
"should not be called" but actually it is called for eg. tape-based sort.

a testcase:
	select generate_series(1,1000000) a into t;
	set maintenance_work_mem=1024;
	create index concurrently i on t (a);

YAMAMOTO Takashi

inline patch 1: src/backend/utils/sort/tuplesort.c (+3/-3 lines) download inline-1.patchdiff --git a/src/backend/utils/sort/tuplesort.c b/src/backend/utils/sort/tuplesort.c index d8e5d68..ea8eca6 100644 --- a/src/backend/utils/sort/tuplesort.c +++ b/src/backend/utils/sort/tuplesort.c @@ -3243,9 +3243,9 @@ reversedirection_index_hash(Tuplesortstate *state) static int comparetup_datum(const SortTuple *a, const SortTuple *b, Tuplesortstate *state) { - /* Not currently needed */ - elog(ERROR, "comparetup_datum() should not be called"); - return 0; + return ApplySortComparator(a->datum1, a->isnull1, + b->datum1, b->isnull1, + state->onlyKey); } static void

view thread (2+ messages)  latest in thread

Message-ID: <20120406140425.49EAC14A1FA@mail.netbsd.org>
Permalink:  ../20120406140425.49EAC14A1FA@mail.netbsd.org/
Also on:    postgresql.org/message-id/20120406140425.49EAC14A1FA@mail.netbsd.org

 ·  · 

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-bugs@postgresql.org
  Cc: yamt@mwd.biglobe.ne.jp
  Subject: Re: ERROR:  comparetup_datum() should not be called
  In-Reply-To: <20120406140425.49EAC14A1FA@mail.netbsd.org>
  References: <20120406140425.49EAC14A1FA@mail.netbsd.org>

* 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