- Notifications
You must be signed in to change notification settings - Fork5
Commita1c6923
committed
Adjust things so that the query_string of a cached plan and the sourceText of
a portal are never NULL, but reliably provide the source text of the query.It turns out that there was only one place that was really taking a short-cut,which was the 'EXECUTE' utility statement. That doesn't seem like asufficiently critical performance hotspot to justify not offering a guaranteeof validity of the portal source text. Fix it to copy the source text overfrom the cached plan. Add Asserts in the places that set up cached plans andportals to reject null source strings, and simplify a bunch of places thatformerly needed to guard against nulls.There may be a few places that cons up statements for execution withouthaving any source text at all; I found one such in ConvertTriggerToFK().It seems sufficient to inject a phony source string in such a case,for instance ProcessUtility((Node *) atstmt, "(generated ALTER TABLE ADD FOREIGN KEY command)", NULL, false, None_Receiver, NULL);We should take a second look at the usage of debug_query_string,particularly the recently added current_query() SQL function.ITAGAKI Takahiro and Tom Lane1 parent6cc88f0 commita1c6923
File tree
11 files changed
+66
-65
lines changed- src
- backend
- commands
- executor
- parser
- tcop
- utils
- cache
- mmgr
- include/utils
11 files changed
+66
-65
lines changedLines changed: 3 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
17 |
| - | |
| 17 | + | |
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| |||
68 | 68 |
| |
69 | 69 |
| |
70 | 70 |
| |
71 |
| - | |
| 71 | + | |
72 | 72 |
| |
73 | 73 |
| |
74 | 74 |
| |
| |||
77 | 77 |
| |
78 | 78 |
| |
79 | 79 |
| |
80 |
| - | |
81 |
| - | |
| 80 | + | |
82 | 81 |
| |
83 | 82 |
| |
84 | 83 |
| |
|
Lines changed: 8 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| |||
174 | 174 |
| |
175 | 175 |
| |
176 | 176 |
| |
| 177 | + | |
177 | 178 |
| |
178 | 179 |
| |
179 | 180 |
| |
| |||
203 | 204 |
| |
204 | 205 |
| |
205 | 206 |
| |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
206 | 211 |
| |
207 | 212 |
| |
208 | 213 |
| |
| |||
249 | 254 |
| |
250 | 255 |
| |
251 | 256 |
| |
252 |
| - | |
253 |
| - | |
254 |
| - | |
255 |
| - | |
256 | 257 |
| |
257 | 258 |
| |
258 |
| - | |
| 259 | + | |
259 | 260 |
| |
260 | 261 |
| |
261 | 262 |
| |
| |||
777 | 778 |
| |
778 | 779 |
| |
779 | 780 |
| |
780 |
| - | |
781 |
| - | |
782 |
| - | |
783 |
| - | |
784 |
| - | |
785 |
| - | |
| 781 | + | |
786 | 782 |
| |
787 | 783 |
| |
788 | 784 |
| |
|
Lines changed: 3 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
728 | 728 |
| |
729 | 729 |
| |
730 | 730 |
| |
731 |
| - | |
| 731 | + | |
| 732 | + | |
732 | 733 |
| |
733 | 734 |
| |
734 | 735 |
| |
|
Lines changed: 3 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
1057 | 1057 |
| |
1058 | 1058 |
| |
1059 | 1059 |
| |
1060 |
| - | |
1061 |
| - | |
1062 |
| - | |
1063 |
| - | |
| 1060 | + | |
| 1061 | + | |
1064 | 1062 |
| |
1065 | 1063 |
| |
1066 | 1064 |
| |
|
Lines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
20 |
| - | |
| 20 | + | |
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
| |||
72 | 72 |
| |
73 | 73 |
| |
74 | 74 |
| |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 | 75 |
| |
79 | 76 |
| |
80 | 77 |
| |
| |||
89 | 86 |
| |
90 | 87 |
| |
91 | 88 |
| |
| 89 | + | |
| 90 | + | |
92 | 91 |
| |
93 | 92 |
| |
94 | 93 |
| |
| |||
115 | 114 |
| |
116 | 115 |
| |
117 | 116 |
| |
| 117 | + | |
| 118 | + | |
118 | 119 |
| |
119 | 120 |
| |
120 | 121 |
| |
|
Lines changed: 14 additions & 18 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
1388 | 1388 |
| |
1389 | 1389 |
| |
1390 | 1390 |
| |
1391 |
| - | |
| 1391 | + | |
1392 | 1392 |
| |
1393 |
| - | |
| 1393 | + | |
1394 | 1394 |
| |
1395 | 1395 |
| |
1396 | 1396 |
| |
| |||
1466 | 1466 |
| |
1467 | 1467 |
| |
1468 | 1468 |
| |
1469 |
| - | |
1470 |
| - | |
1471 |
| - | |
1472 |
| - | |
| 1469 | + | |
| 1470 | + | |
1473 | 1471 |
| |
1474 | 1472 |
| |
1475 | 1473 |
| |
| |||
1714 | 1712 |
| |
1715 | 1713 |
| |
1716 | 1714 |
| |
1717 |
| - | |
| 1715 | + | |
1718 | 1716 |
| |
1719 | 1717 |
| |
1720 | 1718 |
| |
| |||
1780 | 1778 |
| |
1781 | 1779 |
| |
1782 | 1780 |
| |
1783 |
| - | |
| 1781 | + | |
1784 | 1782 |
| |
1785 | 1783 |
| |
1786 | 1784 |
| |
| |||
1805 | 1803 |
| |
1806 | 1804 |
| |
1807 | 1805 |
| |
1808 |
| - | |
| 1806 | + | |
1809 | 1807 |
| |
1810 |
| - | |
| 1808 | + | |
1811 | 1809 |
| |
1812 | 1810 |
| |
1813 | 1811 |
| |
| |||
1840 | 1838 |
| |
1841 | 1839 |
| |
1842 | 1840 |
| |
1843 |
| - | |
| 1841 | + | |
1844 | 1842 |
| |
1845 | 1843 |
| |
1846 | 1844 |
| |
1847 | 1845 |
| |
1848 | 1846 |
| |
1849 | 1847 |
| |
1850 |
| - | |
1851 |
| - | |
| 1848 | + | |
1852 | 1849 |
| |
1853 | 1850 |
| |
1854 | 1851 |
| |
| |||
1924 | 1921 |
| |
1925 | 1922 |
| |
1926 | 1923 |
| |
1927 |
| - | |
| 1924 | + | |
1928 | 1925 |
| |
1929 | 1926 |
| |
1930 | 1927 |
| |
1931 | 1928 |
| |
1932 | 1929 |
| |
1933 | 1930 |
| |
1934 | 1931 |
| |
1935 |
| - | |
1936 |
| - | |
| 1932 | + | |
1937 | 1933 |
| |
1938 | 1934 |
| |
1939 | 1935 |
| |
| |||
2049 | 2045 |
| |
2050 | 2046 |
| |
2051 | 2047 |
| |
2052 |
| - | |
| 2048 | + | |
2053 | 2049 |
| |
2054 | 2050 |
| |
2055 | 2051 |
| |
|
Lines changed: 8 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| |||
218 | 218 |
| |
219 | 219 |
| |
220 | 220 |
| |
221 |
| - | |
| 221 | + | |
222 | 222 |
| |
223 | 223 |
| |
224 | 224 |
| |
225 | 225 |
| |
226 | 226 |
| |
227 | 227 |
| |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
228 | 232 |
| |
229 | 233 |
| |
230 | 234 |
| |
| |||
237 | 241 |
| |
238 | 242 |
| |
239 | 243 |
| |
| 244 | + | |
| 245 | + | |
240 | 246 |
| |
241 | 247 |
| |
242 | 248 |
| |
|
Lines changed: 7 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
36 |
| - | |
| 36 | + | |
37 | 37 |
| |
38 | 38 |
| |
39 | 39 |
| |
| |||
104 | 104 |
| |
105 | 105 |
| |
106 | 106 |
| |
107 |
| - | |
108 |
| - | |
| 107 | + | |
109 | 108 |
| |
110 | 109 |
| |
111 | 110 |
| |
| |||
130 | 129 |
| |
131 | 130 |
| |
132 | 131 |
| |
| 132 | + | |
| 133 | + | |
133 | 134 |
| |
134 | 135 |
| |
135 | 136 |
| |
| |||
152 | 153 |
| |
153 | 154 |
| |
154 | 155 |
| |
155 |
| - | |
| 156 | + | |
156 | 157 |
| |
157 | 158 |
| |
158 | 159 |
| |
| |||
228 | 229 |
| |
229 | 230 |
| |
230 | 231 |
| |
| 232 | + | |
| 233 | + | |
231 | 234 |
| |
232 | 235 |
| |
233 | 236 |
| |
|
0 commit comments
Comments
(0)