Bladeren bron

HPCC-16558 Fix problems comparing serialized nested child datasets

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 8 jaren geleden
bovenliggende
commit
bffcffdfaa
2 gewijzigde bestanden met toevoegingen van 38 en 3 verwijderingen
  1. 2 3
      ecl/hqlcpp/hqlcpp.cpp
  2. 36 0
      ecl/regress/sortds.ecl

+ 2 - 3
ecl/hqlcpp/hqlcpp.cpp

@@ -8021,9 +8021,8 @@ void HqlCppTranslator::buildIteratorNext(BuildCtx & ctx, IHqlExpression * iter,
 void HqlCppTranslator::doBuildAssignCompareRow(BuildCtx & ctx, EvaluateCompareInfo & info, IHqlExpression * left, IHqlExpression * right)
 {
     HqlExprArray leftValues, rightValues;
-    IHqlExpression * record = left->queryRecord();
-    expandRowOrder(left->queryNormalizedSelector(), record, leftValues, false);
-    expandRowOrder(right->queryNormalizedSelector(), record, rightValues, false);
+    expandRowOrder(left->queryNormalizedSelector(), left->queryRecord(), leftValues, false);
+    expandRowOrder(right->queryNormalizedSelector(), right->queryRecord(), rightValues, false);
     optimizeOrderValues(leftValues, rightValues, false);
 
     doBuildAssignCompare(ctx, info, leftValues, rightValues, true, false);      //MORE: ,no_break,true

+ 36 - 0
ecl/regress/sortds.ecl

@@ -0,0 +1,36 @@
+/*##############################################################################
+
+    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
+
+    Licensed under the Apache License, Version 2.0 (the "License");
+    you may not use this file except in compliance with the License.
+    You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing, software
+    distributed under the License is distributed on an "AS IS" BASIS,
+    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+    See the License for the specific language governing permissions and
+    limitations under the License.
+############################################################################## */
+
+idRec := RECORD
+    unsigned id;
+END;
+
+childRec := RECORD
+    unsigned id;
+    dataset(idRec) ids;
+END;
+
+namesRecord :=
+            RECORD
+string20        surname;
+string10        forename;
+dataset(childRec) children;
+            END;
+
+namesTable := dataset('x', namesRecord, thor);
+
+sort(namesTable, surname, children);