diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2019-02-01 12:50:32 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2019-02-01 12:50:32 -0300 |
commit | 558d77f20e4e9ed18101d5d057b770ae22ece855 (patch) | |
tree | c65b6dff674f7f6a46a391683e281a51839162c1 /src/backend/optimizer/util/clauses.c | |
parent | f831d4accda00b9144bc647ede2e2f848b59f39d (diff) | |
download | postgresql-558d77f20e4e9ed18101d5d057b770ae22ece855.tar.gz postgresql-558d77f20e4e9ed18101d5d057b770ae22ece855.zip |
Renaming for new subscripting mechanism
Over at patch https://commitfest.postgresql.org/21/1062/ Dmitry wants to
introduce a more generic subscription mechanism, which allows
subscripting not only arrays but also other object types such as JSONB.
That functionality is introduced in a largish invasive patch, out of
which this internal renaming patch was extracted.
Author: Dmitry Dolgov
Reviewed-by: Tom Lane, Arthur Zakirov
Discussion: https://postgr.es/m/CA+q6zcUK4EqPAu7XRRO5CCjMwhz5zvg+rfWuLzVoxp_5sKS6=w@mail.gmail.com
Diffstat (limited to 'src/backend/optimizer/util/clauses.c')
-rw-r--r-- | src/backend/optimizer/util/clauses.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/backend/optimizer/util/clauses.c b/src/backend/optimizer/util/clauses.c index 86c346bc389..663fa7cd339 100644 --- a/src/backend/optimizer/util/clauses.c +++ b/src/backend/optimizer/util/clauses.c @@ -1120,11 +1120,15 @@ contain_nonstrict_functions_walker(Node *node, void *context) /* a window function could return non-null with null input */ return true; } - if (IsA(node, ArrayRef)) + if (IsA(node, SubscriptingRef)) { - /* array assignment is nonstrict, but subscripting is strict */ - if (((ArrayRef *) node)->refassgnexpr != NULL) + /* + * subscripting assignment is nonstrict, but subscripting itself is + * strict + */ + if (((SubscriptingRef *) node)->refassgnexpr != NULL) return true; + /* else fall through to check args */ } if (IsA(node, DistinctExpr)) @@ -1328,7 +1332,6 @@ contain_leaked_vars_walker(Node *node, void *context) case T_Var: case T_Const: case T_Param: - case T_ArrayRef: case T_ArrayExpr: case T_FieldSelect: case T_FieldStore: @@ -1358,6 +1361,7 @@ contain_leaked_vars_walker(Node *node, void *context) case T_ScalarArrayOpExpr: case T_CoerceViaIO: case T_ArrayCoerceExpr: + case T_SubscriptingRef: /* * If node contains a leaky function call, and there's any Var @@ -3181,7 +3185,7 @@ eval_const_expressions_mutator(Node *node, else return copyObject(node); } - case T_ArrayRef: + case T_SubscriptingRef: case T_ArrayExpr: case T_RowExpr: case T_MinMaxExpr: |