@@ -452,7 +452,7 @@ get_non_null_list_datum_count(PartitionBoundSpec **boundspecs, int nparts)
452
452
453
453
foreach (lc , boundspecs [i ]-> listdatums )
454
454
{
455
- Const * val = castNode (Const , lfirst ( lc ) );
455
+ Const * val = lfirst_node (Const , lc );
456
456
457
457
if (!val -> constisnull )
458
458
count ++ ;
@@ -513,7 +513,7 @@ create_list_bounds(PartitionBoundSpec **boundspecs, int nparts,
513
513
514
514
foreach (c , spec -> listdatums )
515
515
{
516
- Const * val = castNode (Const , lfirst ( c ) );
516
+ Const * val = lfirst_node (Const , c );
517
517
518
518
if (!val -> constisnull )
519
519
{
@@ -3014,7 +3014,7 @@ check_new_partition_bound(char *relname, Relation parent,
3014
3014
3015
3015
foreach (cell , spec -> listdatums )
3016
3016
{
3017
- Const * val = castNode (Const , lfirst ( cell ) );
3017
+ Const * val = lfirst_node (Const , cell );
3018
3018
3019
3019
overlap_location = val -> location ;
3020
3020
if (!val -> constisnull )
@@ -3399,7 +3399,7 @@ make_one_partition_rbound(PartitionKey key, int index, List *datums, bool lower)
3399
3399
i = 0 ;
3400
3400
foreach (lc , datums )
3401
3401
{
3402
- PartitionRangeDatum * datum = castNode (PartitionRangeDatum , lfirst ( lc ) );
3402
+ PartitionRangeDatum * datum = lfirst_node (PartitionRangeDatum , lc );
3403
3403
3404
3404
/* What's contained in this range datum? */
3405
3405
bound -> kind [i ] = datum -> kind ;
@@ -4103,7 +4103,7 @@ get_qual_for_list(Relation parent, PartitionBoundSpec *spec)
4103
4103
*/
4104
4104
foreach (cell , spec -> listdatums )
4105
4105
{
4106
- Const * val = castNode (Const , lfirst ( cell ) );
4106
+ Const * val = lfirst_node (Const , cell );
4107
4107
4108
4108
if (val -> constisnull )
4109
4109
list_has_null = true;
@@ -4358,8 +4358,8 @@ get_qual_for_range(Relation parent, PartitionBoundSpec *spec,
4358
4358
Datum test_result ;
4359
4359
bool isNull ;
4360
4360
4361
- ldatum = castNode (PartitionRangeDatum , lfirst ( cell1 ) );
4362
- udatum = castNode (PartitionRangeDatum , lfirst ( cell2 ) );
4361
+ ldatum = lfirst_node (PartitionRangeDatum , cell1 );
4362
+ udatum = lfirst_node (PartitionRangeDatum , cell2 );
4363
4363
4364
4364
/*
4365
4365
* Since get_range_key_properties() modifies partexprs_item, and we
@@ -4440,11 +4440,11 @@ get_qual_for_range(Relation parent, PartitionBoundSpec *spec,
4440
4440
PartitionRangeDatum * ldatum_next = NULL ,
4441
4441
* udatum_next = NULL ;
4442
4442
4443
- ldatum = castNode (PartitionRangeDatum , lfirst ( cell1 ) );
4443
+ ldatum = lfirst_node (PartitionRangeDatum , cell1 );
4444
4444
if (lnext (spec -> lowerdatums , cell1 ))
4445
4445
ldatum_next = castNode (PartitionRangeDatum ,
4446
4446
lfirst (lnext (spec -> lowerdatums , cell1 )));
4447
- udatum = castNode (PartitionRangeDatum , lfirst ( cell2 ) );
4447
+ udatum = lfirst_node (PartitionRangeDatum , cell2 );
4448
4448
if (lnext (spec -> upperdatums , cell2 ))
4449
4449
udatum_next = castNode (PartitionRangeDatum ,
4450
4450
lfirst (lnext (spec -> upperdatums , cell2 )));
0 commit comments