forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0950d67
committed
Tweak parse location assignment for CURRENT_DATE and related constructs.
All these constructs generate parse trees consisting of a Const anda run-time type coercion (perhaps a FuncExpr or a CoerceViaIO). Modifythe raw parse output so that we end up with the original token's locationattached to the type coercion node while the Const has location -1;before, it was the other way around. This makes no difference in termsof what exprLocation() will say about the parse tree as a whole, so itshould not have any user-visible impact. The point of changing it is thatwe do not want contrib/pg_stat_statements to treat these constructs asreplaceable constants. It will do the right thing if the Const haslocation -1 rather than a valid location.This is a pretty ugly hack, but then this code is ugly already; we shouldsomeday replace this translation with special-purpose parse node(s) thatwould allow ruleutils.c to reconstruct the original query text.(See also commit5d3fcc4, which alsohacked location assignment rules for the benefit of pg_stat_statements.)Back-patch to 9.2 where pg_stat_statements grew the ability to recognizereplaceable constants.Kyotaro Horiguchi1 parent3888b73 commit0950d67
1 file changed
+21
-16
lines changedLines changed: 21 additions & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11234 | 11234 |
| |
11235 | 11235 |
| |
11236 | 11236 |
| |
| 11237 | + | |
| 11238 | + | |
| 11239 | + | |
| 11240 | + | |
| 11241 | + | |
11237 | 11242 |
| |
11238 | 11243 |
| |
11239 |
| - | |
11240 |
| - | |
| 11244 | + | |
| 11245 | + | |
11241 | 11246 |
| |
11242 | 11247 |
| |
11243 | 11248 |
| |
| |||
11246 | 11251 |
| |
11247 | 11252 |
| |
11248 | 11253 |
| |
11249 |
| - | |
11250 |
| - | |
| 11254 | + | |
| 11255 | + | |
11251 | 11256 |
| |
11252 | 11257 |
| |
11253 | 11258 |
| |
| |||
11257 | 11262 |
| |
11258 | 11263 |
| |
11259 | 11264 |
| |
11260 |
| - | |
| 11265 | + | |
11261 | 11266 |
| |
11262 | 11267 |
| |
11263 |
| - | |
| 11268 | + | |
11264 | 11269 |
| |
11265 | 11270 |
| |
11266 | 11271 |
| |
| |||
11287 | 11292 |
| |
11288 | 11293 |
| |
11289 | 11294 |
| |
11290 |
| - | |
| 11295 | + | |
11291 | 11296 |
| |
11292 | 11297 |
| |
11293 |
| - | |
| 11298 | + | |
11294 | 11299 |
| |
11295 | 11300 |
| |
11296 | 11301 |
| |
| |||
11299 | 11304 |
| |
11300 | 11305 |
| |
11301 | 11306 |
| |
11302 |
| - | |
11303 |
| - | |
| 11307 | + | |
| 11308 | + | |
11304 | 11309 |
| |
11305 | 11310 |
| |
11306 | 11311 |
| |
| |||
11310 | 11315 |
| |
11311 | 11316 |
| |
11312 | 11317 |
| |
11313 |
| - | |
| 11318 | + | |
11314 | 11319 |
| |
11315 | 11320 |
| |
11316 |
| - | |
| 11321 | + | |
11317 | 11322 |
| |
11318 | 11323 |
| |
11319 | 11324 |
| |
| |||
11322 | 11327 |
| |
11323 | 11328 |
| |
11324 | 11329 |
| |
11325 |
| - | |
11326 |
| - | |
| 11330 | + | |
| 11331 | + | |
11327 | 11332 |
| |
11328 | 11333 |
| |
11329 | 11334 |
| |
| |||
11333 | 11338 |
| |
11334 | 11339 |
| |
11335 | 11340 |
| |
11336 |
| - | |
| 11341 | + | |
11337 | 11342 |
| |
11338 | 11343 |
| |
11339 |
| - | |
| 11344 | + | |
11340 | 11345 |
| |
11341 | 11346 |
| |
11342 | 11347 |
| |
|
0 commit comments
Comments
(0)