-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
77463: opt: fix dangerous MapFilterCols function r=mgartner a=mgartner The `MapFilterCols` custom function was dangerous because it relied on the ordering of columns in two unordered sets to map columns referenced in a filter. As one example, the implementation of the function made it impossible to map column `1` to column `5` and column `2` to column `4` in the same filter. As far as I know this has not caused bugs. It was only used to remap columns from a scan to columns in a duplicate scan. Column IDs of scans are allocated in ascending order, and column sets are iterated over in ascending order, so columns were always correctly mapped. This commit replaces `MapFilterCols` with `RemapScanColsInFilter` which does not rely on the ordering of columns in unordered sets. This will prevent future bugs that would occur if either column ID allocation or column set iteration change. The more specific name and arguments of `RemapScanColsInFilter` should also prevent misuse. Release justification: This is a minor change that does not affect behavior and decreases the risk of future bugs in the optimizer. Release note: None Co-authored-by: Marcus Gartner <[email protected]>
- Loading branch information
Showing
5 changed files
with
109 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters