Forráskód Böngészése

Merge remote-tracking branch 'origin/closedown-4.0.x'

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 éve
szülő
commit
4ed6c0d1e8

+ 8 - 1
docs/HPCCClientTools/CT_Mods/CT_ECL_CLI.xml

@@ -1523,6 +1523,13 @@ ecl packagemap add roxie mypackagemap.pkg --daliip=192.168.11.11
                 </row>
 
                 <row>
+                  <entry>--pmid=&lt;packagemapid&gt;</entry>
+
+                  <entry>id of package map - defaults to filename if not
+                  specified</entry>
+                </row>
+
+                <row>
                   <entry>-v, --verbose</entry>
 
                   <entry>Output additional tracing information</entry>
@@ -2002,7 +2009,7 @@ ecl packagemap validate roxie --active</programlisting>
 
         <para>Filename, --active, and --pmid are mutually exclusive. The
         --active or --pmid options validate a packagemap that has already been
-        added instead of a local file. </para>
+        added instead of a local file.</para>
 
         <para>The --queryid option checks the files in a query instead of all
         the queries in the target queryset. This is quicker when you only need

+ 13 - 1
ecl/ecl-package/ecl-package.cpp

@@ -28,6 +28,7 @@
 #include "eclcmd_common.hpp"
 #include "eclcmd_core.hpp"
 
+
 //=========================================================================================
 
 IClientWsPackageProcess *getWsPackageSoapService(const char *server, const char *port, const char *username, const char *password)
@@ -507,6 +508,8 @@ public:
                 }
                 continue;
             }
+            if (iter.matchOption(optPackageMapId, ECLOPT_PMID))
+                continue;
             if (iter.matchOption(optDaliIP, ECLOPT_DALIIP))
                 continue;
             if (iter.matchFlag(optActivate, ECLOPT_ACTIVATE)||iter.matchFlag(optActivate, ECLOPT_ACTIVATE_S))
@@ -541,6 +544,13 @@ public:
         if (optProcess.isEmpty())
             optProcess.set("*");
 
+        if (optPackageMapId.isEmpty())
+        {
+            StringBuffer name;
+            splitFilename(optFileName.get(), NULL, NULL, &name, &name);
+            optPackageMapId.set(name.str());
+        }
+        optPackageMapId.toLowerCase();
         return true;
     }
     virtual int processCMD()
@@ -555,7 +565,7 @@ public:
         request->setActivate(optActivate);
         request->setInfo(pkgInfo);
         request->setTarget(optTarget);
-        request->setPackageMap(optFileName);
+        request->setPackageMap(optPackageMapId);
         request->setProcess(optProcess);
         request->setDaliIp(optDaliIP);
         request->setOverWrite(optOverWrite);
@@ -578,6 +588,7 @@ public:
                     "   -O, --overwrite             overwrite existing information\n"
                     "   -A, --activate              activate the package information\n"
                     "   --daliip=<ip>               ip of the remote dali to use for logical file lookups\n"
+                   "   --pmid                       id of package map - defaults to filename if not specified."
 // NOT-YET          "  --packageprocessname         if not set use this package process name for all clusters"
                     "   <target>                    name of target to use when adding package map information\n"
                     "   <filename>                  name of file containing package map information\n",
@@ -593,6 +604,7 @@ private:
     bool optOverWrite;
     StringBuffer pkgInfo;
     StringAttr optDaliIP;
+    StringAttr optPackageMapId;
 };
 
 class EclCmdPackageValidate : public EclCmdCommon

+ 4 - 0
ecl/hql/hqlgram2.cpp

