forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit3f50b82
committed
Fix EXPLAIN to handle SEARCH BREADTH FIRST queries.
The rewriter transformation for SEARCH BREADTH FIRST produces aFieldSelect on a Var of type RECORD, where the Var references therecursive union's worktable output. EXPLAIN VERBOSE failed to handlethis case, because it only expected such Vars to appear in CteScansnot WorkTableScans. Fix that, and add some test cases exercisingEXPLAIN on SEARCH and CYCLE queries.In principle this oversight is an old bug, but it seems that thecase is unreachable without SEARCH BREADTH FIRST, because theparser fails when attempting to create such a reference manually.So for today I'll just patch HEAD/v14. Someday we might find thatthe code portion of this patch needs to be back-patched further.Per report from Atsushi Torikoshi.Discussion:https://postgr.es/m/5bafa66ad529e11860339565c9e7c166@oss.nttdata.com1 parent4ac0f45 commit3f50b82
File tree
3 files changed
+170
-3
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+170
-3
lines changedLines changed: 37 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
375 | 375 |
| |
376 | 376 |
| |
377 | 377 |
| |
| 378 | + | |
| 379 | + | |
378 | 380 |
| |
379 | 381 |
| |
380 | 382 |
| |
| |||
4866 | 4868 |
| |
4867 | 4869 |
| |
4868 | 4870 |
| |
| 4871 | + | |
| 4872 | + | |
| 4873 | + | |
4869 | 4874 |
| |
4870 | 4875 |
| |
4871 | 4876 |
| |
| |||
4876 | 4881 |
| |
4877 | 4882 |
| |
4878 | 4883 |
| |
| 4884 | + | |
| 4885 | + | |
| 4886 | + | |
4879 | 4887 |
| |
4880 | 4888 |
| |
4881 | 4889 |
| |
| |||
4899 | 4907 |
| |
4900 | 4908 |
| |
4901 | 4909 |
| |
| 4910 | + | |
| 4911 | + | |
| 4912 | + | |
| 4913 | + | |
| 4914 | + | |
| 4915 | + | |
| 4916 | + | |
| 4917 | + | |
| 4918 | + | |
| 4919 | + | |
| 4920 | + | |
| 4921 | + | |
| 4922 | + | |
| 4923 | + | |
| 4924 | + | |
| 4925 | + | |
| 4926 | + | |
| 4927 | + | |
| 4928 | + | |
| 4929 | + | |
| 4930 | + | |
| 4931 | + | |
| 4932 | + | |
4902 | 4933 |
| |
4903 | 4934 |
| |
4904 | 4935 |
| |
| |||
7646 | 7677 |
| |
7647 | 7678 |
| |
7648 | 7679 |
| |
7649 |
| - | |
7650 |
| - | |
7651 |
| - | |
| 7680 | + | |
| 7681 | + | |
| 7682 | + | |
| 7683 | + | |
| 7684 | + | |
| 7685 | + | |
7652 | 7686 |
| |
7653 | 7687 |
| |
7654 | 7688 |
| |
|
Lines changed: 103 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
644 | 644 |
| |
645 | 645 |
| |
646 | 646 |
| |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
647 | 682 |
| |
648 | 683 |
| |
649 | 684 |
| |
| |||
682 | 717 |
| |
683 | 718 |
| |
684 | 719 |
| |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
685 | 755 |
| |
686 | 756 |
| |
687 | 757 |
| |
| |||
945 | 1015 |
| |
946 | 1016 |
| |
947 | 1017 |
| |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
948 | 1051 |
| |
949 | 1052 |
| |
950 | 1053 |
| |
|
Lines changed: 30 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
358 | 358 |
| |
359 | 359 |
| |
360 | 360 |
| |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
361 | 371 |
| |
362 | 372 |
| |
363 | 373 |
| |
| |||
376 | 386 |
| |
377 | 387 |
| |
378 | 388 |
| |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
379 | 399 |
| |
380 | 400 |
| |
381 | 401 |
| |
| |||
503 | 523 |
| |
504 | 524 |
| |
505 | 525 |
| |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
506 | 536 |
| |
507 | 537 |
| |
508 | 538 |
| |
|
0 commit comments
Comments
(0)