- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit9b69d5c
committed
Fix incorrect varlevelsup in security_barrier_replace_vars().
When converting an RTE with securityQuals into a security barriersubquery RTE, ensure that the Vars in the new subquery's targetlistall have varlevelsup = 0 so that they correctly refer to theunderlying base relation being wrapped.The original code was creating new Vars by copying them from existingVars referencing the base relation found elsewhere in the query, butfailed to account for the fact that such Vars could come from sublinksubqueries, and hence have varlevelsup > 0. In practice it looks likethis could only happen with nested security barrier views, where theouter view has a WHERE clause containing a correlated subquery, due tothe order in which the Vars are processed.Bug: #13988Reported-by: Adam GuthrieBackpatch-to: 9.4, where updatable SB views were introduced1 parent80c925c commit9b69d5c
File tree
3 files changed
+74
-0
lines changed- src
- backend/optimizer/prep
- test/regress
- expected
- sql
3 files changed
+74
-0
lines changedLines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
454 | 454 |
| |
455 | 455 |
| |
456 | 456 |
| |
| 457 | + | |
457 | 458 |
| |
458 | 459 |
| |
459 | 460 |
| |
|
Lines changed: 39 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2351 | 2351 |
| |
2352 | 2352 |
| |
2353 | 2353 |
| |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
| 2363 | + | |
| 2364 | + | |
| 2365 | + | |
| 2366 | + | |
| 2367 | + | |
| 2368 | + | |
| 2369 | + | |
| 2370 | + | |
| 2371 | + | |
| 2372 | + | |
| 2373 | + | |
| 2374 | + | |
| 2375 | + | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + |
Lines changed: 34 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1055 | 1055 |
| |
1056 | 1056 |
| |
1057 | 1057 |
| |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
| 1074 | + | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
| 1091 | + |
0 commit comments
Comments
(0)