@@ -9707,6 +9707,10 @@ _ATOM HqlGram::getNameFromExpr(attribute& attr)
     OwnedHqlExpr expr = attr.getExpr();
     loop
     {
+        IHqlExpression * name = queryNamedSymbol(expr);
+        if (name)
+            return name->queryName();
+
         switch (expr->getOperator())
         {
         case no_select:

+ 67 - 0
ecl/regress/minherit34.ecl

@@ -0,0 +1,67 @@
+/*##############################################################################
+
+    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.
+############################################################################## */
+
+CatRecord := RECORD
+    STRING sCats;
+    UNSIGNED julianDays;
+END;
+
+xRecord := RECORD
+    STRING s1;
+    STRING s2;
+    DATASET(catRecord) y;
+END;
+
+absBase := MODULE,VIRTUAL
+export a := 1;
+END;
+
+base := MODULE(absBase)
+
+ EXPORT f(DATASET(CatRecord) dsPrevCats, xRecord x, UNSIGNED nNumDays) := FUNCTION
+
+    sCurrCat := x.s1;
+
+    matchRec := RECORD
+        BOOLEAN bMatch := FALSE;
+    END;
+
+    matchRec isMatch(CatRecord recPrevCat, STRING50 sCat, UNSIGNED nNumDays, UNSIGNED jCurrDays) := TRANSFORM
+
+        STRING100 sCurrWord := REGEXREPLACE(',', '-' + TRIM(sCat) + '-', '-,-');
+        STRING100 sCurrCatA := REGEXREPLACE(',', sCurrWord, '|');
+        STRING100 sCurrCat := REGEXREPLACE('(\\|)$', TRIM(sCurrCatA), '');
+
+        STRING100 sPrevWord := REGEXREPLACE(',', '-' + TRIM(recPrevCat.sCats) + '-', '-,-');
+        STRING100 sPrevCatA := REGEXREPLACE(',', sPrevWord, '|');
+        STRING100 sPrevCat := REGEXREPLACE('(\\|)$', TRIM(sPrevCatA), '');
+
+        SELF.bMatch := IF( (LENGTH(TRIM(recPrevCat.sCats)) > 0 AND LENGTH(TRIM(sCat)) > 0) AND ((recPrevCat.JulianDays - jCurrDays) <= nNumDays), REGEXFIND(TRIM(sPrevCat), TRIM(sCurrCat)), FALSE);
+    END;
+
+    dsFound := PROJECT(dsPrevCats, isMatch(LEFT, sCurrCat, nNumDays, 12345678));
+
+    RETURN COUNT(dsFound(bMatch = TRUE)) > 0;
+END;
+END;
+
+
+infile := dataset('x', xRecord, thor);
+
+t := TABLE(infile, { base.f(y, ROW(infile), 23); });
+
+output(t);

+ 4 - 0
esp/files/scripts/DFUWUDetailsWidget.js

@@ -135,6 +135,10 @@ define([
 
                 this.clearInput();
                 this.wu = ESPDFUWorkunit.Get(params.Wuid);
+                var data = this.wu.getData();
+                for (key in data) {
+                    this.updateInput(key, null, data[key]);
+                }
                 var context = this;
                 this.wu.watch(function (name, oldValue, newValue) {
                     context.updateInput(name, oldValue, newValue);

+ 22 - 13
esp/files/scripts/LFDetailsWidget.js

@@ -145,6 +145,10 @@ define([
             var context = this;
             if (params.Name) {
                 this.logicalFile = ESPLogicalFile.Get(params.Name);
+                var data = this.logicalFile.getData();
+                for (key in data) {
+                    this.updateInput(key, null, data[key]);
+                }
                 this.logicalFile.watch(function (name, oldValue, newValue) {
                     context.updateInput(name, oldValue, newValue);
                 });
@@ -217,19 +221,24 @@ define([
         },*/
 
         updateInput: function (name, oldValue, newValue) {
-            var domElem = dom.byId(this.id + name);
-            if (domElem) {
-                switch(domElem.tagName) {
-                    case "SPAN":
-                    case "DIV":
-                        domAttr.set(this.id + name, "innerHTML", newValue)
-                        break;
-                    case "INPUT":
-                    case "TEXTAREA":
-                        domAttr.set(this.id + name, "value", newValue)
-                        break;
-                    default:
-                        alert(domElem.tagName);
+            var registryNode = registry.byId(this.id + name);
+            if (registryNode) {
+                registryNode.set("value", newValue);
+            } else {
+                var domElem = dom.byId(this.id + name);
+                if (domElem) {
+                    switch (domElem.tagName) {
+                        case "SPAN":
+                        case "DIV":
+                            domAttr.set(this.id + name, "innerHTML", newValue);
+                            break;
+                        case "INPUT":
+                        case "TEXTAREA":
+                            domAttr.set(this.id + name, "value", newValue);
+                            break;
+                        default:
+                            alert(domElem.tagName);
+                    }
                 }
             }
             if (name === "Wuid") {

+ 22 - 13
esp/files/scripts/SFDetailsWidget.js

@@ -138,6 +138,10 @@ define([
             var context = this;
             if (params.Name) {
                 this.logicalFile = ESPLogicalFile.Get(params.Name);
+                var data = this.logicalFile.getData();
+                for (key in data) {
+                    this.updateInput(key, null, data[key]);
+                }
                 this.logicalFile.watch(function (name, oldValue, newValue) {
                     context.updateInput(name, oldValue, newValue);
                 });
@@ -223,19 +227,24 @@ define([
         },
 
         updateInput: function (name, oldValue, newValue) {
-            var domElem = dom.byId(this.id + name);
-            if (domElem) {
-                switch(domElem.tagName) {
-                    case "SPAN":
-                    case "DIV":
-                        domAttr.set(this.id + name, "innerHTML", newValue)
-                        break;
-                    case "INPUT":
-                    case "TEXTAREA":
-                        domAttr.set(this.id + name, "value", newValue)
-                        break;
-                    default:
-                        alert(domElem.tagName);
+            var registryNode = registry.byId(this.id + name);
+            if (registryNode) {
+                registryNode.set("value", newValue);
+            } else {
+                var domElem = dom.byId(this.id + name);
+                if (domElem) {
+                    switch (domElem.tagName) {
+                        case "SPAN":
+                        case "DIV":
+                            domAttr.set(this.id + name, "innerHTML", newValue);
+                            break;
+                        case "INPUT":
+                        case "TEXTAREA":
+                            domAttr.set(this.id + name, "value", newValue);
+                            break;
+                        default:
+                            alert(domElem.tagName);
+                    }
                 }
             }
             if (name === "subfiles") {

+ 22 - 13
esp/files/scripts/WUDetailsWidget.js

@@ -139,6 +139,10 @@ define([
 
                 dom.byId(this.id + "Wuid").innerHTML = params.Wuid;
                 this.wu = ESPWorkunit.Get(params.Wuid);
+                var data = this.wu.getData();
+                for (key in data) {
+                    this.updateInput(key, null, data[key]);
+                }
                 var context = this;
                 this.wu.watch(function (name, oldValue, newValue) {
                     context.updateInput(name, oldValue, newValue);
@@ -221,19 +225,24 @@ define([
         },
 
         updateInput: function (name, oldValue, newValue) {
-            var domElem = dom.byId(this.id + name);
-            if (domElem) {
-                switch (domElem.tagName) {
-                    case "SPAN":
-                    case "DIV":
-                        domAttr.set(this.id + name, "innerHTML", newValue)
-                        break;
-                    case "INPUT":
-                    case "TEXTAREA":
-                        domAttr.set(this.id + name, "value", newValue)
-                        break;
-                    default:
-                        alert(domElem.tagName);
+            var registryNode = registry.byId(this.id + name);
+            if (registryNode) {
+                registryNode.set("value", newValue);
+            } else {
+                var domElem = dom.byId(this.id + name);
+                if (domElem) {
+                    switch (domElem.tagName) {
+                        case "SPAN":
+                        case "DIV":
+                            domAttr.set(this.id + name, "innerHTML", newValue);
+                            break;
+                        case "INPUT":
+                        case "TEXTAREA":
+                            domAttr.set(this.id + name, "value", newValue);
+                            break;
+                        default:
+                            alert(domElem.tagName);
+                    }
                 }
             }
             if (name === "Protected") {

+ 3 - 1
roxie/ccd/ccdactivities.cpp

@@ -3574,7 +3574,9 @@ public:
                             }
                             else
                             {
-                                // MORE - this is actually pretty fatal fo smart-stepping case
+                                // This is actually pretty fatal for smart-stepping case
+                                if (logctx.queryTraceLevel())
+                                    logctx.CTXLOG("Indexread unable to return partial result set");
                                 continuationFailed = true;
                             }
                         }

+ 9 - 10
system/jhtree/jhtree.cpp

@@ -872,8 +872,6 @@ public:
         {
             keyCursor->serializeCursorPos(mb);
             mb.append(matched);
-            if (!matched)
-                mb.append(keySize, keyBuffer);
         }
     }
 
@@ -882,10 +880,9 @@ public:
         mb.read(eof);
         if (!eof)
         {
-            keyCursor->deserializeCursorPos(mb);
+            assertex(keyBuffer);
+            keyCursor->deserializeCursorPos(mb, keyBuffer);
             mb.read(matched);
-            if (!matched)
-                mb.read(keySize, keyBuffer);
         }
     }
 
@@ -1911,13 +1908,17 @@ void CKeyCursor::serializeCursorPos(MemoryBuffer &mb)
     }
 }
 
-void CKeyCursor::deserializeCursorPos(MemoryBuffer &mb)
+void CKeyCursor::deserializeCursorPos(MemoryBuffer &mb, char *keyBuffer)
 {
     offset_t nodeAddress;
     mb.read(nodeAddress);
     mb.read(nodeKey);
     if (nodeAddress)
+    {
         node.setown(key.getNode(nodeAddress, ctx));
+        if (node && keyBuffer)
+            node->getValueAt(nodeKey, keyBuffer);
+    }
     else
         node.clear();
 }
@@ -2809,7 +2810,6 @@ public:
             cursors[key]->serializeCursorPos(mb);
             mb.append(matcheds[key]);
             mb.append(fposes[key]);
-            mb.append(keySize, buffers[key]);
         }
     }
 
@@ -2823,15 +2823,14 @@ public:
             mb.read(keyno);
             keyNoArray.append(keyno);
             keyCursor = keyset->queryPart(keyno)->getCursor(ctx);
+            keyBuffer = (char *) malloc(keySize);
             cursorArray.append(*keyCursor);
-            keyCursor->deserializeCursorPos(mb);
+            keyCursor->deserializeCursorPos(mb, keyBuffer);
             mb.read(matched);
             matchedArray.append(matched);
             offset_t fpos;
             mb.read(fpos);
             fposArray.append(fpos);
-            keyBuffer = (char *) malloc(keySize);
-            mb.read(keySize, keyBuffer);
             bufferArray.append(keyBuffer);
             void *fixedValue = (char *) malloc(sortFieldOffset);
             memcpy(fixedValue, keyBuffer, sortFieldOffset); // If it's not at EOF then it must match

+ 1 - 1
system/jhtree/jhtree.hpp

@@ -49,7 +49,7 @@ interface jhtree_decl IKeyCursor : public IInterface
     virtual size32_t getSize() = 0;
     virtual offset_t getFPos() = 0;
     virtual void serializeCursorPos(MemoryBuffer &mb) = 0;
-    virtual void deserializeCursorPos(MemoryBuffer &mb) = 0;
+    virtual void deserializeCursorPos(MemoryBuffer &mb, char *keyBuffer) = 0;
     virtual unsigned __int64 getSequence() = 0;
     virtual const byte *loadBlob(unsigned __int64 blobid, size32_t &blobsize) = 0;
     virtual void releaseBlobs() = 0;

+ 1 - 1
system/jhtree/jhtree.ipp

@@ -179,7 +179,7 @@ public:
     virtual size32_t getSize();
     virtual offset_t getFPos(); 
     virtual void serializeCursorPos(MemoryBuffer &mb);
-    virtual void deserializeCursorPos(MemoryBuffer &mb);
+    virtual void deserializeCursorPos(MemoryBuffer &mb, char *keyBuffer);
     virtual unsigned __int64 getSequence(); 
     virtual const byte *loadBlob(unsigned __int64 blobid, size32_t &blobsize);
     virtual void releaseBlobs();