forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitbad4943
committed
Fix EXPLAIN (SETTINGS) to follow policy about when to print empty fields.
In non-TEXT output formats, the "Settings" field should appear whenrequested, even if it would be empty.Also, get rid of the premature optimization of counting all theGUC_EXPLAIN variables at startup. Since there was no provision foradjusting that count later, all it'd take would be some extension markinga parameter as GUC_EXPLAIN to risk an assertion failure or memory stomp.We could make get_explain_guc_options() count those variables on-the-fly,or dynamically resize its array ... but TBH I do not think that making atransient array of pointers a bit smaller is worth any extra complication,especially when you consider all the other transient space EXPLAIN eats.So just allocate that array at the max possible size.In HEAD, also add some regression test coverage for this feature.Because of the memory-stomp hazard, back-patch to v12 where thisfeature was added.Discussion:https://postgr.es/m/19416.1580069629@sss.pgh.pa.us1 parent7294f99 commitbad4943
2 files changed
+22
-50
lines changedLines changed: 7 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
616 | 616 |
| |
617 | 617 |
| |
618 | 618 |
| |
619 |
| - | |
620 |
| - | |
621 |
| - | |
622 |
| - | |
623 | 619 |
| |
624 | 620 |
| |
625 |
| - | |
626 |
| - | |
627 | 621 |
| |
628 | 622 |
| |
629 |
| - | |
| 623 | + | |
630 | 624 |
| |
631 | 625 |
| |
632 | 626 |
| |
| |||
640 | 634 |
| |
641 | 635 |
| |
642 | 636 |
| |
643 |
| - | |
644 | 637 |
| |
645 | 638 |
| |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
646 | 643 |
| |
647 | 644 |
| |
648 |
| - | |
| 645 | + | |
649 | 646 |
| |
650 | 647 |
| |
651 | 648 |
| |
| |||
661 | 658 |
| |
662 | 659 |
| |
663 | 660 |
| |
664 |
| - | |
665 |
| - | |
| 661 | + | |
666 | 662 |
| |
667 | 663 |
| |
668 | 664 |
| |
|
Lines changed: 15 additions & 39 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4571 | 4571 |
| |
4572 | 4572 |
| |
4573 | 4573 |
| |
4574 |
| - | |
4575 |
| - | |
4576 |
| - | |
4577 | 4574 |
| |
4578 | 4575 |
| |
4579 | 4576 |
| |
| |||
4837 | 4834 |
| |
4838 | 4835 |
| |
4839 | 4836 |
| |
4840 |
| - | |
4841 | 4837 |
| |
4842 | 4838 |
| |
4843 | 4839 |
| |
| |||
4848 | 4844 |
| |
4849 | 4845 |
| |
4850 | 4846 |
| |
4851 |
| - | |
4852 |
| - | |
4853 |
| - | |
4854 | 4847 |
| |
4855 | 4848 |
| |
4856 | 4849 |
| |
| |||
4859 | 4852 |
| |
4860 | 4853 |
| |
4861 | 4854 |
| |
4862 |
| - | |
4863 |
| - | |
4864 |
| - | |
4865 | 4855 |
| |
4866 | 4856 |
| |
4867 | 4857 |
| |
| |||
4870 | 4860 |
| |
4871 | 4861 |
| |
4872 | 4862 |
| |
4873 |
| - | |
4874 |
| - | |
4875 |
| - | |
4876 | 4863 |
| |
4877 | 4864 |
| |
4878 | 4865 |
| |
| |||
4881 | 4868 |
| |
4882 | 4869 |
| |
4883 | 4870 |
| |
4884 |
| - | |
4885 |
| - | |
4886 |
| - | |
4887 | 4871 |
| |
4888 | 4872 |
| |
4889 | 4873 |
| |
| |||
4892 | 4876 |
| |
4893 | 4877 |
| |
4894 | 4878 |
| |
4895 |
| - | |
4896 |
| - | |
4897 |
| - | |
4898 | 4879 |
| |
4899 | 4880 |
| |
4900 | 4881 |
| |
| |||
4926 | 4907 |
| |
4927 | 4908 |
| |
4928 | 4909 |
| |
4929 |
| - | |
4930 | 4910 |
| |
4931 | 4911 |
| |
4932 | 4912 |
| |
| |||
8875 | 8855 |
| |
8876 | 8856 |
| |
8877 | 8857 |
| |
8878 |
| - | |
8879 |
| - | |
8880 |
| - | |
| 8858 | + | |
| 8859 | + | |
| 8860 | + | |
| 8861 | + | |
8881 | 8862 |
| |
8882 | 8863 |
| |
8883 | 8864 |
| |
8884 | 8865 |
| |
8885 |
| - | |
8886 | 8866 |
| |
8887 | 8867 |
| |
8888 | 8868 |
| |
8889 | 8869 |
| |
8890 | 8870 |
| |
8891 |
| - | |
8892 |
| - | |
8893 |
| - | |
| 8871 | + | |
| 8872 | + | |
8894 | 8873 |
| |
8895 |
| - | |
| 8874 | + | |
8896 | 8875 |
| |
8897 |
| - | |
| 8876 | + | |
8898 | 8877 |
| |
8899 | 8878 |
| |
8900 | 8879 |
| |
8901 | 8880 |
| |
8902 |
| - | |
| 8881 | + | |
| 8882 | + | |
| 8883 | + | |
| 8884 | + | |
| 8885 | + | |
8903 | 8886 |
| |
8904 | 8887 |
| |
8905 | 8888 |
| |
8906 | 8889 |
| |
8907 | 8890 |
| |
8908 |
| - | |
8909 |
| - | |
8910 |
| - | |
8911 |
| - | |
8912 |
| - | |
| 8891 | + | |
8913 | 8892 |
| |
8914 | 8893 |
| |
8915 | 8894 |
| |
| |||
8958 | 8937 |
| |
8959 | 8938 |
| |
8960 | 8939 |
| |
8961 |
| - | |
8962 | 8940 |
| |
8963 | 8941 |
| |
8964 | 8942 |
| |
8965 |
| - | |
| 8943 | + | |
8966 | 8944 |
| |
8967 | 8945 |
| |
8968 |
| - | |
8969 |
| - | |
8970 | 8946 |
| |
8971 | 8947 |
| |
8972 | 8948 |
| |
|
0 commit comments
Comments
(0)