Re: [PG19] Wrong results from Memoize with a nondeterministic collation - Mailing list pgsql-hackers

From Manu
Subject Re: [PG19] Wrong results from Memoize with a nondeterministic collation
Date
Msg-id 179143921097.761822.15147859541810201857@gmail.com
Whole thread
In response to [PG19] Wrong results from Memoize with a nondeterministic collation  (shihao zhong <zhong950419@gmail.com>)
Responses Re: [PG19] Wrong results from Memoize with a nondeterministic collation
List pgsql-hackers
Hi Shihao,

> So it is an old bug with a new way in.

Confirmed, and the split is clean when measured on the current tip of
each branch: the LEFT JOIN wrong results are there from 14, while the
NOT EXISTS (anti join) case appears only from 19, where 0da29e4cb16
let anti joins use Memoize -- matching your "regression from 18".

0001 fixes it and make check passes on all of 14 through 19 and
master.  I also checked it holds across several nondeterministic
collations, a two-column key, a varchar outer column, a non-Var outer
expression, a partitioned inner rel, and LEFT JOIN LATERAL (already
right, since lateral_vars go into binary mode).

One caveat for the back branches: on 14-16 the new block must go
before the lappend into *param_exprs -- there is no list_member test
there.  patch/git apply with fuzz instead places it after, which
still compiles and passes make check but leaves the bug unfixed (I
measured that on 16).  A mechanical back-patch would look fine and
fix nothing; I can post the by-hand hunks for 14-16 if that helps.

Manu



pgsql-hackers by date:

Previous
From: Masahiko Sawada
Date:
Subject: Re: Parallel autovacuum: DROP DATABASE WITH (FORCE) fails on the parallel workers
Next
From: vignesh C
Date:
Subject: Incorrect CONTEXT reported for errors from parallel apply worker in logical replication