- Notifications
You must be signed in to change notification settings - Fork5
Commit4c804fb
committed
Clean up parsing of synchronous_standby_names GUC variable.
Commit989be08 added a flex/bison lexer/parser to interpretsynchronous_standby_names. It was done in a pretty crufty way, though,making assorted end-use sites responsible for calling the parser at theright times. That was not only vulnerable to errors of omission, but madeit possible that lexer/parser errors occur at very undesirable times,and created memory leakages even if there was no error.Instead, perform the parsing once during check_synchronous_standby_namesand let guc.c manage the resulting data. To do that, we have to flattenthe parsed representation into a single hunk of malloc'd memory, but thatis not very hard.While at it, work a little harder on making useful error reports forparsing problems; the previous code felt that "synchronous_standby_namesparser returned 1" was an appropriate user-facing error message. (Tobe fair, it did also log a syntax error message, but separately from theGUC problem report, which is at best confusing.) It had some outrightbugs in the face of invalid input, too.I (tgl) also concluded that we need to restrict unquoted names insynchronous_standby_names to be just SQL identifiers. The previous codingwould accept darn near anything, which (1) makes the quoting conventionboth nearly-unnecessary and formally ambiguous, (2) makes it very hard tounderstand what is a syntax error and what is a creative interpretation ofthe input as a standby name, and (3) makes it impossible to further extendthe syntax in future without a compatibility break. I presume that we'reintending future extensions of the syntax, else this parsing infrastructureis massive overkill, so (3) is an important objection. Since we've takena compatibility hit for non-identifier names with this change anyway, wemight as well lock things down now and insist that users use double quotesfor standby names that aren't identifiers.Kyotaro Horiguchi and Tom Lane1 parent372ff7c commit4c804fb
File tree
7 files changed
+208
-194
lines changed- doc/src/sgml
- src
- backend
- replication
- utils/misc
- include/replication
7 files changed
+208
-194
lines changedLines changed: 14 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2983 | 2983 |
| |
2984 | 2984 |
| |
2985 | 2985 |
| |
2986 |
| - | |
| 2986 | + | |
2987 | 2987 |
| |
2988 | 2988 |
| |
2989 | 2989 |
| |
2990 | 2990 |
| |
2991 | 2991 |
| |
2992 | 2992 |
| |
2993 | 2993 |
| |
2994 |
| - | |
| 2994 | + | |
2995 | 2995 |
| |
2996 | 2996 |
| |
2997 | 2997 |
| |
| |||
3002 | 3002 |
| |
3003 | 3003 |
| |
3004 | 3004 |
| |
3005 |
| - | |
| 3005 | + | |
3006 | 3006 |
| |
3007 | 3007 |
| |
3008 | 3008 |
| |
| |||
3013 | 3013 |
| |
3014 | 3014 |
| |
3015 | 3015 |
| |
3016 |
| - | |
3017 |
| - | |
| 3016 | + | |
| 3017 | + | |
3018 | 3018 |
| |
3019 | 3019 |
| |
3020 | 3020 |
| |
3021 | 3021 |
| |
3022 | 3022 |
| |
3023 | 3023 |
| |
3024 |
| - | |
3025 |
| - | |
3026 |
| - | |
| 3024 | + | |
| 3025 | + | |
| 3026 | + | |
3027 | 3027 |
| |
3028 | 3028 |
| |
3029 | 3029 |
| |
| |||
3039 | 3039 |
| |
3040 | 3040 |
| |
3041 | 3041 |
| |
3042 |
| - | |
3043 |
| - | |
3044 |
| - | |
3045 |
| - | |
3046 |
| - | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
3047 | 3048 |
| |
3048 | 3049 |
| |
3049 | 3050 |
| |
|
Lines changed: 72 additions & 96 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
78 | 78 |
| |
79 | 79 |
| |
80 | 80 |
| |
81 |
| - | |
| 81 | + | |
82 | 82 |
| |
83 | 83 |
| |
84 | 84 |
| |
| |||
361 | 361 |
| |
362 | 362 |
| |
363 | 363 |
| |
364 |
| - | |
365 |
| - | |
366 |
| - | |
367 |
| - | |
368 |
| - | |
369 | 364 |
| |
370 | 365 |
| |
371 | 366 |
| |
| |||
509 | 504 |
| |
510 | 505 |
| |
511 | 506 |
| |
512 |
| - | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
513 | 510 |
| |
514 | 511 |
| |
515 | 512 |
| |
| |||
568 | 565 |
| |
569 | 566 |
| |
570 | 567 |
| |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
571 | 572 |
| |
572 | 573 |
| |
573 | 574 |
| |
574 | 575 |
| |
575 |
| - | |
576 |
| - | |
577 |
| - | |
578 |
| - | |
| 576 | + | |
579 | 577 |
| |
580 | 578 |
| |
581 | 579 |
| |
| |||
730 | 728 |
| |
731 | 729 |
| |
732 | 730 |
| |
733 |
| - | |
734 |
| - | |
735 |
| - | |
| 731 | + | |
| 732 | + | |
736 | 733 |
| |
737 | 734 |
| |
738 | 735 |
| |
| |||
742 | 739 |
| |
743 | 740 |
| |
744 | 741 |
| |
745 |
| - | |
| 742 | + | |
746 | 743 |
| |
747 | 744 |
| |
748 |
| - | |
749 |
| - | |
| 745 | + | |
| 746 | + | |
750 | 747 |
| |
751 |
| - | |
752 |
| - | |
753 |
| - | |
754 |
| - | |
755 | 748 |
| |
756 |
| - | |
| 749 | + | |
757 | 750 |
| |
758 | 751 |
| |
759 | 752 |
| |
760 | 753 |
| |
| 754 | + | |
761 | 755 |
| |
762 | 756 |
| |
763 | 757 |
| |
| |||
867 | 861 |
| |
868 | 862 |
| |
869 | 863 |
| |
870 |
| - | |
871 |
| - | |
872 |
| - | |
873 |
| - | |
874 |
| - | |
875 |
| - | |
876 |
| - | |
877 |
| - | |
878 |
| - | |
879 |
| - | |
880 |
| - | |
881 |
| - | |
882 |
| - | |
883 |
| - | |
884 |
| - | |
885 |
| - | |
886 |
| - | |
887 |
| - | |
888 |
| - | |
889 |
| - | |
890 |
| - | |
891 |
| - | |
892 |
| - | |
893 |
| - | |
894 |
| - | |
895 |
| - | |
896 |
| - | |
897 |
| - | |
898 |
| - | |
899 |
| - | |
900 |
| - | |
901 |
| - | |
902 |
| - | |
903 |
| - | |
904 |
| - | |
905 |
| - | |
906 |
| - | |
907 |
| - | |
908 |
| - | |
909 |
| - | |
910 |
| - | |
911 |
| - | |
912 |
| - | |
913 |
| - | |
914 | 864 |
| |
915 | 865 |
| |
916 | 866 |
| |
| |||
955 | 905 |
| |
956 | 906 |
| |
957 | 907 |
| |
958 |
| - | |
959 |
| - | |
960 | 908 |
| |
961 | 909 |
| |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
962 | 918 |
| |
963 | 919 |
| |
964 | 920 |
| |
965 | 921 |
| |
966 |
| - | |
| 922 | + | |
967 | 923 |
| |
968 | 924 |
| |
969 |
| - | |
970 |
| - | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
971 | 929 |
| |
972 | 930 |
| |
973 | 931 |
| |
974 | 932 |
| |
975 | 933 |
| |
976 |
| - | |
977 |
| - | |
978 |
| - | |
979 |
| - | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
980 | 937 |
| |
981 | 938 |
| |
982 | 939 |
| |
983 |
| - | |
984 |
| - | |
985 |
| - | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
986 | 943 |
| |
987 | 944 |
| |
988 |
| - | |
989 |
| - | |
| 945 | + | |
| 946 | + | |
990 | 947 |
| |
991 |
| - | |
992 |
| - | |
| 948 | + | |
993 | 949 |
| |
994 |
| - | |
995 |
| - | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
996 | 953 |
| |
997 |
| - | |
| 954 | + | |
| 955 | + | |
998 | 956 |
| |
999 |
| - | |
1000 |
| - | |
1001 |
| - | |
| 957 | + | |
1002 | 958 |
| |
1003 | 959 |
| |
1004 | 960 |
| |
1005 | 961 |
| |
| 962 | + | |
1006 | 963 |
| |
1007 | 964 |
| |
1008 | 965 |
| |
1009 |
| - | |
1010 |
| - | |
| 966 | + | |
| 967 | + | |
1011 | 968 |
| |
1012 | 969 |
| |
1013 | 970 |
| |
1014 |
| - | |
1015 |
| - | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
1016 | 974 |
| |
1017 | 975 |
| |
1018 | 976 |
| |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
1019 | 986 |
| |
1020 |
| - | |
1021 |
| - | |
1022 |
| - | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
1023 | 992 |
| |
1024 |
| - | |
1025 | 993 |
| |
| 994 | + | |
| 995 | + | |
1026 | 996 |
| |
1027 | 997 |
| |
1028 | 998 |
| |
1029 | 999 |
| |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
1030 | 1006 |
| |
1031 | 1007 |
| |
1032 | 1008 |
| |
|
0 commit comments
Comments
(0)