@@ -340,10 +340,8 @@ foreign_expr_walker(Node *node,
340
340
*/
341
341
if (var -> varattno < 0 &&
342
342
var -> varattno != SelfItemPointerAttributeNumber &&
343
- var -> varattno != ObjectIdAttributeNumber ) {
344
- elog (WARNING , "RTORRE return false 1" );
343
+ var -> varattno != ObjectIdAttributeNumber )
345
344
return false;
346
- }
347
345
348
346
/* Else check the collation */
349
347
collation = var -> varcollid ;
@@ -411,31 +409,23 @@ foreign_expr_walker(Node *node,
411
409
ArrayRef * ar = (ArrayRef * ) node ;
412
410
413
411
/* Assignment should not be in restrictions. */
414
- if (ar -> refassgnexpr != NULL ) {
415
- elog (WARNING , "RTORRE return false 2" );
412
+ if (ar -> refassgnexpr != NULL )
416
413
return false;
417
- }
418
414
419
415
/*
420
416
* Recurse to remaining subexpressions. Since the array
421
417
* subscripts must yield (noncollatable) integers, they won't
422
418
* affect the inner_cxt state.
423
419
*/
424
420
if (!foreign_expr_walker ((Node * ) ar -> refupperindexpr ,
425
- glob_cxt , & inner_cxt )) {
426
- elog (WARNING , "RTORRE return false 3" );
421
+ glob_cxt , & inner_cxt ))
427
422
return false;
428
- }
429
423
if (!foreign_expr_walker ((Node * ) ar -> reflowerindexpr ,
430
- glob_cxt , & inner_cxt )) {
431
- elog (WARNING , "RTORRE return false 4" );
424
+ glob_cxt , & inner_cxt ))
432
425
return false;
433
- }
434
426
if (!foreign_expr_walker ((Node * ) ar -> refexpr ,
435
427
glob_cxt , & inner_cxt ))
436
- elog (WARNING , "RTORRE return false 5" ); {
437
428
return false;
438
- }
439
429
440
430
/*
441
431
* Array subscripting should yield same collation as input,
@@ -462,19 +452,15 @@ foreign_expr_walker(Node *node,
462
452
* can't be sent to remote because it might have incompatible
463
453
* semantics on remote side.
464
454
*/
465
- if (!is_shippable (fe -> funcid , ProcedureRelationId , fpinfo )) {
466
- elog (WARNING , "RTORRE return false 6" );
455
+ if (!is_shippable (fe -> funcid , ProcedureRelationId , fpinfo ))
467
456
return false;
468
- }
469
457
470
458
/*
471
459
* Recurse to input subexpressions.
472
460
*/
473
461
if (!foreign_expr_walker ((Node * ) fe -> args ,
474
- glob_cxt , & inner_cxt )) {
475
- elog (WARNING , "RTORRE return false 7" );
462
+ glob_cxt , & inner_cxt ))
476
463
return false;
477
- }
478
464
479
465
/*
480
466
* If function's input collation is not derived from a foreign
@@ -483,10 +469,8 @@ foreign_expr_walker(Node *node,
483
469
if (fe -> inputcollid == InvalidOid )
484
470
/* OK, inputs are all noncollatable */ ;
485
471
else if (inner_cxt .state != FDW_COLLATE_SAFE ||
486
- fe -> inputcollid != inner_cxt .collation ) {
487
- elog (WARNING , "RTORRE return false 8" );
472
+ fe -> inputcollid != inner_cxt .collation )
488
473
return false;
489
- }
490
474
491
475
/*
492
476
* Detect whether node is introducing a collation not derived
@@ -516,19 +500,15 @@ foreign_expr_walker(Node *node,
516
500
* (If the operator is shippable, we assume its underlying
517
501
* function is too.)
518
502
*/
519
- if (!is_shippable (oe -> opno , OperatorRelationId , fpinfo )) {
520
- elog (WARNING , "RTORRE return false 9" );
503
+ if (!is_shippable (oe -> opno , OperatorRelationId , fpinfo ))
521
504
return false;
522
- }
523
505
524
506
/*
525
507
* Recurse to input subexpressions.
526
508
*/
527
509
if (!foreign_expr_walker ((Node * ) oe -> args ,
528
- glob_cxt , & inner_cxt )) {
529
- elog (WARNING , "RTORRE return false 10" );
510
+ glob_cxt , & inner_cxt ))
530
511
return false;
531
- }
532
512
533
513
/*
534
514
* If operator's input collation is not derived from a foreign
@@ -537,10 +517,8 @@ foreign_expr_walker(Node *node,
537
517
if (oe -> inputcollid == InvalidOid )
538
518
/* OK, inputs are all noncollatable */ ;
539
519
else if (inner_cxt .state != FDW_COLLATE_SAFE ||
540
- oe -> inputcollid != inner_cxt .collation ) {
541
- elog (WARNING , "RTORRE return false 11" );
520
+ oe -> inputcollid != inner_cxt .collation )
542
521
return false;
543
- }
544
522
545
523
/* Result-collation handling is same as for functions */
546
524
collation = oe -> opcollid ;
@@ -562,19 +540,15 @@ foreign_expr_walker(Node *node,
562
540
/*
563
541
* Again, only shippable operators can be sent to remote.
564
542
*/
565
- if (!is_shippable (oe -> opno , OperatorRelationId , fpinfo )) {
566
- elog (WARNING , "RTORRE return false 12" );
543
+ if (!is_shippable (oe -> opno , OperatorRelationId , fpinfo ))
567
544
return false;
568
- }
569
545
570
546
/*
571
547
* Recurse to input subexpressions.
572
548
*/
573
549
if (!foreign_expr_walker ((Node * ) oe -> args ,
574
- glob_cxt , & inner_cxt )) {
575
- elog (WARNING , "RTORRE return false 13" );
550
+ glob_cxt , & inner_cxt ))
576
551
return false;
577
- }
578
552
579
553
/*
580
554
* If operator's input collation is not derived from a foreign
@@ -583,10 +557,8 @@ foreign_expr_walker(Node *node,
583
557
if (oe -> inputcollid == InvalidOid )
584
558
/* OK, inputs are all noncollatable */ ;
585
559
else if (inner_cxt .state != FDW_COLLATE_SAFE ||
586
- oe -> inputcollid != inner_cxt .collation ) {
587
- elog (WARNING , "RTORRE return false 14" );
560
+ oe -> inputcollid != inner_cxt .collation )
588
561
return false;
589
- }
590
562
591
563
/* Output is always boolean and so noncollatable. */
592
564
collation = InvalidOid ;
@@ -601,10 +573,8 @@ foreign_expr_walker(Node *node,
601
573
* Recurse to input subexpression.
602
574
*/
603
575
if (!foreign_expr_walker ((Node * ) r -> arg ,
604
- glob_cxt , & inner_cxt )) {
605
- elog (WARNING , "RTORRE return false 15" );
576
+ glob_cxt , & inner_cxt ))
606
577
return false;
607
- }
608
578
609
579
/*
610
580
* RelabelType must not introduce a collation not derived from
@@ -630,10 +600,8 @@ foreign_expr_walker(Node *node,
630
600
* Recurse to input subexpressions.
631
601
*/
632
602
if (!foreign_expr_walker ((Node * ) b -> args ,
633
- glob_cxt , & inner_cxt )) {
634
- elog (WARNING , "RTORRE return false 16" );
603
+ glob_cxt , & inner_cxt ))
635
604
return false;
636
- }
637
605
638
606
/* Output is always boolean and so noncollatable. */
639
607
collation = InvalidOid ;
@@ -648,10 +616,8 @@ foreign_expr_walker(Node *node,
648
616
* Recurse to input subexpressions.
649
617
*/
650
618
if (!foreign_expr_walker ((Node * ) nt -> arg ,
651
- glob_cxt , & inner_cxt )) {
652
- elog (WARNING , "RTORRE return false 17" );
619
+ glob_cxt , & inner_cxt ))
653
620
return false;
654
- }
655
621
656
622
/* Output is always boolean and so noncollatable. */
657
623
collation = InvalidOid ;
@@ -666,10 +632,8 @@ foreign_expr_walker(Node *node,
666
632
* Recurse to input subexpressions.
667
633
*/
668
634
if (!foreign_expr_walker ((Node * ) a -> elements ,
669
- glob_cxt , & inner_cxt )) {
670
- elog (WARNING , "RTORRE return false 18" );
635
+ glob_cxt , & inner_cxt ))
671
636
return false;
672
- }
673
637
674
638
/*
675
639
* ArrayExpr must not introduce a collation not derived from
@@ -698,10 +662,8 @@ foreign_expr_walker(Node *node,
698
662
foreach (lc , l )
699
663
{
700
664
if (!foreign_expr_walker ((Node * ) lfirst (lc ),
701
- glob_cxt , & inner_cxt )) {
702
- elog (WARNING , "RTORRE return false 19" );
665
+ glob_cxt , & inner_cxt ))
703
666
return false;
704
- }
705
667
}
706
668
707
669
/*
@@ -721,22 +683,16 @@ foreign_expr_walker(Node *node,
721
683
ListCell * lc ;
722
684
723
685
/* Not safe to pushdown when not in grouping context */
724
- if (!IS_UPPER_REL (glob_cxt -> foreignrel )) {
725
- elog (WARNING , "RTORRE return false 20" );
686
+ if (!IS_UPPER_REL (glob_cxt -> foreignrel ))
726
687
return false;
727
- }
728
688
729
689
/* Only non-split aggregates are pushable. */
730
- if (agg -> aggsplit != AGGSPLIT_SIMPLE ) {
731
- elog (WARNING , "RTORRE return false 21" );
690
+ if (agg -> aggsplit != AGGSPLIT_SIMPLE )
732
691
return false;
733
- }
734
692
735
693
/* As usual, it must be shippable. */
736
- if (!is_shippable (agg -> aggfnoid , ProcedureRelationId , fpinfo )) {
737
- elog (WARNING , "RTORRE return false 22" );
694
+ if (!is_shippable (agg -> aggfnoid , ProcedureRelationId , fpinfo ))
738
695
return false;
739
- }
740
696
741
697
/*
742
698
* Recurse to input args. aggdirectargs, aggorder and
@@ -755,10 +711,8 @@ foreign_expr_walker(Node *node,
755
711
n = (Node * ) tle -> expr ;
756
712
}
757
713
758
- if (!foreign_expr_walker (n , glob_cxt , & inner_cxt )) {
759
- elog (WARNING , "RTORRE return false 23" );
714
+ if (!foreign_expr_walker (n , glob_cxt , & inner_cxt ))
760
715
return false;
761
- }
762
716
}
763
717
764
718
/*
@@ -785,19 +739,15 @@ foreign_expr_walker(Node *node,
785
739
if (srt -> sortop != typentry -> lt_opr &&
786
740
srt -> sortop != typentry -> gt_opr &&
787
741
!is_shippable (srt -> sortop , OperatorRelationId ,
788
- fpinfo )) {
789
- elog (WARNING , "RTORRE return false 24" );
742
+ fpinfo ))
790
743
return false;
791
- }
792
744
}
793
745
}
794
746
795
747
/* Check aggregate filter */
796
748
if (!foreign_expr_walker ((Node * ) agg -> aggfilter ,
797
- glob_cxt , & inner_cxt )) {
798
- elog (WARNING , "RTORRE return false 25" );
749
+ glob_cxt , & inner_cxt ))
799
750
return false;
800
- }
801
751
802
752
/*
803
753
* If aggregate's input collation is not derived from a
@@ -806,10 +756,8 @@ foreign_expr_walker(Node *node,
806
756
if (agg -> inputcollid == InvalidOid || inner_cxt .state == FDW_COLLATE_NONE )
807
757
/* OK, inputs are all noncollatable */ ;
808
758
else if (inner_cxt .state != FDW_COLLATE_SAFE ||
809
- agg -> inputcollid != inner_cxt .collation ) {
810
- elog (WARNING , "RTORRE return false 26" );
759
+ agg -> inputcollid != inner_cxt .collation )
811
760
return false;
812
- }
813
761
814
762
/*
815
763
* Detect whether node is introducing a collation not derived
@@ -835,15 +783,13 @@ foreign_expr_walker(Node *node,
835
783
* cover the st_asmvt(ROW(st_asmvtgeom(...)) case. I guess the
836
784
* proper solution is to examine the row expression carefully.
837
785
*/
838
- ereport (WARNING , (errmsg_internal ("RTORRE in a T_RowExpr" )));
839
786
return true;
840
787
default :
841
788
842
789
/*
843
790
* If it's anything else, assume it's unsafe. This list can be
844
791
* expanded later, but don't forget to add deparse support below.
845
792
*/
846
- elog (WARNING , "RTORRE unrecognized node type: %d" , (int ) nodeTag (node ));
847
793
return false;
848
794
}
849
795
0 commit comments