Browse Source

HPCC-11537 Remove unhelpful warning

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Gavin Halliday 11 years ago
parent
commit
86bc3e509a

+ 1 - 51
ecl/hqlcpp/hqlttcpp.cpp

@@ -9006,47 +9006,6 @@ HqlScopeTagger::HqlScopeTagger(IErrorReceiver & _errors, ErrorSeverityMapper & _
 }
 
 
-bool HqlScopeTagger::isValidNormalizeSelector(IHqlExpression * expr)
-{
-    loop
-    {
-        switch (expr->getOperator())
-        {
-        case no_filter:
-            break;
-        case no_usertable:
-            if (isAggregateDataset(expr))
-                return false;
-            return true;
-        case no_hqlproject:
-            if (isCountProject(expr))
-                return false;
-            return true;
-        case no_select:
-            {
-                IHqlExpression * ds = expr->queryChild(0);
-                if (isDatasetActive(ds))
-                    return true;
-
-                //Not really sure what the following should do.  Avoid a.b.c[1].d.e
-                if (ds->isDatarow() && (ds->getOperator() != no_select))
-                    return false;
-                break;
-            }
-        case no_table:
-            return (queryTableMode(expr) == no_flat);
-        case no_keyindex:
-        case no_newkeyindex:
-        case no_rows:
-            return true;
-        default:
-            return false;
-        }
-        expr = expr->queryChild(0);
-    }
-}
-
-
 static const char * getECL(IHqlExpression * expr, StringBuffer & s)
 {
     toUserECL(s, expr, false);
@@ -9128,16 +9087,7 @@ IHqlExpression * HqlScopeTagger::transformSelect(IHqlExpression * expr)
             VStringBuffer msg("dictionary %s must be explicitly NORMALIZED", getECL(expr, exprText));
             reportError(CategoryError, msg);
         }
-        else if (expr->isDataset())
-        {
-            if (!isValidNormalizeSelector(cursor))
-            {
-                StringBuffer exprText;
-                VStringBuffer msg("dataset %s may not be supported without using NORMALIZE", getECL(expr, exprText));
-                reportError(CategoryUnexpected, msg);
-            }
-        }
-        else
+        else if (!expr->isDataset())
         {
             if (!isDatasetARow(ds))
                 reportSelectorError(ds, expr);

+ 0 - 1
ecl/hqlcpp/hqlttcpp.ipp

@@ -1044,7 +1044,6 @@ protected:
     IHqlExpression * transformSizeof(IHqlExpression * expr);
     IHqlExpression * transformWithin(IHqlExpression * dataset, IHqlExpression * scope);
 
-    bool isValidNormalizeSelector(IHqlExpression * expr);
     void reportError(WarnErrorCategory category, const char * msg);
     void reportSelectorError(IHqlExpression * selector, IHqlExpression * expr);
 

+ 20 - 0
ecl/regress/issue11537.ecl

@@ -0,0 +1,20 @@
+SubRec := RECORD
+    UNSIGNED            s;
+END;
+
+DataRec := RECORD
+    UNSIGNED            i;
+    DATASET(SubRec)     d;
+END;
+
+r := DATASET
+    (
+        [
+            {1,DATASET([100,200],SubRec)},
+            {2,DATASET([300,400],SubRec)}
+        ],
+        DataRec
+    );
+
+r;
+r.d;

+ 3 - 4
ecl/regress/issue9556g.eclxml

@@ -15,11 +15,10 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
- <OnWarning value="2131=error"/>
+ <OnWarning value="2121=error"/>
  <Query>
-idRec := { unsigned id; };
-inRec := { unsigned id, dataset(idRec) ids; };
+inRec := { string20 id};
 d := DATASET('in', inRec, thor);
-output(SORT(d, id).ids);
+output(SORT(d, id[18..30]));
  </Query>
 </Archive>

+ 4 - 5
ecl/regress/issue9556i.eclxml

@@ -15,13 +15,12 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
- <OnWarning value="2131=error"/>
+ <OnWarning value="2121=error"/>
  <Query>
 //Command line maps it to an error, but #ONWARNING maps it to just log the information
-#ONWARNING(2131, LOG);
-idRec := { unsigned id; };
-inRec := { unsigned id, dataset(idRec) ids; };
+#ONWARNING(2121, LOG);
+inRec := { string20 id};
 d := DATASET('in', inRec, thor);
-output(SORT(d, id).ids);
+output(SORT(d, id[18..30]));
  </Query>
 </Archive>

+ 5 - 6
ecl/regress/issue9556j.eclxml

@@ -15,15 +15,14 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
- <OnWarning value="2131=error"/>
+ <OnWarning value="2121=error"/>
  <Query>
 //Command line maps it to an error, but #ONWARNING maps it to information
 //but local onwarning maps it back to an error!
-#ONWARNING(2131, LOG);
-idRec := { unsigned id; };
-inRec := { unsigned id, dataset(idRec) ids; };
+#ONWARNING(2121, LOG);
+inRec := { string20 id};
 d := DATASET('in', inRec, thor);
-ids := SORT(d, id).ids : onwarning(2131, error);
-output(ids);
+s := SORT(d, id[18..30]) : onwarning(2121, error);
+output(s);
  </Query>
 </Archive>

+ 4 - 6
ecl/regress/issue9556k.eclxml

@@ -15,14 +15,12 @@
     See the License for the specific language governing permissions and
     limitations under the License.
 -->
- <OnWarning value="2131=fail"/>
+ <OnWarning value="2121=fail"/>
  <Query>
 //Command line maps it to a fatal error, #ONWARNING and local onwarning try to map it back, but fail
-#ONWARNING(2131, LOG);
-idRec := { unsigned id; };
-inRec := { unsigned id, dataset(idRec) ids; };
+#ONWARNING(2121, LOG);
+inRec := { string20 id};
 d := DATASET('in', inRec, thor);
-ids := SORT(d, id).ids : onwarning(2131, ignore);
-output(ids);
+output(SORT(d, id[18..30]));
  </Query>
 </Archive>