-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Relational: UDF calls are generated unquoted #9558
Comments
You can create UDFs with keywords and spaces in their names so we should deal with it. Of course there is a slight problem - Sql Server does not treat built-in functions the same as UDFs. Built in functions cannot be escaped, unless I as missing some esoteric syntax, and doing so will cause a syntax error. This means we need some way to differentiate built-in and UDF functions. We are going to either have to ask for this information in the db function fluent api, or keep a list of all built-in functions. Keeping a list up to date will be nigh impossible so I'm leaning towards modifying the fluent api. Anyone have any other ideas? @bricelam - From my quick test it appears Sqlite does not have this same issue. Can you confirm. Delimiting the function name in relational may break providers for other databases, depending on how their syntax works. Should we make this a Sql Server only change, or make the change in relational and let each provider override if needed? |
Not as far as I can tell. Heck, it lets you redefine the built-in functions, so I'd be surprised if they were ever treated differently. |
Tweak SQL gen to delimit function calls that have a schema.
Function quoting logic was changed (for now): all function names are quoted just like any other identifier (the default EF Core behavior is only to quote schema-less functions). This meant changing all expression translators to generate lower-case names (lower() instead of LOWER()), and also to add a hardcoded list of functions which EF Core generates in upper-case but which shouldn't get quoted (e.g. SUM()). See: * dotnet/efcore#8507 * dotnet/efcore#12044 * dotnet/efcore#12757 * dotnet/efcore#9558 * dotnet/efcore#9303
Function quoting logic was changed (for now): all function names are quoted just like any other identifier (the default EF Core behavior is only to quote schema-less functions). This meant changing all expression translators to generate lower-case names (lower() instead of LOWER()), and also to add a hardcoded list of functions which EF Core generates in upper-case but which shouldn't get quoted (e.g. SUM()). See: * dotnet/efcore#8507 * dotnet/efcore#12044 * dotnet/efcore#12757 * dotnet/efcore#9558 * dotnet/efcore#9303
For now, only unquoted function names are supported (i.e. all lower- case, no special chars). Quoting logic for functions is quite complicated, see below issues for details. See: * dotnet/efcore#8507 * dotnet/efcore#12044 * dotnet/efcore#12757 * dotnet/efcore#9558 * dotnet/efcore#9303
For now, only unquoted function names are supported (i.e. all lower- case, no special chars). Quoting logic for functions is quite complicated, see below issues for details. See: * dotnet/efcore#8507 * dotnet/efcore#12044 * dotnet/efcore#12757 * dotnet/efcore#9558 * dotnet/efcore#9303
For now, only unquoted function names are supported (i.e. all lower- case, no special chars). Quoting logic for functions is quite complicated, see below issues for details. See: * dotnet/efcore#8507 * dotnet/efcore#12044 * dotnet/efcore#12757 * dotnet/efcore#9558 * dotnet/efcore#9303
When we generate a call to a user defined database function, the function name is unquoted. Should it be?
The text was updated successfully, but these errors were encountered: