Browse Source

Merge branch 'candidate-6.0.12' into candidate-6.2.2

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 8 years ago
parent
commit
7fae796ad8

+ 9 - 1
common/thorhelper/roxiehelper.cpp

@@ -527,7 +527,10 @@ public:
     {
         sorter->reset();
     }
-
+    ~SortedInputReader()
+    {
+        sorter->reset();
+    }
     virtual const void *nextRow()
     {
         if (!firstRead)
@@ -613,6 +616,11 @@ class CSortAlgorithm : implements CInterfaceOf<ISortAlgorithm>
 public:
     CSortAlgorithm() { elapsedCycles = 0; }
 
+    virtual void beforeDispose() override
+    {
+        reset();
+    }
+
     virtual void getSortedGroup(ConstPointerArray & result)
     {
         loop

+ 14 - 3
roxie/ccd/ccdprotocol.cpp

@@ -1372,7 +1372,7 @@ public:
         if (name.isEmpty())
         {
             const char *fmt = mlFmt==MarkupFmt_XML ? "XML" : "JSON";
-            IException *E = MakeStringException(-1, "ERROR: Invalid %s received from %s:%d - %s queryName not found", fmt, peer, port, msg);
+            IException *E = MakeStringException(-1, "ERROR: Invalid %s queryName not found - received from %s:%d - %s", fmt, peer, port, msg);
             logctx.logOperatorException(E, __FILE__, __LINE__, "Invalid query %s", fmt);
             throw E;
         }
@@ -1435,8 +1435,16 @@ public:
     {
         if (!name.isEmpty())
             more = false;
-        else if (headerDepth && streq(tag, "Header"))
-            headerDepth--;
+        else if (headerDepth) //will never be true if !isSoap
+        {
+            const char *local = strchr(tag, ':');
+            if (local)
+                local++;
+            else
+                local = tag;
+            if (streq(local, "Header"))
+                headerDepth--;
+        }
     }
 
 };
@@ -1848,11 +1856,14 @@ readAnother:
                                 if (stricmp(format, "raw") == 0)
                                 {
                                     protocolFlags |= HPCC_PROTOCOL_NATIVE_RAW;
+                                    if (client) //not stand alone roxie exe
+                                        protocolFlags |= HPCC_PROTOCOL_BLOCKED;
                                     mlResponseFmt = MarkupFmt_Unknown;
                                 }
                                 else if (stricmp(format, "bxml") == 0)
                                 {
                                     protocolFlags |= HPCC_PROTOCOL_BLOCKED;
+                                    mlResponseFmt = MarkupFmt_XML;
                                 }
                                 else if (stricmp(format, "ascii") == 0)
                                 {

+ 3 - 3
roxie/ccd/ccdserver.cpp

@@ -15986,7 +15986,7 @@ public:
                 if (inputUsed[i1])
                     inputAdaptors[i1]->setParentExtract(parentExtractSize, parentExtract);
                 else
-                    inputAdaptors[i1]->stop();
+                    inputAdaptors[i1]->queryInput()->stopall();
             }
 
             for (unsigned i2 = 0; i2 < numOutputs; i2++)
@@ -15998,7 +15998,7 @@ public:
             ForEachItemIn(i3, extra.unusedOutputs)
             {
                 Owned<IFinalRoxieInput> output = graph->selectOutput(numInputs+extra.unusedOutputs.item(i3));
-                // output->queryStream().stop(); Is this needed??
+                output->stopall();
             }
         }
     }
@@ -16014,7 +16014,7 @@ public:
             ForEachItemIn(i3, extra.unusedOutputs)
             {
                 Owned<IFinalRoxieInput> output = graph->selectOutput(numInputs+extra.unusedOutputs.item(i3));
-                // Is this needed ?? output->queryStream().stop();
+                output->stopall();
             }
             CRoxieServerActivity::stop();
         }

+ 6 - 0
roxie/ccd/ccdserver.hpp

@@ -108,6 +108,12 @@ interface IFinalRoxieInput : extends IInputBase
     virtual IIndexReadActivityInfo *queryIndexReadActivity() = 0;
 
     virtual IStrandJunction *getOutputStreams(IRoxieSlaveContext *ctx, unsigned idx, PointerArrayOf<IEngineRowStream> &streams, const StrandOptions * consumerOptions, bool consumerOrdered, IOrderedCallbackCollection * orderedCallbacks) = 0;  // Use StrandFlags values for flags
+
+    inline void stopall()
+    {
+        for (int i = 0; i < numConcreteOutputs(); i++)
+            queryConcreteOutputStream(i)->stop();
+    }
 };
 
 extern IEngineRowStream *connectSingleStream(IRoxieSlaveContext *ctx, IFinalRoxieInput *input, unsigned idx, Owned<IStrandJunction> &junction, bool consumerOrdered);

+ 2 - 2
testing/regress/ecl/aaalibrary2.ecl

@@ -30,13 +30,13 @@ string10        forename;
 integer2        age := 25;
             END;
 
