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

Query: Cast result of IndexOf appropriately for SqlServer #19314

Merged
merged 1 commit into from
Dec 14, 2019

Conversation

smitpatel
Copy link
Member

Resolves #18772

SqlExpression charIndexExpression;
var storeType = stringTypeMapping.StoreType;
if (string.Equals(storeType, "nvarchar(max)", StringComparison.OrdinalIgnoreCase)
|| string.Equals(storeType, "varchar(max)", StringComparison.OrdinalIgnoreCase))
Copy link
Member

Choose a reason for hiding this comment

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

We probably should delegate some of this to the type mapping to make this more robust. Perhaps part of #10434

Copy link
Member Author

Choose a reason for hiding this comment

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

Delegating if it is max type? I would prefer to keep the logic of adding convert node in query only. A translation pipeline should know that when translating to a function, you may get back different types based on typeMapping of arguments.

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.

Query: sql exception (cant cast from bigint to int) when trying to project result of IndexOf
2 participants