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

[SqlServer]表达式解析成SQL的错误,导致查询时间超时 #1870

Closed
chenyb2558863 opened this issue Aug 9, 2024 · 2 comments
Closed

Comments

@chenyb2558863
Copy link

SqlServer
Expression表达式 t=>t.BH.StartsWith("a") 或者 t=>t.BH.Contains("a")

最后解析成:WHERE ((a.[BH]) LIKE N'a%') 或者 WHERE ((a.[BH]) LIKE N'%a%')

字段名多了括号,导致查询超时了

@2881099
Copy link
Collaborator

2881099 commented Aug 9, 2024

可临时使用自定义表达式解析解决

@2881099
Copy link
Collaborator

2881099 commented Aug 9, 2024

3.5.100-preview20240809 版本优化了这个问题。

自定义表达式解析,处理 like 可能有点小麻烦。

2881099 added a commit that referenced this issue Aug 9, 2024
@2881099 2881099 closed this as completed Sep 15, 2024
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

No branches or pull requests

2 participants