Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TINY] Use sql function IsNullable property to determine its nullability, rather than always assume it's nullable #20177

Merged
merged 1 commit into from
Mar 4, 2020

Conversation

maumar
Copy link
Contributor

@maumar maumar commented Mar 4, 2020

Tiny fix that was missed when fixing #18555

@maumar maumar requested review from smitpatel and roji March 4, 2020 22:25
@@ -1015,8 +1015,7 @@ protected override Expression VisitSqlFunction(SqlFunctionExpression sqlFunction

if (sqlFunctionExpression.IsNiladic)
{
// TODO: #18555
_nullable = true;
_nullable = sqlFunctionExpression.IsNullable;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can move this outside instead of repeating here and below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

visiting arguments will override _nullable value

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks for explaining - stateful visitor pattern isn't easy :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes me think again it may make sense to keep having VisitInternal returning the nullability of the visited node, and restoring _nullable to what it was when it was called. This would make it clearer to see what gets modified when.

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

Successfully merging this pull request may close these issues.

2 participants