Hello
+ hashContext.hash_fcinfo = hash_fcinfo;
+ hashContext.op_is_reversed = !hash_mcv;
+ hashContext.insert_mode = true;
Are you sure about op_is_reversed, isn't it backwards, shouldn't it be
= hash_mcv instead?
See the following testcase:
CREATE TABLE test_cross_type_bug (val float4);
INSERT INTO test_cross_type_bug
SELECT v
FROM generate_series(1, 200) AS v,
generate_series(1, 50);
ALTER TABLE test_cross_type_bug ALTER COLUMN val SET STATISTICS 200;
ANALYZE test_cross_type_bug;
SELECT string_agg(v::text, ', ') AS in_list
FROM generate_series(1, 200) AS gs(v) \gset
EXPLAIN SELECT * FROM test_cross_type_bug
WHERE val = ANY(ARRAY[:in_list]::float4[]);
EXPLAIN SELECT * FROM test_cross_type_bug
WHERE val = ANY(ARRAY[:in_list]::float8[]);
DROP TABLE test_cross_type_bug;