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: projecting stringColumn.Length may cause invalid cast exception, if the stringColumn is of type (n)varchar(max) on SqlServer #8176

Closed
maumar opened this issue Apr 14, 2017 · 1 comment
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@maumar
Copy link
Contributor

maumar commented Apr 14, 2017

This happens because LEN returns long for varchar(max) and nvarchar(max) columns, but we are expecting int.

@maumar maumar self-assigned this Apr 14, 2017
@maumar maumar added this to the 2.0.0 milestone Apr 14, 2017
maumar added a commit that referenced this issue Apr 14, 2017
…d cast exception, if the stringColumn if of type (n)varchar(max) on SqlServer

Problem was that for (n)varchar(max) columns, LEN function returns long, and we are expecting int. Fix is to always explicitly cast the result of LEN to int.
@maumar maumar changed the title Query: projecting stringColumn.Length may cause invalid cast exception, if the stringColumn if of type (n)varchar(max) on SqlServer Query: projecting stringColumn.Length may cause invalid cast exception, if the stringColumn is of type (n)varchar(max) on SqlServer Apr 14, 2017
maumar added a commit that referenced this issue Apr 15, 2017
…d cast exception, if the stringColumn is of type (n)varchar(max) on SqlServer

Problem was that for (n)varchar(max) columns, LEN function returns long, and we are expecting int. Fix is to always explicitly cast the result of LEN to int.
@maumar
Copy link
Contributor Author

maumar commented Apr 15, 2017

Fixed in e98a33d

@maumar maumar closed this as completed Apr 15, 2017
@maumar maumar added closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug labels Apr 15, 2017
@divega divega added closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. and removed closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. labels May 10, 2017
@ajcvickers ajcvickers modified the milestones: 2.0.0-preview1, 2.0.0 Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

3 participants