Re: Failed assertion clauses != NIL
Dmitry Dolgov <9erthalion6@gmail.com>
From: Dmitry Dolgov <9erthalion6@gmail.com>
To: Manuel Rigger <rigger.manuel@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Date: 2019-11-19T13:38:39Z
Lists: pgsql-bugs
> On Tue, Nov 19, 2019 at 01:50:51PM +0100, Manuel Rigger wrote: > > when building PostgreSQL with -enable-cassert, executing the following > statements result in an assertion error: > > CREATE TABLE t0(c0 boolean, c1 boolean, c2 boolean); > INSERT INTO t0 VALUES(FALSE, FALSE, FALSE); > CREATE STATISTICS s0 ON c0, c2 FROM t0; > ANALYZE; > SELECT * FROM t0 WHERE t0.c2 OR t0.c1 OR t0.c0; Yes, I can reproduce it too. mcv_get_match_bitmap expects that stat_clauses will not be empty, but looks like in this situation stat_clauses is indeed NIL. clauselist_selectivity_simple right before actually doesn't insist on stat_clauses being non empty, probably it's just too strict assert.
Commits
-
Remove unnecessary clauses_attnums variable
- 79d6e6afabcb 12.2 landed
- 6d61c3f1cb71 13.0 landed
-
Fix choose_best_statistics to check clauses individually
- ef3fed2ce4a3 12.2 landed
- c676e659b246 13.0 landed