forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4435a8d
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 parent4a81ed2 commit4435a8d
File tree
3 files changed
+104
-2
lines changed- src
- backend/optimizer/plan
- pl/plpgsql/src
- expected
- sql
3 files changed
+104
-2
lines changedLines changed: 19 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2856 | 2856 |
| |
2857 | 2857 |
| |
2858 | 2858 |
| |
2859 |
| - | |
2860 |
| - | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
2861 | 2878 |
| |
2862 | 2879 |
| |
2863 | 2880 |
| |
|
Lines changed: 47 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
376 | 376 |
| |
377 | 377 |
| |
378 | 378 |
| |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + |
Lines changed: 38 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
357 | 357 |
| |
358 | 358 |
| |
359 | 359 |
| |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + |
0 commit comments
Comments
(0)