-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Description
An EntityType with property char is not supported by the SQL Server provider. However SqlServerTypeMapper does have a mapping in _clrTypeMappings for char (mapping it to a SQL Server int column).
The reason for this is to support generation of single character literals in the Query Pipeline e.g. as arguments to functions, or LIKE can take an ESCAPE argument which is a single character - see this test. Query checks that it can interpret each argument (in this case a single character) - if it fails to find a type mapping for that type then it assumes it cannot generate literals for that type.
We should remove the entry in _clrTypeMappings for SqlServerTypeMapper for char so that we will generate the correct error if someone tries to create a property of that type. But we need to provide an alternate means to translate the literal above. We discussed:
- Just changing how we deal with
LIKEto enforce that theESCAPEargument is a string, or - Changing the way Query treats arguments in general to specifically allow it to try a
stringTypeMapping if acharone does not exist. - Updating the TypeMapper to allow a set of types which it can interpret for generation of literals even if it does not allow that type as a property type.