Sfoglia il codice sorgente

HPCC-21884 Index Normalize ignoring LIMIT SKIP and generating exception

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 4 anni fa
parent
commit
9ce70e7c7c

+ 3 - 8
roxie/ccd/ccdserver.cpp

@@ -24858,8 +24858,8 @@ class CRoxieServerIndexNormalizeActivity : public CRoxieServerIndexReadBaseActiv
 
 public:
     CRoxieServerIndexNormalizeActivity(IRoxieAgentContext *_ctx, const CRoxieServerBaseIndexActivityFactory *_factory, IProbeManager *_probeManager, const RemoteActivityId &_remoteId,
-                                       bool _sorted, bool _isLocal)
-        : CRoxieServerIndexReadBaseActivity(_ctx, _factory, _probeManager, _remoteId, _sorted, _isLocal, false),
+                                       bool _sorted, bool _isLocal, bool _maySkip)
+        : CRoxieServerIndexReadBaseActivity(_ctx, _factory, _probeManager, _remoteId, _sorted, _isLocal, _maySkip),
           readHelper((IHThorIndexNormalizeArg &)basehelper)
     {
         limitTransformExtra = &readHelper;
@@ -24956,11 +24956,6 @@ public:
         }
     }
 
-    virtual const void *createLimitFailRow(bool isKeyed)
-    {
-        UNIMPLEMENTED;
-    }
-
 };
 
 class CRoxieServerIndexNormalizeActivityFactory : public CRoxieServerBaseIndexActivityFactory
@@ -24976,7 +24971,7 @@ public:
         if (!variableFileName && (keySet==NULL || keySet->length()==0))
             return new CRoxieServerNullActivity(_ctx, this, _probeManager);
         else
-            return new CRoxieServerIndexNormalizeActivity(_ctx, this, _probeManager, remoteId, sorted, isLocal);
+            return new CRoxieServerIndexNormalizeActivity(_ctx, this, _probeManager, remoteId, sorted, isLocal, maySkip);
     }
 };
 

+ 5 - 6
testing/regress/ecl/indexlimits.ecl

@@ -104,16 +104,15 @@ SEQUENTIAL(
   OUTPUT(COUNT(indexReadNoHitKeyedLimit), NAMED('count_indexReadNoHitKeyedLimit'));
   OUTPUT(COUNT(CHOOSEN(indexReadNoHitKeyedLimit, 1)), NAMED('count_choosen_indexReadNoHitKeyedLimit'));
 
-// below commented out tests, fail in Roxie (incorrectly throw limit exception)
 // normalize tests
-//  OUTPUT(normIndexReadHitLocalLimit, NAMED('normIndexReadHitLocalLimit'));
-//  OUTPUT(normIndexReadHitGlobalLimit, NAMED('normIndexReadHitGlobalLimit'));
-//  OUTPUT(normIndexReadHitOnFail, NAMED('normIndexReadHitOnFail'));
+  OUTPUT(normIndexReadHitLocalLimit, NAMED('normIndexReadHitLocalLimit'));
+  OUTPUT(normIndexReadHitGlobalLimit, NAMED('normIndexReadHitGlobalLimit'));
+  OUTPUT(normIndexReadHitOnFail, NAMED('normIndexReadHitOnFail'));
   OUTPUT(normIndexReadNoHitRowLimit, NAMED('normIndexReadNoHitRowLimit'));
   OUTPUT(CHOOSEN(normIndexReadNoHitRowLimit, 1), NAMED('choosen_normIndexReadNoHitRowLimit')); // NB: choosen follows limit
  
-//  OUTPUT(normIndexReadHitKeyedLimit, NAMED('normIndexReadHitKeyedLimit'));
-//  OUTPUT(normIndexReadHitKeyedOnFail, NAMED('normIndexReadHitKeyedOnFail'));
+  OUTPUT(normIndexReadHitKeyedLimit, NAMED('normIndexReadHitKeyedLimit'));
+  OUTPUT(normIndexReadHitKeyedOnFail, NAMED('normIndexReadHitKeyedOnFail'));
   OUTPUT(normIndexReadNoHitKeyedLimit, NAMED('normIndexReadNoHitKeyedLimit'));
   OUTPUT(CHOOSEN(normIndexReadNoHitKeyedLimit, 1), NAMED('choosen_normIndexReadNoHitKeyedLimit'));
  );

+ 12 - 0
testing/regress/ecl/key/indexlimits.xml

@@ -52,6 +52,13 @@
 <Dataset name='count_choosen_indexReadNoHitKeyedLimit'>
  <Row><count_choosen_indexReadNoHitKeyedLimit>1</count_choosen_indexReadNoHitKeyedLimit></Row>
 </Dataset>
+<Dataset name='normIndexReadHitLocalLimit'>
+</Dataset>
+<Dataset name='normIndexReadHitGlobalLimit'>
+</Dataset>
+<Dataset name='normIndexReadHitOnFail'>
+ <Row><addr>LIMIT EXCEEDED</addr></Row>
+</Dataset>
 <Dataset name='normIndexReadNoHitRowLimit'>
  <Row><addr>somewhere</addr></Row>
  <Row><addr>somewhere</addr></Row>
@@ -59,6 +66,11 @@
 <Dataset name='choosen_normIndexReadNoHitRowLimit'>
  <Row><addr>somewhere</addr></Row>
 </Dataset>
+<Dataset name='normIndexReadHitKeyedLimit'>
+</Dataset>
+<Dataset name='normIndexReadHitKeyedOnFail'>
+ <Row><addr>KEYED LIMIT EXCEEDED</addr></Row>
+</Dataset>
 <Dataset name='normIndexReadNoHitKeyedLimit'>
  <Row><addr>somewhere</addr></Row>
  <Row><addr>somewhere</addr></Row>