pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
ERROR:  comparetup_datum() should not be called
2+ messages / 2 participants
[nested] [flat]

* ERROR:  comparetup_datum() should not be called
@ 2012-04-06 14:04  YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
  0 siblings, 1 reply; 2+ messages in thread

From: yamt@mwd.biglobe.ne.jp @ 2012-04-06 14:04 UTC (permalink / raw)
  To: pgsql-bugs

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
^ permalink raw reply [nested|flat] 2+ messages in thread

* Re: ERROR: comparetup_datum() should not be called
@ 2012-04-06 20:59  Tom Lane <tgl@sss.pgh.pa.us>
  parent: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2012-04-06 20:59 UTC (permalink / raw)
  To: yamt@mwd.biglobe.ne.jp; +Cc: pgsql-bugs

yamt@mwd.biglobe.ne.jp (YAMAMOTO Takashi) writes:
> commit 337b6f5ecf05b21b5e997986884d097d60e4e3d0 marked comparetup_datum
> "should not be called" but actually it is called for eg. tape-based sort.

Yeah, that's pretty broken.  Patch applied, thanks!

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2012-04-06 20:59 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-04-06 14:04 ERROR:  comparetup_datum() should not be called YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
2012-04-06 20:59 ` Re: ERROR: comparetup_datum() should not be called Tom Lane <tgl@sss.pgh.pa.us>

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