File tree 1 file changed +28
-0
lines changed
src/backend/optimizer/path
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -561,6 +561,34 @@ get_useful_group_keys_orderings(PlannerInfo *root, Path *path)
561
561
}
562
562
}
563
563
564
+ #ifdef USE_ASSERT_CHECKING
565
+ {
566
+ PathKeyInfo * pinfo = linitial_node (PathKeyInfo , infos );
567
+ ListCell * lc ;
568
+
569
+ /* Test consistency of info structures */
570
+ for_each_from (lc , infos , 1 )
571
+ {
572
+ ListCell * lc1 ,
573
+ * lc2 ;
574
+
575
+ info = lfirst_node (PathKeyInfo , lc );
576
+
577
+ Assert (list_length (info -> clauses ) == list_length (pinfo -> clauses ));
578
+ Assert (list_length (info -> pathkeys ) == list_length (pinfo -> pathkeys ));
579
+ Assert (list_difference (info -> clauses , pinfo -> clauses ) == NIL );
580
+ Assert (list_difference_ptr (info -> pathkeys , pinfo -> pathkeys ) == NIL );
581
+
582
+ forboth (lc1 , info -> clauses , lc2 , info -> pathkeys )
583
+ {
584
+ SortGroupClause * sgc = lfirst_node (SortGroupClause , lc1 );
585
+ PathKey * pk = lfirst_node (PathKey , lc2 );
586
+
587
+ Assert (pk -> pk_eclass -> ec_sortref == sgc -> tleSortGroupRef );
588
+ }
589
+ }
590
+ }
591
+ #endif
564
592
return infos ;
565
593
}
566
594
You can’t perform that action at this time.
0 commit comments