postgresql/src
Tomas Vondra d482f7f867 Skip system attributes when applying mvdistinct stats
When estimating number of distinct groups, we failed to ignore system
attributes when matching the group expressions to mvdistinct stats,
causing failures like

  ERROR: negative bitmapset member not allowed

Fix that by simply skipping anything that is not a regular attribute.
Backpatch to PostgreSQL 10, where the extended stats were introduced.

Bug: #16111
Reported-by: Tuomas Leikola
Author: Tomas Vondra
Backpatch-through: 10
Discussion: https://postgr.es/m/16111-687799584c3a7e73@postgresql.org
2019-11-16 01:17:15 +01:00
..
backend Skip system attributes when applying mvdistinct stats 2019-11-16 01:17:15 +01:00
bin Handle arrays and ranges in pg_upgrade's test for non-upgradable types. 2019-11-13 11:35:37 -05:00
common Make StringInfo available to frontend code. 2019-11-05 14:56:40 -08:00
fe_utils Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
include Cleanup code in reloptions.h regarding reloption handling 2019-11-14 13:59:59 +09:00
interfaces Fix ecpglib.h to declare bool consistently with c.h. 2019-11-12 13:00:04 -05:00
makefiles Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:35 -04:00
pl Have LookupFuncName accept NULL argtypes for 0 args 2019-11-12 17:06:58 -03:00
port Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
template Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:35 -04:00
test Skip system attributes when applying mvdistinct stats 2019-11-16 01:17:15 +01:00
timezone Split all OBJS style lines in makefiles into one-line-per-entry style. 2019-11-05 14:41:07 -08:00
tools Fix ecpglib.h to declare bool consistently with c.h. 2019-11-12 13:00:04 -05:00
tutorial Phase 2 pgindent run for v12. 2019-05-22 13:04:48 -04:00
.gitignore
DEVELOPERS
Makefile Fix partial-build problems introduced by having more generated headers. 2018-04-09 16:42:10 -04:00
Makefile.global.in Select CFLAGS_SL at configure time, not in platform-specific Makefiles. 2019-10-21 12:32:35 -04:00
Makefile.shlib Clean up MinGW def file generation 2019-10-20 10:19:13 +02:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00