-
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.
35617: opt,sql: don't fold "- 0" for JSON r=justinj a=justinj Fixes #35612. Prior to this commit, we would unconditionally fold x - 0 to x. This was invalid in the case where x was JSON, since `- 0` in that case means "delete the 0th entry in the array". This bug existed in both the HP and CBO. This fix slightly abuses the existing "types.IsAdditiveType" function to determine whether or not the identity applies. Release note (bug fix): Subtracting 0 from a JSON array now correctly removes its first element. Co-authored-by: Justin Jaffray <[email protected]>
- Loading branch information
Showing
5 changed files
with
30 additions
and
3 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