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

Dapper 2.1.11 PR#1975 (auto-detect stored procedures as anything without whitespace) regression with non-breaking spaces #1986

Closed
tlecomte opened this issue Oct 19, 2023 · 3 comments · Fixed by #1987
Assignees
Labels

Comments

@tlecomte
Copy link

tlecomte commented Oct 19, 2023

Dear Dapper maintainers

Dapper 2.1.11, and in particular #1975, changes how the command type is determined. It breaks some of our code by unexpectedly inferring "Stored Procedure" for a plain "SELECT * FROM Table". We found that the source code actually contained non-breaking space (ASCII 160) instead the normal space (ASCII 32). That code was working fine in the previous Dapper version 2.1.4.

This is with a connection to SQL Server.

One possibility to solve this could be to use char.iswhitespace instead of the hardcoded list of whitespace characters CommandDefinition.cs#L113 ?

Thanks for your help and the work done in Dapper.

@mgravell
Copy link
Member

mgravell commented Oct 19, 2023

The irony here is: I was actually using an "all whitespace characters" version, and changed it at the last moment to try to prevent unexpected scenarios with weird characters. I'll change back to that. For now:

  • use a previous Dapper version, or
  • explicitly specify the command type (this only applies if omitted), or
  • use regular spaces

But: thanks for the report, will fix, probably today

@mgravell mgravell added the bug label Oct 19, 2023
@mgravell mgravell self-assigned this Oct 19, 2023
@mgravell
Copy link
Member

Proposed: revert 78e1fcc

@mgravell
Copy link
Member

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

Successfully merging a pull request may close this issue.

2 participants