Release notes for re-motion version 1.13.83

List of Issues

Bugfixes

Details

[RM-3515] ContainsResultOperator throws an exception when a query uses Contains to check for an item of a derived type

Component/s: Data.Linq
Issue Type: Bug
Resolution: Fixed
Status: Closed


For example, the following query used to produce an exception:

var chef = new Chef { ID = 23, FirstName = "Hugo", Name = "Heinrich" };
CheckQuery (
  from s in Cooks where s.Assistants.Contains (chef) select s);

This has been changed - the result operator now checks that the item expression is assignable to the item type of the sequence, not equal to it.

[RM-3308] SQL Backend: The SQL generated for some string manipulation functions doesn't deal with spaces correctly

Component/s: Data.Linq
Issue Type: Bug
Resolution: Fixed
Status: Closed


For example, for an expression such as c.ContactName.IndexOf (" "), re-linq will generate the following SQL:

CASE WHEN (LEN(@1) = 0) THEN 0 ELSE (CHARINDEX(@2, [t0].[ContactName]) - 1) END
(@1 = " ")
(@2 = " ")

(The CASE is required because CHARINDEX will return -1 for empty strings, whereas .NET will return 0.)
The problem is that LEN will not work correctly with trailing spaces - it ignores them.

The fix is to append a single character to the string and subtract 1 from the result. Instead of LEN(@1), use LEN(@1 + '#') - 1.