Release notes for re-motion version 1.13.15

List of Issues

Bugfixes

Improvements

Refactoring

Details

[COMMONS-1269] Subquery expressions should be generated when a subquery in a main from clause contains a modifier

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


E.g.

from s in (from s1 in Students from s2 in Students select s1).Distinct()
from x in Xs
select new {s, x}

In this case, the nested from part must be represented as a subquery, otherwise the semantics are changed.

In MethodCallExpressionNodeBase, add a template-method Apply implementation that looks like this:

public QueryModel Apply (QueryModel queryModel, ClauseGenerationContext clauseGenerationContext)
{
  if (queryModel.SelectOrGroupClause.ResultModifications.Count > 0)
    queryModel = WrapCompletedQueryModel (queryModel);
  DoApply (queryModel, clauseGenerationContext);
  return queryModel;
}

WrapCompletedQueryModel is virtual and creates a new QueryModel with the old queryModel in a subquery in the main from clause. It is overridden in ResultModificationExpressionNodeBase.
DoApply is abstract and contains what is currently in the nodes' apply methods.

After the query model has been wrapped, the last expression node (Source) must be mapped to the main from clause generated that holds the SubQueryExpression. After that, every Resolve of that last node must return a QuerySourceReferenceExpression pointing to that main from clause.

[COMMONS-1268] Subqueries that access a non-constant MemberExpression as their main from source cannot be parsed

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


Example:

from x in Xs
from y in (from z in x.Friends select z)
select y

Refactor ConstantExpressionNode:

  • Rename to MainSourceExpressionNode
  • Change Value/Type to Expression member

Refactor ExpressionTreeParser:

  • Accept non-constant expressions

[COMMONS-1293] Check class/namespace structure

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


  • Move DataObjectModel, SqlGeneration, IDatabaseInfo to separate "Backend" folder.
  • Move ExtensionMethods.ContainsFulltext to Backend folder.
  • Move Parsing/Details, Parsing/FieldResolving, Parsing/ParseMode to Backend folder.
  • Remove UniqueIdentifierGeneratorBase class.
  • Move FormattingExpressionTreeVisitor to Clauses/ExpressionTreeVisitors, remove StringBuilding folder.
  • Add new class DetailParserUtility, move ParserUtility.CheckNumberOfArguments, ParserUtility.CheckParameterType to DetailParserUtility

[COMMONS-1255] Redesign result modifications: Rename, split into groups, etc.

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


(no description)

[COMMONS-1298] Move ResultOperators from SelectClause to QueryModel

Component/s: Data.Linq
Issue Type: Sub-task
Resolution: Fixed
Status: Closed


(no description)

[COMMONS-1297] Rename ResultModificationBase and ResultModificationExpressionNode to ResultOperatorBase and ResultOperatorExpressionNode

Component/s: Data.Linq
Issue Type: Sub-task
Resolution: Fixed
Status: Closed


Including all "modification" variables, etc.

[COMMONS-1323] Refactor GroupClause to be a result operator

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


In many ways, GroupClause is more similar to a result operator than it is to a SelectClause:

  • It does not work item per item, but operates on the whole result set. (This is the characteristic on a result operator.)
  • It needs a way to be executed in memory if it is not supported by the target query system. (Like the result operators.)

Therefore, GroupClause should be changed to be a result operator. Then, every QueryModel would always have a a SelectClause that might be changed
by a GroupOperator:

from x in Xs
group x.Y by x.Z

=>

from x in Xs select x => GroupBy (x.Y, x.Z)

This result operator, however, changes the element type of the returned enumerable.

[COMMONS-1328] Update all group-by tests to use ResultOperators instead of SelectOrGroupClause

Component/s: Data.Linq
Issue Type: Sub-task
Resolution: Fixed
Status: Closed


(no description)

[COMMONS-1327] Remove ISelectGroupClause, change QueryModel.SelectOrGroupClause to be of type SelectClause

Component/s: Data.Linq
Issue Type: Sub-task
Resolution: Fixed
Status: Closed


(no description)

[COMMONS-1326] Create GroupOperator result operator class and modify GroupByExpressionNode to apply the GroupOperator

Component/s: Data.Linq
Issue Type: Sub-task
Resolution: Fixed
Status: Closed


(no description)