[HACKERS] Assertion failure in get_attstatsslot()

2010-07-09 Thread Bernd Helmle
Consider the following small testcase: BEGIN; CREATE OR REPLACE FUNCTION upper(IN varchar, OUT varchar) LANGUAGE SQL STRICT IMMUTABLE AS $$ SELECT pg_catalog.upper($1)::varchar; $$; CREATE TABLE foo(value varchar); INSERT INTO foo SELECT 'helmle' FROM generate_series(1, 1000); CREATE

Re: [HACKERS] Assertion failure in get_attstatsslot()

2010-07-09 Thread Tom Lane
Bernd Helmle maili...@oopsware.de writes: -- assertion failure EXPLAIN SELECT 1 FROM foo WHERE UPPER(value) = 'xyz'; I tried it back from current -HEAD to 8.3.11 and managed to reproduce it everywhere. Non-cassert builds are working correctly, so i'm not sure wether this is an

Re: [HACKERS] Assertion failure in get_attstatsslot()

2010-07-09 Thread Alvaro Herrera
Excerpts from Tom Lane's message of vie jul 09 12:16:42 -0400 2010: If anybody feels really uncomfortable with that, we could add a compensating Assert(IsBinaryCoercible(ARR_ELEMTYPE(statarray), atttype)) into get_attstatsslot(). Not sure if it's worth the cycles. Cycles spent only in

Re: [HACKERS] Assertion failure in get_attstatsslot()

2010-07-09 Thread Tom Lane
Alvaro Herrera alvhe...@commandprompt.com writes: Excerpts from Tom Lane's message of vie jul 09 12:16:42 -0400 2010: If anybody feels really uncomfortable with that, we could add a compensating Assert(IsBinaryCoercible(ARR_ELEMTYPE(statarray), atttype)) into get_attstatsslot(). Not sure if

Re: [HACKERS] Assertion failure in get_attstatsslot()

2010-07-09 Thread Andres Freund
1;2401;0cOn Fri, Jul 09, 2010 at 06:49:27PM -0400, Alvaro Herrera wrote: Excerpts from Tom Lane's message of vie jul 09 12:16:42 -0400 2010: If anybody feels really uncomfortable with that, we could add a compensating Assert(IsBinaryCoercible(ARR_ELEMTYPE(statarray), atttype)) into