aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter@eisentraut.org>2025-04-04 14:45:53 +0200
committerPeter Eisentraut <peter@eisentraut.org>2025-04-04 14:45:53 +0200
commitee1ae8b99f964ca1edc038dd558e541832164d52 (patch)
tree1d46701e8e2c62310b35e6737f05da865836a0aa /src
parentb4f453f6ab71eb72cb3a46a5be18e07e5cc285df (diff)
downloadpostgresql-ee1ae8b99f964ca1edc038dd558e541832164d52.tar.gz
postgresql-ee1ae8b99f964ca1edc038dd558e541832164d52.zip
Fix crash/valgrind error
Fix for commit 9ef1851685b: We have to skip indexes where sortopfamily is NULL. This takes the place of the previous btree check. Detected by valgrind on the buildfarm.
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/selfuncs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/backend/utils/adt/selfuncs.c b/src/backend/utils/adt/selfuncs.c
index b62c3f3116d..462308807ef 100644
--- a/src/backend/utils/adt/selfuncs.c
+++ b/src/backend/utils/adt/selfuncs.c
@@ -6329,6 +6329,10 @@ get_actual_variable_range(PlannerInfo *root, VariableStatData *vardata,
ScanDirection indexscandir;
StrategyNumber strategy;
+ /* Ignore non-ordering indexes */
+ if (index->sortopfamily == NULL)
+ continue;
+
/*
* Ignore partial indexes --- we only want stats that cover the entire
* relation.