forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit055f786
committed
Collect dependency information for parsed CallStmts.
Parse analysis of a CallStmt will inject mutable information,for instance the OID of the called procedure, so that subsequentDDL may create a need to re-parse the CALL. We failed to detectthis for CALLs in plpgsql routines, because no dependency informationwas collected when putting a CallStmt into the plan cache. Thatcould lead to misbehavior or strange errors such as "cache lookupfailed".Before commitee895a6, the issue would only manifest for CALLsappearing in atomic contexts, because we re-planned non-atomicCALLs every time through anyway.It is now apparent that extract_query_dependencies() probablyneeds a special case for every utility statement type for whichstmt_requires_parse_analysis() returns true. I wanted to addsomething like Assert(!stmt_requires_parse_analysis(...)) whenfalling out of extract_query_dependencies_walker without doinganything, but there are API issues as well as a more fundamentalpoint: stmt_requires_parse_analysis is supposed to be applied toraw parser output, so it'd be cheating to assume it will give thecorrect answer for post-parse-analysis trees. I contented myselfwith adding a comment.Per bug #18131 from Christian Stork. Back-patch to all supportedbranches.Discussion:https://postgr.es/m/18131-576854e79c5cd264@postgresql.org1 parent72bf3f0 commit055f786
File tree
3 files changed
+106
-2
lines changed- src
- backend/optimizer/plan
- pl/plpgsql/src
- expected
- sql
3 files changed
+106
-2
lines changedLines changed: 21 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3537 | 3537 |
| |
3538 | 3538 |
| |
3539 | 3539 |
| |
3540 |
| - | |
3541 |
| - | |
| 3540 | + | |
| 3541 | + | |
| 3542 | + | |
| 3543 | + | |
| 3544 | + | |
| 3545 | + | |
| 3546 | + | |
| 3547 | + | |
| 3548 | + | |
| 3549 | + | |
| 3550 | + | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
| 3556 | + | |
| 3557 | + | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
3542 | 3561 |
| |
3543 | 3562 |
| |
3544 | 3563 |
| |
|
Lines changed: 47 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
483 | 483 |
| |
484 | 484 |
| |
485 | 485 |
| |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + |
Lines changed: 38 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
454 | 454 |
| |
455 | 455 |
| |
456 | 456 |
| |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + |
0 commit comments
Comments
(0)