forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc145f32
committed
Propagate query IDs of utility statements in functions
For utility statements defined within a function, the query tree iscopied to a PlannedStmt as utility commands do not require planning.However, the query ID was missing from the information passed down.This leads to plugins relying on the query ID like pg_stat_statements tonot be able to track utility statements within function calls. Testsare added to check this behavior, depending on pg_stat_statements.track.This is an old bug. Now, query IDs for utilities are compiled usingtheir parsed trees rather than the query string since v16(3db72eb), leading to less bloat with utilities, so backpatch downonly to this version.Author: Anthonin BonnefoyDiscussion:https://postgr.es/m/CAO6_XqrGp-uwBqi3vBPLuRULKkddjC7R5QZCgsFren=8E+m2Sg@mail.gmail.comBackpatch-through: 161 parentcd85ae1 commitc145f32
File tree
3 files changed
+68
-0
lines changed- contrib/pg_stat_statements
- expected
- sql
- src/backend/executor
3 files changed
+68
-0
lines changedLines changed: 45 additions & 0 deletions
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 | + | |
70 | 115 |
| |
71 | 116 |
| |
72 | 117 |
| |
|
Lines changed: 22 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
36 | 58 |
| |
37 | 59 |
| |
38 | 60 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
492 | 492 |
| |
493 | 493 |
| |
494 | 494 |
| |
| 495 | + | |
495 | 496 |
| |
496 | 497 |
| |
497 | 498 |
| |
|
0 commit comments
Comments
(0)