-FilterDatasetInterface(dataset(namesRecord) ds, string search, boolean onlyOldies) := interface
+FilterDatasetInterface(dataset(namesRecord) ds, dataset(namesRecord) unused, string search, boolean onlyOldies) := interface
     export dataset(namesRecord) matches;
     export dataset(namesRecord) others;
 end;
 
 
-filterDatasetLibrary(dataset(namesRecord) ds, string search, boolean onlyOldies) := module,library(FilterDatasetInterface)
+filterDatasetLibrary(dataset(namesRecord) ds, dataset(namesRecord) unused, string search, boolean onlyOldies) := module,library(FilterDatasetInterface)
     f := ds;
     shared g := if (onlyOldies, f(age >= 65), f);
     export matches := g(surname = search);

+ 3 - 0
testing/regress/ecl/key/library1.xml

@@ -10,3 +10,6 @@
 <Dataset name='OldNotHalliday'>
  <Row><surname>Smith               </surname><forename>George    </forename><age>75</age></Row>
 </Dataset>
+<Dataset name='Result 4'>
+ <Row><surname>a                   </surname><forename>a         </forename><age>2</age></Row>
+</Dataset>

+ 6 - 3
testing/regress/ecl/library1.ecl

@@ -26,21 +26,22 @@ integer2        age := 25;
             END;
 
 
-FilterDatasetInterface(dataset(namesRecord) ds, string search, boolean onlyOldies) := interface
+FilterDatasetInterface(dataset(namesRecord) ds, dataset(namesRecord) unused, string search, boolean onlyOldies) := interface
     export dataset(namesRecord) matches;
     export dataset(namesRecord) others;
 end;
 
 
-FilterDatasetLibrary(dataset(namesRecord) ds, string search, boolean onlyOldies) := module,library(FilterDatasetInterface)
+FilterDatasetLibrary(dataset(namesRecord) ds, dataset(namesRecord) unused, string search, boolean onlyOldies) := module,library(FilterDatasetInterface)
     f := ds;
     shared g := if (onlyOldies, f(age >= 65), f);
     export matches := g(surname = search);
     export others := g(surname != search);
 end;
 
+empty := nofold(DATASET([{'a','a',2}], namesRecord));
 
-filterDataset(dataset(namesRecord) ds, string search, boolean onlyOldies) := library(internal(FilterDatasetLibrary), FilterDatasetInterface(ds, search, onlyOldies));
+filterDataset(dataset(namesRecord) ds, string search, boolean onlyOldies) := library(internal(FilterDatasetLibrary), FilterDatasetInterface(ds, empty, search, onlyOldies));
 
 
 namesTable := dataset([
@@ -58,3 +59,5 @@ output(filtered2.others,,named('NotHalliday'));
 
 filtered3 := filterDataset(namesTable, 'Halliday', true);
 output(filtered3.others,,named('OldNotHalliday'));
+
+output(empty);

+ 3 - 2
testing/regress/ecl/library2.ecl

@@ -27,13 +27,14 @@ string10        forename;
 integer2        age := 25;
             END;
 
-FilterDatasetInterface(dataset(namesRecord) ds, string search, boolean onlyOldies) := interface
+FilterDatasetInterface(dataset(namesRecord) ds, dataset(namesRecord) unused, string search, boolean onlyOldies) := interface
     export dataset(namesRecord) matches;
     export dataset(namesRecord) others;
 end;
 
+empty := DATASET([], namesRecord);
 
-filterDataset(dataset(namesRecord) ds, string search, boolean onlyOldies) := library('aaaLibrary2',FilterDatasetInterface(ds,search,onlyOldies));
+filterDataset(dataset(namesRecord) ds, string search, boolean onlyOldies) := library('aaaLibrary2',FilterDatasetInterface(ds,empty,search,onlyOldies));
 
 namesTable := dataset([
         {'Halliday','Gavin',31},

+ 4 - 2
testing/regress/ecl/library2a.ecl

@@ -27,7 +27,7 @@ string10        forename;
 integer2        age := 25;
             END;
 
-FilterDatasetInterface(dataset(namesRecord) ds, string search, boolean onlyOldies) := interface
+FilterDatasetInterface(dataset(namesRecord) ds, dataset(namesRecord) unused, string search, boolean onlyOldies) := interface
     export dataset(namesRecord) matches;
     export dataset(namesRecord) others;
 end;
@@ -35,7 +35,9 @@ end;
 
 boolean falseval := false: stored('yeahright');
 
-filterDataset(dataset(namesRecord) ds, string search, boolean onlyOldies) := library('aaaLibrary2',FilterDatasetInterface(ds,search,onlyOldies));
+empty := DATASET([], namesRecord);
+
+filterDataset(dataset(namesRecord) ds, string search, boolean onlyOldies) := library('aaaLibrary2',FilterDatasetInterface(ds,empty,search,onlyOldies));
 
 namesTable := dataset([
         {'Halliday','Gavin',31},