Commit 30b4955
committed
Fix misuse of RelOptInfo.unique_for_rels cache by SJE
When SJE uses RelOptInfo.unique_for_rels cache, it passes filtered quals to
innerrel_is_unique_ext(). That might lead to an invalid match to cache entries
made by previous non self-join checking calls. Add UniqueRelInfo.self_join
flag to prevent such cases. Also, fix that SJE should require a strict match
of outerrelids to make sure UniqueRelInfo.extra_clauses are valid.
Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/4788f781-31bd-9796-d7d6-588a751c8787%40gmail.com1 parent d3c5f37 commit 30b4955
File tree
4 files changed
+59
-9
lines changed- src
- backend/optimizer/plan
- include/nodes
- test/regress
- expected
- sql
4 files changed
+59
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1247 | 1247 | | |
1248 | 1248 | | |
1249 | 1249 | | |
1250 | | - | |
1251 | | - | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
1252 | 1254 | | |
1253 | 1255 | | |
1254 | 1256 | | |
| |||
1264 | 1266 | | |
1265 | 1267 | | |
1266 | 1268 | | |
| 1269 | + | |
1267 | 1270 | | |
1268 | 1271 | | |
1269 | 1272 | | |
| |||
1278 | 1281 | | |
1279 | 1282 | | |
1280 | 1283 | | |
1281 | | - | |
1282 | | - | |
1283 | | - | |
1284 | | - | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
1285 | 1293 | | |
1286 | 1294 | | |
1287 | 1295 | | |
1288 | 1296 | | |
1289 | 1297 | | |
1290 | | - | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
1291 | 1301 | | |
1292 | 1302 | | |
1293 | 1303 | | |
| |||
1309 | 1319 | | |
1310 | 1320 | | |
1311 | 1321 | | |
1312 | | - | |
| 1322 | + | |
| 1323 | + | |
1313 | 1324 | | |
1314 | 1325 | | |
1315 | 1326 | | |
| |||
1323 | 1334 | | |
1324 | 1335 | | |
1325 | 1336 | | |
1326 | | - | |
1327 | 1337 | | |
| 1338 | + | |
| 1339 | + | |
1328 | 1340 | | |
1329 | 1341 | | |
1330 | 1342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3407 | 3407 | | |
3408 | 3408 | | |
3409 | 3409 | | |
| 3410 | + | |
| 3411 | + | |
| 3412 | + | |
| 3413 | + | |
| 3414 | + | |
| 3415 | + | |
3410 | 3416 | | |
3411 | 3417 | | |
3412 | 3418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6905 | 6905 | | |
6906 | 6906 | | |
6907 | 6907 | | |
| 6908 | + | |
| 6909 | + | |
| 6910 | + | |
| 6911 | + | |
| 6912 | + | |
| 6913 | + | |
| 6914 | + | |
| 6915 | + | |
| 6916 | + | |
| 6917 | + | |
| 6918 | + | |
| 6919 | + | |
| 6920 | + | |
| 6921 | + | |
| 6922 | + | |
| 6923 | + | |
| 6924 | + | |
| 6925 | + | |
| 6926 | + | |
| 6927 | + | |
| 6928 | + | |
| 6929 | + | |
| 6930 | + | |
6908 | 6931 | | |
6909 | 6932 | | |
6910 | 6933 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2638 | 2638 | | |
2639 | 2639 | | |
2640 | 2640 | | |
| 2641 | + | |
| 2642 | + | |
| 2643 | + | |
| 2644 | + | |
| 2645 | + | |
| 2646 | + | |
| 2647 | + | |
| 2648 | + | |
| 2649 | + | |
2641 | 2650 | | |
2642 | 2651 | | |
2643 | 2652 | | |
| |||
0 commit comments