Commit dc5414d
committed
sql/opt: fix RLS metadata clearing
This commit addresses two issues in the handling of RLS metadata in
the sql/opt package:
- The RLS metadata was not being properly cleared after calling the
Clear() function. This function is only used in test.
- Emitting RLS information during explain could theoretically result in
a nil pointer dereference. While this path cannot be reached with a
nil pointer under current conditions, the code was caught by an LLM.
This change adds a defensive safeguard.
Closes #153192
Release note: none
Epic: none1 parent dae24c3 commit dc5414d
File tree
3 files changed
+18
-8
lines changed- pkg/sql/opt
- exec/explain
- memo
3 files changed
+18
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1509 | 1509 | | |
1510 | 1510 | | |
1511 | 1511 | | |
1512 | | - | |
1513 | | - | |
1514 | | - | |
1515 | | - | |
1516 | | - | |
1517 | | - | |
| 1512 | + | |
| 1513 | + | |
| 1514 | + | |
| 1515 | + | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
1518 | 1521 | | |
1519 | | - | |
1520 | 1522 | | |
1521 | 1523 | | |
1522 | 1524 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
672 | 672 | | |
673 | 673 | | |
674 | 674 | | |
| 675 | + | |
| 676 | + | |
675 | 677 | | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
676 | 681 | | |
677 | 682 | | |
678 | 683 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
0 commit comments