Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Handle NULL option as default #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PinkDuck
Copy link

If NULL is supplied to the @FirstOnFallBackOverlap parameter then the function uses the non-default action instead of the default. For this reason I have added a check for NULL. It is okay for the @SkipOnSpringForwardGap case as there is a test against 0 that requires it to be explicitly set for non-default behaviour.

If NULL is supplied to the @FirstOnFallBackOverlap parameter then the function uses the non-default action instead of the default. For this reason I have added a check for NULL. It is okay for the @SkipOnSpringForwardGap case as there is a test against 0 that requires it to be explicitly set for non-default behaviour.
@mattjohnsonpint
Copy link
Owner

In what case might a NULL be passed explicitly? I see what this is guarding against, but I'm not sure it would actually be encountered.

What I'd really like is a way to not have to pass a value at all, but I don't think this can be accomplished with functions.

@PinkDuck
Copy link
Author

The usual pattern would be calling with DEFAULT explicitly, but since T-SQL inline variables all all nullable types there's the potential for unintended behaviour. I think many would like properly optional arguments. I see NULL/DEFAULT as similar, with both leaving it to the function to decide the behaviour. It's not so easy on the calling side to dynamically control the value between 0, 1 and DEFAULT without using a NULL-supporting ternary state.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants