@@ -228,7 +228,7 @@ static void verify_bucket_expression(Node *node)
228228
229229 for (int i = 1 ; i < list_length (func_expr -> args ); i ++ )
230230 {
231- if (!is_simple_constant (unwrap_cast ((Node * )list_nth (func_expr -> args , i ))))
231+ if (!is_stable_expression (unwrap_cast ((Node * )list_nth (func_expr -> args , i ))))
232232 FAILWITH_LOCATION (func_expr -> location , "Non-primary arguments for a bucket function have to be simple constants." );
233233 }
234234 }
@@ -237,7 +237,7 @@ static void verify_bucket_expression(Node *node)
237237 OpExpr * op_expr = (OpExpr * )node ;
238238 FAILWITH_LOCATION (op_expr -> location , "Use of operators to define buckets is not supported." );
239239 }
240- else if (is_simple_constant (node ))
240+ else if (is_stable_expression (node ))
241241 {
242242 FAILWITH_LOCATION (exprLocation (node ), "Simple constants are not allowed as bucket expressions." );
243243 }
@@ -267,11 +267,11 @@ static void verify_bucket_expression(Node *node)
267267static void verify_substring (FuncExpr * func_expr , ParamListInfo bound_params )
268268{
269269 Node * node = unwrap_cast (list_nth (func_expr -> args , 1 ));
270- Assert (is_simple_constant (node )); /* Checked by prior validations */
270+ Assert (is_stable_expression (node )); /* Checked by prior validations */
271271 Oid type ;
272272 Datum value ;
273273 bool isnull ;
274- get_simple_constant_typed_value (node , bound_params , & type , & value , & isnull );
274+ get_stable_expression_value (node , bound_params , & type , & value , & isnull );
275275
276276 if (DatumGetUInt32 (value ) != 1 )
277277 FAILWITH_LOCATION (exprLocation (node ), "Generalization used in the query is not allowed in untrusted access level." );
@@ -294,11 +294,11 @@ static bool is_money_style(double number)
294294static void verify_bin_size (Node * range_expr , ParamListInfo bound_params )
295295{
296296 Node * range_node = unwrap_cast (range_expr );
297- Assert (is_simple_constant (range_node )); /* Checked by prior validations */
297+ Assert (is_stable_expression (range_node )); /* Checked by prior validations */
298298 Oid type ;
299299 Datum value ;
300300 bool isnull ;
301- get_simple_constant_typed_value (range_node , bound_params , & type , & value , & isnull );
301+ get_stable_expression_value (range_node , bound_params , & type , & value , & isnull );
302302
303303 if (!is_supported_numeric_type (type ))
304304 FAILWITH_LOCATION (exprLocation (range_node ), "Unsupported constant type used in generalization." );
0 commit comments