@@ -452,7 +452,7 @@ get_non_null_list_datum_count(PartitionBoundSpec **boundspecs, int nparts)
452452
453453 foreach (lc , boundspecs [i ]-> listdatums )
454454 {
455- Const * val = castNode (Const , lfirst ( lc ) );
455+ Const * val = lfirst_node (Const , lc );
456456
457457 if (!val -> constisnull )
458458 count ++ ;
@@ -513,7 +513,7 @@ create_list_bounds(PartitionBoundSpec **boundspecs, int nparts,
513513
514514 foreach (c , spec -> listdatums )
515515 {
516- Const * val = castNode (Const , lfirst ( c ) );
516+ Const * val = lfirst_node (Const , c );
517517
518518 if (!val -> constisnull )
519519 {
@@ -3014,7 +3014,7 @@ check_new_partition_bound(char *relname, Relation parent,
30143014
30153015 foreach (cell , spec -> listdatums )
30163016 {
3017- Const * val = castNode (Const , lfirst ( cell ) );
3017+ Const * val = lfirst_node (Const , cell );
30183018
30193019 overlap_location = val -> location ;
30203020 if (!val -> constisnull )
@@ -3399,7 +3399,7 @@ make_one_partition_rbound(PartitionKey key, int index, List *datums, bool lower)
33993399 i = 0 ;
34003400 foreach (lc , datums )
34013401 {
3402- PartitionRangeDatum * datum = castNode (PartitionRangeDatum , lfirst ( lc ) );
3402+ PartitionRangeDatum * datum = lfirst_node (PartitionRangeDatum , lc );
34033403
34043404 /* What's contained in this range datum? */
34053405 bound -> kind [i ] = datum -> kind ;
@@ -4103,7 +4103,7 @@ get_qual_for_list(Relation parent, PartitionBoundSpec *spec)
41034103 */
41044104 foreach (cell , spec -> listdatums )
41054105 {
4106- Const * val = castNode (Const , lfirst ( cell ) );
4106+ Const * val = lfirst_node (Const , cell );
41074107
41084108 if (val -> constisnull )
41094109 list_has_null = true;
@@ -4358,8 +4358,8 @@ get_qual_for_range(Relation parent, PartitionBoundSpec *spec,
43584358 Datum test_result;
43594359 bool isNull ;
43604360
4361- ldatum = castNode (PartitionRangeDatum , lfirst ( cell1 ) );
4362- udatum = castNode (PartitionRangeDatum , lfirst ( cell2 ) );
4361+ ldatum = lfirst_node (PartitionRangeDatum , cell1 );
4362+ udatum = lfirst_node (PartitionRangeDatum , cell2 );
43634363
43644364 /*
43654365 * Since get_range_key_properties() modifies partexprs_item, and we
@@ -4440,11 +4440,11 @@ get_qual_for_range(Relation parent, PartitionBoundSpec *spec,
44404440 PartitionRangeDatum * ldatum_next = NULL ,
44414441 * udatum_next = NULL ;
44424442
4443- ldatum = castNode (PartitionRangeDatum , lfirst ( cell1 ) );
4443+ ldatum = lfirst_node (PartitionRangeDatum , cell1 );
44444444 if (lnext (spec -> lowerdatums , cell1 ))
44454445 ldatum_next = castNode (PartitionRangeDatum ,
44464446 lfirst (lnext (spec -> lowerdatums , cell1 )));
4447- udatum = castNode (PartitionRangeDatum , lfirst ( cell2 ) );
4447+ udatum = lfirst_node (PartitionRangeDatum , cell2 );
44484448 if (lnext (spec -> upperdatums , cell2 ))
44494449 udatum_next = castNode (PartitionRangeDatum ,
44504450 lfirst (lnext (spec -> upperdatums , cell2 )));
0 commit comments