forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitfbc7a71
committed
Rearrange validity checks for plpgsql "simple" expressions.
Buildfarm experience shows what probably should've occurred to me before:if a cache flush occurs partway through building a generic plan, thenthe plansource may have is_valid = false even though the plan is valid.We need to accept this case, use the generated plan, and then try toreplan the next time. We can't try to replan immediately, because thatwould produce an infinite loop in CLOBBER_CACHE_ALWAYS builds; moreoverit's really overkill. (We can assume that the plan is valid, it's justpossibly a bit stale. Note that the pre-existing code behaved this way,and the non-simple-expression code paths do too.) Conversely, not usingthe generated plan would drop us into the not-a-simple-expression codepath, which is bad for performance and would also cause regression-testfailures due to visibly different error-reporting behavior.Hence, refactor the validity-check functions so that the initial checkand recheck cases can react differently to plansource->is_valid.This makes their usage a bit simpler, too.Discussion:https://postgr.es/m/7072.1585332104@sss.pgh.pa.us1 parent8d1b964 commitfbc7a71
File tree
3 files changed
+42
-26
lines changed- src
- backend/utils/cache
- include/utils
- pl/plpgsql/src
3 files changed
+42
-26
lines changedLines changed: 27 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1290 | 1290 |
| |
1291 | 1291 |
| |
1292 | 1292 |
| |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
1293 | 1297 |
| |
1294 | 1298 |
| |
1295 | 1299 |
| |
| |||
1298 | 1302 |
| |
1299 | 1303 |
| |
1300 | 1304 |
| |
1301 |
| - | |
| 1305 | + | |
1302 | 1306 |
| |
1303 | 1307 |
| |
1304 | 1308 |
| |
1305 |
| - | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
1306 | 1317 |
| |
1307 | 1318 |
| |
1308 |
| - | |
1309 | 1319 |
| |
1310 | 1320 |
| |
| 1321 | + | |
| 1322 | + | |
1311 | 1323 |
| |
1312 | 1324 |
| |
1313 | 1325 |
| |
| |||
1371 | 1383 |
| |
1372 | 1384 |
| |
1373 | 1385 |
| |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
1374 | 1395 |
| |
1375 | 1396 |
| |
1376 | 1397 |
| |
| |||
1408 | 1429 |
| |
1409 | 1430 |
| |
1410 | 1431 |
| |
1411 |
| - | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
1412 | 1435 |
| |
1413 | 1436 |
| |
1414 | 1437 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
223 | 223 |
| |
224 | 224 |
| |
225 | 225 |
| |
226 |
| - | |
| 226 | + | |
| 227 | + | |
227 | 228 |
| |
228 | 229 |
| |
229 | 230 |
| |
|
Lines changed: 13 additions & 21 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6181 | 6181 |
| |
6182 | 6182 |
| |
6183 | 6183 |
| |
6184 |
| - | |
| 6184 | + | |
6185 | 6185 |
| |
6186 | 6186 |
| |
6187 | 6187 |
| |
6188 | 6188 |
| |
6189 |
| - | |
6190 |
| - | |
6191 |
| - | |
| 6189 | + | |
| 6190 | + | |
6192 | 6191 |
| |
6193 | 6192 |
| |
6194 | 6193 |
| |
| |||
8089 | 8088 |
| |
8090 | 8089 |
| |
8091 | 8090 |
| |
8092 |
| - | |
| 8091 | + | |
| 8092 | + | |
8093 | 8093 |
| |
8094 |
| - | |
| 8094 | + | |
| 8095 | + | |
8095 | 8096 |
| |
8096 |
| - | |
8097 |
| - | |
8098 |
| - | |
8099 |
| - | |
8100 |
| - | |
8101 |
| - | |
8102 |
| - | |
8103 |
| - | |
8104 |
| - | |
8105 |
| - | |
8106 |
| - | |
8107 |
| - | |
| 8097 | + | |
| 8098 | + | |
| 8099 | + | |
| 8100 | + | |
8108 | 8101 |
| |
8109 |
| - | |
8110 |
| - | |
8111 |
| - | |
| 8102 | + | |
| 8103 | + | |
8112 | 8104 |
| |
8113 | 8105 |
| |
8114 | 8106 |
| |
|
0 commit comments
Comments
(0)