From a3c1ee9d2e197dee40aed81cb6a08695a8fa2917 Mon Sep 17 00:00:00 2001 From: "Andrey V. Lepikhov" Date: Wed, 3 Mar 2021 11:22:32 +0300 Subject: [PATCH] Increase values of special varnos to 1 million. Use this value as a realistic limit for number of range table entries. Restrict it to detect possible errors which can cause exceeding of MaxAllocSize in palloc() on the elements of the array. This value can be changed later to suit the needs of the real world. --- src/include/nodes/primnodes.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h index d4ce037088..06016340a3 100644 --- a/src/include/nodes/primnodes.h +++ b/src/include/nodes/primnodes.h @@ -168,9 +168,9 @@ typedef struct Expr * in the planner and doesn't correspond to any simple relation column may * have varnosyn = varattnosyn = 0. */ -#define INNER_VAR 65000 /* reference to inner subplan */ -#define OUTER_VAR 65001 /* reference to outer subplan */ -#define INDEX_VAR 65002 /* reference to index column */ +#define INNER_VAR 1000000 /* reference to inner subplan */ +#define OUTER_VAR 1000001 /* reference to outer subplan */ +#define INDEX_VAR 1000002 /* reference to index column */ #define IS_SPECIAL_VARNO(varno) ((varno) >= INNER_VAR) -- 2.29.2