- Notifications
You must be signed in to change notification settings - Fork5
Commit69c7a98
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 parent01f7808 commit69c7a98
1 file changed
+26
-21
lines changedLines changed: 26 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11361 | 11361 |
| |
11362 | 11362 |
| |
11363 | 11363 |
| |
11364 |
| - | |
11365 |
| - | |
11366 |
| - | |
11367 |
| - | |
| 11364 | + | |
| 11365 | + | |
| 11366 | + | |
| 11367 | + | |
11368 | 11368 |
| |
11369 | 11369 |
| |
11370 | 11370 |
| |
11371 | 11371 |
| |
11372 | 11372 |
| |
11373 | 11373 |
| |
11374 | 11374 |
| |
11375 |
| - | |
| 11375 | + | |
11376 | 11376 |
| |
11377 | 11377 |
| |
11378 | 11378 |
| |
| |||
11397 | 11397 |
| |
11398 | 11398 |
| |
11399 | 11399 |
| |
| 11400 | + | |
| 11401 | + | |
| 11402 | + | |
| 11403 | + | |
| 11404 | + | |
11400 | 11405 |
| |
11401 | 11406 |
| |
11402 |
| - | |
11403 |
| - | |
| 11407 | + | |
| 11408 | + | |
11404 | 11409 |
| |
11405 | 11410 |
| |
11406 | 11411 |
| |
| |||
11409 | 11414 |
| |
11410 | 11415 |
| |
11411 | 11416 |
| |
11412 |
| - | |
11413 |
| - | |
| 11417 | + | |
| 11418 | + | |
11414 | 11419 |
| |
11415 | 11420 |
| |
11416 | 11421 |
| |
| |||
11420 | 11425 |
| |
11421 | 11426 |
| |
11422 | 11427 |
| |
11423 |
| - | |
| 11428 | + | |
11424 | 11429 |
| |
11425 | 11430 |
| |
11426 |
| - | |
| 11431 | + | |
11427 | 11432 |
| |
11428 | 11433 |
| |
11429 | 11434 |
| |
| |||
11441 | 11446 |
| |
11442 | 11447 |
| |
11443 | 11448 |
| |
11444 |
| - | |
| 11449 | + | |
11445 | 11450 |
| |
11446 | 11451 |
| |
11447 |
| - | |
| 11452 | + | |
11448 | 11453 |
| |
11449 | 11454 |
| |
11450 | 11455 |
| |
| |||
11453 | 11458 |
| |
11454 | 11459 |
| |
11455 | 11460 |
| |
11456 |
| - | |
11457 |
| - | |
| 11461 | + | |
| 11462 | + | |
11458 | 11463 |
| |
11459 | 11464 |
| |
11460 | 11465 |
| |
| |||
11464 | 11469 |
| |
11465 | 11470 |
| |
11466 | 11471 |
| |
11467 |
| - | |
| 11472 | + | |
11468 | 11473 |
| |
11469 | 11474 |
| |
11470 |
| - | |
| 11475 | + | |
11471 | 11476 |
| |
11472 | 11477 |
| |
11473 | 11478 |
| |
| |||
11476 | 11481 |
| |
11477 | 11482 |
| |
11478 | 11483 |
| |
11479 |
| - | |
11480 |
| - | |
| 11484 | + | |
| 11485 | + | |
11481 | 11486 |
| |
11482 | 11487 |
| |
11483 | 11488 |
| |
| |||
11487 | 11492 |
| |
11488 | 11493 |
| |
11489 | 11494 |
| |
11490 |
| - | |
| 11495 | + | |
11491 | 11496 |
| |
11492 | 11497 |
| |
11493 |
| - | |
| 11498 | + | |
11494 | 11499 |
| |
11495 | 11500 |
| |
11496 | 11501 |
| |
|
0 commit comments
Comments
(0)