Commit 13671b4
committed
Code review for GUC serialization/deserialization code.
The serialization code dumped core for a string-valued GUC whose value
is NULL, which is a legal state. The infrastructure isn't capable of
transmitting that state exactly, but fortunately, transmitting an empty
string instead should be close enough (compare, eg, commit e45e990).
The code potentially underestimated the space required to format a
real-valued variable, both because it made an unwarranted assumption that
%g output would never be longer than %e output, and because it didn't count
right even for %e format. In practice this would pretty much always be
masked by overestimates for other variables, but it's still wrong.
Also fix boundary-case error in read_gucstate, incorrect handling of the
case where guc_sourcefile is non-NULL but zero length (not clear that can
happen, but if it did, this code would get totally confused), and
confusingly useless check for a NULL result from read_gucstate.
Andreas Seltenreich discovered the core dump; other issues noted while
reading nearby code. Back-patch to 9.5 where this code was introduced.
Michael Paquier and Tom Lane
Discussion: <871sy78wno.fsf@credativ.de>1 parent 67dc4cc commit 13671b4
1 file changed
+31
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8903 | 8903 | | |
8904 | 8904 | | |
8905 | 8905 | | |
8906 | | - | |
| 8906 | + | |
| 8907 | + | |
| 8908 | + | |
8907 | 8909 | | |
8908 | 8910 | | |
8909 | 8911 | | |
| |||
8914 | 8916 | | |
8915 | 8917 | | |
8916 | 8918 | | |
8917 | | - | |
8918 | | - | |
8919 | | - | |
| 8919 | + | |
| 8920 | + | |
8920 | 8921 | | |
8921 | 8922 | | |
8922 | 8923 | | |
| |||
8937 | 8938 | | |
8938 | 8939 | | |
8939 | 8940 | | |
8940 | | - | |
| 8941 | + | |
8941 | 8942 | | |
8942 | 8943 | | |
8943 | 8944 | | |
| |||
8947 | 8948 | | |
8948 | 8949 | | |
8949 | 8950 | | |
8950 | | - | |
8951 | | - | |
8952 | | - | |
| 8951 | + | |
| 8952 | + | |
| 8953 | + | |
| 8954 | + | |
8953 | 8955 | | |
8954 | | - | |
| 8956 | + | |
8955 | 8957 | | |
8956 | 8958 | | |
8957 | 8959 | | |
8958 | 8960 | | |
8959 | 8961 | | |
8960 | 8962 | | |
8961 | 8963 | | |
8962 | | - | |
| 8964 | + | |
| 8965 | + | |
| 8966 | + | |
| 8967 | + | |
| 8968 | + | |
| 8969 | + | |
| 8970 | + | |
| 8971 | + | |
| 8972 | + | |
8963 | 8973 | | |
8964 | 8974 | | |
8965 | 8975 | | |
| |||
8972 | 8982 | | |
8973 | 8983 | | |
8974 | 8984 | | |
8975 | | - | |
| 8985 | + | |
8976 | 8986 | | |
8977 | 8987 | | |
8978 | 8988 | | |
8979 | 8989 | | |
8980 | 8990 | | |
8981 | | - | |
| 8991 | + | |
8982 | 8992 | | |
8983 | 8993 | | |
8984 | | - | |
8985 | | - | |
| 8994 | + | |
| 8995 | + | |
8986 | 8996 | | |
8987 | 8997 | | |
8988 | 8998 | | |
| |||
9100 | 9110 | | |
9101 | 9111 | | |
9102 | 9112 | | |
9103 | | - | |
| 9113 | + | |
9104 | 9114 | | |
9105 | 9115 | | |
9106 | 9116 | | |
| |||
9109 | 9119 | | |
9110 | 9120 | | |
9111 | 9121 | | |
9112 | | - | |
| 9122 | + | |
| 9123 | + | |
| 9124 | + | |
9113 | 9125 | | |
9114 | 9126 | | |
9115 | 9127 | | |
| |||
9126 | 9138 | | |
9127 | 9139 | | |
9128 | 9140 | | |
9129 | | - | |
| 9141 | + | |
9130 | 9142 | | |
9131 | 9143 | | |
9132 | 9144 | | |
| |||
9193 | 9205 | | |
9194 | 9206 | | |
9195 | 9207 | | |
9196 | | - | |
| 9208 | + | |
9197 | 9209 | | |
9198 | 9210 | | |
9199 | 9211 | | |
| |||
9247 | 9259 | | |
9248 | 9260 | | |
9249 | 9261 | | |
9250 | | - | |
9251 | | - | |
9252 | | - | |
| 9262 | + | |
9253 | 9263 | | |
9254 | 9264 | | |
9255 | 9265 | | |
| |||
0 commit comments