- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit76db9cb
committed
Fix some issues with tracking nesting level in pg_stat_statements.
When we decide that we don't want to track execution time of aspecific planner or ProcessUtility call, we still have to incrementthe nesting depth, or we'll make the wrong determination of whetherwe are at top level when considering nested statements. (PREPAREand EXECUTE are exceptions, for reasons explained in the code.)Counting planner nesting depth separately from executor nesting depthwas a mistake: it causes us to make the wrong determination of whetherwe are at top level when considering nested statements that getexecuted during planning (as a result of constant-folding offunctions, for example). Merge those counters into one.In passing, get rid of the PGSS_HANDLED_UTILITY macro in favor ofexplicitly listing statement types. It seems somewhat coincidentalthat PREPARE and EXECUTE are handled alike in each of the places wherethat was used: the reasoning tends to be different for each one.Thus, the macro seems as likely to encourage future bugs as preventthem, since it's quite unclear whether any future statement type thatmight need special-casing here would also need the same choices ateach spot.Sergei Kornilov, Julien Rouhaud, and Tom Lane, per bug #17552 fromMaxim Boguk. This is pretty clearly a bug fix, but it's also abehavioral change that might surprise somebody, so no back-patch.Discussion:https://postgr.es/m/17552-213b534c56ab5d02@postgresql.org1 parent1a5594b commit76db9cb
File tree
3 files changed
+242
-47
lines changed- contrib/pg_stat_statements
- expected
- sql
3 files changed
+242
-47
lines changedLines changed: 109 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
67 | 67 |
| |
68 | 68 |
| |
69 | 69 |
| |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
70 | 125 |
| |
71 | 126 |
| |
72 | 127 |
| |
| |||
118 | 173 |
| |
119 | 174 |
| |
120 | 175 |
| |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
121 | 201 |
| |
122 | 202 |
| |
123 | 203 |
| |
| |||
129 | 209 |
| |
130 | 210 |
| |
131 | 211 |
| |
| 212 | + | |
132 | 213 |
| |
133 | 214 |
| |
134 | 215 |
| |
| |||
174 | 255 |
| |
175 | 256 |
| |
176 | 257 |
| |
177 |
| - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
178 | 286 |
| |
179 | 287 |
| |
180 | 288 |
| |
|
0 commit comments
Comments
(0)