Repository navigation
fix: ISNULL() should fill in the replacement for NULL instead of behaving like NULLIF() - #2561
Closed
harsh-thakkar7 wants to merge 1 commit into
Closed
harsh-thakkar7 wants to merge 1 commit into
harsh-thakkar7 wants to merge 1 commit into
Conversation
…ving like NULLIF() Signed-off-by: Harsh Thakkar <harsh-thakkar7@users.noreply.github.com>
Author
|
Closing this PR — it's been open with no maintainer movement for several days, and I don't want to leave noise in the queue. If the change is still wanted, I'm happy to reopen or resubmit with any requested adjustments. Thanks for the repo! |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ISNULL()is currently aliased toNULLIF():In T-SQL (the dialect
ISNULLcomes from),ISNULL(check, replacement)returns the replacement when the first argument is NULL, and the first argument otherwise. Aliasing it toNULLIFmakesISNULL(NULL, 9)evaluate toNULL/undefinedinstead of9:Changes
src/55functions.js: giveISNULL()its own implementation with the same codegen pattern as the adjacentIFNULL()(undefined/nullcheck → return replacement; otherwise keep the value).NULLIF()keeps its existing behavior.test/test2227.js: 7 tests.C)ISNULL(9, 9)returns9is the regression discriminator — under the oldNULLIFaliasing it returnedundefined. Also guards thatNULLIF()and theIS NULLexpression are untouched.Tests
Full suite passes (0 failures).