Bladeren bron

Merge branch 'candidate-5.4.0'

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 10 jaren geleden
bovenliggende
commit
bd5910f3e6
44 gewijzigde bestanden met toevoegingen van 297 en 130 verwijderingen
  1. 3 3
      cmake_modules/FindJNI.cmake
  2. 1 1
      common/thorhelper/thorstep.cpp
  3. 3 3
      dali/base/dasds.cpp
  4. 3 3
      dali/datest/datest.cpp
  5. 1 1
      dali/dfu/dfurun.cpp
  6. 1 1
      docs/ECLLanguageReference/ECLR_mods/BltInFunc-HASHCRC.xml
  7. 35 1
      docs/ECLStandardLibraryReference/SLR-Mods/SprayVariable.xml
  8. 10 0
      docs/HPCCDataHandling/DH-Mods/DH-Mod1.xml
  9. 3 0
      docs/HPCCSystemAdmin/HPCCSystemAdministratorsGuide.xml
  10. 2 2
      ecl/eclagent/eclagent.cpp
  11. 1 1
      ecl/eclagent/eclagent.ipp
  12. 1 1
      ecl/eclcc/reservedwords.cpp
  13. 1 1
      ecl/eclcmd/roxie/ecl-roxie.cpp
  14. 4 4
      ecl/hql/hqlgram.y
  15. 30 6
      ecl/hql/hqlutil.cpp
  16. 1 0
      ecl/hql/hqlutil.hpp
  17. 3 3
      ecl/hqlcpp/hqlcpp.ipp
  18. 19 2
      ecl/hqlcpp/hqlcset.cpp
  19. 41 31
      ecl/hqlcpp/hqlhtcpp.cpp
  20. 2 3
      ecl/hqlcpp/hqliproj.cpp
  21. 3 3
      ecl/hqlcpp/hqlttcpp.cpp
  22. 1 1
      ecl/hthor/hthor.cpp
  23. 1 1
      esp/clients/LoggingClient/LocalDataLogger.cpp
  24. 3 1
      esp/platform/espcfg.cpp
  25. 2 2
      esp/platform/espthread.hpp
  26. 1 1
      esp/services/common/jsonhelpers.hpp
  27. 3 3
      esp/services/ws_dfu/ws_dfuService.cpp
  28. 1 1
      esp/test/httptest/httptest.cpp
  29. 1 1
      esp/test/httptest/httptest.hpp
  30. 3 3
      esp/tools/soapplus/http.cpp
  31. 1 1
      roxie/ccd/ccdcontext.cpp
  32. 1 1
      roxie/ccd/ccdserver.cpp
  33. 1 1
      roxie/roxieclient/roxieclient.cpp
  34. 28 22
      rtl/eclrtl/rtlfield.cpp
  35. 2 1
      rtl/include/eclhelper.hpp
  36. 2 2
      system/hrpc/hrpcmp.cpp
  37. 2 0
      system/include/platform.h
  38. 11 11
      system/mp/mpcomm.cpp
  39. 8 0
      testing/regress/ecl/key/xmloutScalarXpath.xml
  40. 50 0
      testing/regress/ecl/xmloutScalarXpath.ecl
  41. 1 1
      thorlcr/master/thgraphmanager.cpp
  42. 1 1
      tools/backupnode/backupnode.cpp
  43. 3 3
      tools/esdlcmd/esdlcmd_core.cpp
  44. 2 2
      tools/testsocket/testsocket.cpp

+ 3 - 3
cmake_modules/FindJNI.cmake

@@ -162,8 +162,8 @@ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_LIBRARY_DIRECTORIES
   /usr/lib/jvm/java-6-sun/jre/lib/{libarch}
   /usr/lib/jvm/java-1.5.0-sun/jre/lib/{libarch}
   /usr/lib/jvm/java-6-sun-1.6.0.00/jre/lib/{libarch}       # can this one be removed according to #8821 ? Alex
-  /usr/lib/jvm/java-6-openjdk-{libarch}/jre/lib/{libarch}  # Ubuntu 12.10 location
   /usr/lib/jvm/java-7-openjdk-{libarch}/jre/lib/{libarch}  # Ubuntu 13.04 location
+  /usr/lib/jvm/java-6-openjdk-{libarch}/jre/lib/{libarch}  # Ubuntu 12.10 location
   /usr/lib/jvm/java-6-openjdk/jre/lib/{libarch}
   /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0/jre/lib/{libarch}        # fedora
   # Debian specific paths for default JVM
@@ -193,8 +193,8 @@ JAVA_APPEND_LIBRARY_DIRECTORIES(JAVA_AWT_EXPANDED_INCLUDE_DIRECTORIES
   /usr/lib/jvm/java-6-sun/include
   /usr/lib/jvm/java-1.5.0-sun/include
   /usr/lib/jvm/java-6-sun-1.6.0.00/include       # can this one be removed according to #8821 ? Alex
-  /usr/lib/jvm/java-6-openjdk-{libarch}/jre/lib/{libarch}  # Ubuntu 12.10 location
   /usr/lib/jvm/java-7-openjdk-{libarch}/include  # Ubuntu 13.04 location
+  /usr/lib/jvm/java-6-openjdk-{libarch}/jre/lib/{libarch}  # Ubuntu 12.10 location
   /usr/lib/jvm/java-6-openjdk/include
   /usr/local/share/java/include
   /usr/lib/j2sdk1.4-sun/include
@@ -313,4 +313,4 @@ SET(JNI_INCLUDE_DIRS
   ${JAVA_INCLUDE_PATH}
   ${JAVA_INCLUDE_PATH2}
   ${JAVA_AWT_INCLUDE_PATH}
-)
+)

+ 1 - 1
common/thorhelper/thorstep.cpp

@@ -2691,7 +2691,7 @@ bool CProximityRangeJoinGenerator::gatherNextCandidates(unsigned iLowest)
             else
                 maxLowestBeforeCur = maxLeftBeforeRight * (iInput - iLowest);
 
-            assertex(maxLowestBeforeCur >= 0);          // should have created an anchored varient if not true
+            assertex(maxLowestBeforeCur >= 0);          // should have created an anchored variant if not true
 
             // maxLowestBeforeCur = maxCurAfterLowest
             unsigned __int64 maxDistance = lowestDistance + maxLowestBeforeCur;     

+ 3 - 3
dali/base/dasds.cpp

@@ -1003,7 +1003,7 @@ void writeDelta(StringBuffer &xml, IFile &iFile, const char *msg="", unsigned re
             return;
         if (0 == --_retryAttempts)
         {
-            WARNLOG("writeDelta, too many retry attemps [%d]", retryAttempts);
+            WARNLOG("writeDelta, too many retry attempts [%d]", retryAttempts);
             return;
         }
         exception.clear();
@@ -1093,7 +1093,7 @@ class CBackupHandler : public CInterface, implements IThreaded
                 return;
             if (0 == --_retryAttempts)
             {
-                WARNLOG("writeExt, too many retry attemps [%d]", retryAttempts);
+                WARNLOG("writeExt, too many retry attempts [%d]", retryAttempts);
                 return;
             }
             exception.clear();
@@ -1126,7 +1126,7 @@ class CBackupHandler : public CInterface, implements IThreaded
                 return;
             if (0 == --_retryAttempts)
             {
-                WARNLOG("deleteExt, too many retry attemps [%d]", retryAttempts);
+                WARNLOG("deleteExt, too many retry attempts [%d]", retryAttempts);
                 return;
             }
             exception.clear();

+ 3 - 3
dali/datest/datest.cpp

@@ -1730,7 +1730,7 @@ void TestExternal()
             Owned<IFileIO> fileIO = ifile->open(IFOread);
             assertex(fileIO);
 
-            sz = ifile->size();
+            sz = (size32_t)ifile->size();
             void *mem = malloc(sz);
 
             fileIO->read(0, sz, mem);
@@ -2587,13 +2587,13 @@ NULL
         if (0 == l)
         {
             OwnedIFileIO newFileIO = newFile->open(IFOread);
-            read(newFileIO, 0, newFile->size(), newOutput);
+            read(newFileIO, 0, (size32_t)newFile->size(), newOutput);
             newFileIO.clear();
         }
         else
         {
             OwnedIFileIO newFileSecondaryIO = newFileSecondary->open(IFOread);
-            read(newFileSecondaryIO, 0, newFileSecondary->size(), secondary);
+            read(newFileSecondaryIO, 0, (size32_t)newFileSecondary->size(), secondary);
             newFileSecondaryIO.clear();
 
             if (newOutput.length() != secondary.length() || 0 != memcmp(newOutput.toByteArray(), secondary.toByteArray(), newOutput.length()))

+ 1 - 1
dali/dfu/dfurun.cpp

@@ -1561,7 +1561,7 @@ public:
             case DFUcmd_monitor: 
                 {
                     CriticalBlock block(monitorsect);
-                    // first check done when WU recieved
+                    // first check done when WU received
                     IDFUmonitor *monitor = wu->queryUpdateMonitor();
                     if (!monitor)
                         break;

+ 1 - 1
docs/ECLLanguageReference/ECLR_mods/BltInFunc-HASHCRC.xml

@@ -5,7 +5,7 @@
   <title>HASHCRC</title>
 
   <para><emphasis role="bold">HASHCRC<indexterm>
-      <primary>HASHRC</primary>
+      <primary>HASHCRC</primary>
     </indexterm><indexterm>
       <primary>HASHCRC function</primary>
     </indexterm>(</emphasis><emphasis>expressionlist</emphasis><emphasis

+ 35 - 1
docs/ECLStandardLibraryReference/SLR-Mods/SprayVariable.xml

@@ -179,9 +179,43 @@
         </row>
 
         <row>
+          <entry><emphasis>failIfNoSourceFile</emphasis></entry>
+
+          <entry>Optional. A boolean TRUE or FALSE flag indicating whether to
+          allow the spray to fail if no source file is found. If omitted,
+          default is FALSE.</entry>
+        </row>
+
+        <row>
+          <entry><emphasis>recordStructurePresent</emphasis></entry>
+
+          <entry>Optional. A boolean TRUE or FALSE flag indicating whether to
+          derive the record structure from the header of the file. If omitted,
+          the default is FALSE.</entry>
+        </row>
+
+        <row>
+          <entry><emphasis>quotedTerminator</emphasis></entry>
+
+          <entry>Optional. A boolean TRUE or FALSE flag indicating whether the
+          terminator character can be included in a quoted field. Defaults to
+          TRUE. If FALSE, it allows quicker partitioning of the file (avoiding
+          a complete file scan).</entry>
+        </row>
+
+        <row>
+          <entry><emphasis>encoding</emphasis></entry>
+
+          <entry> A null-terminated string containing the encoding. Can be set
+          to one of the following: ascii, utf8, utf8n, utf16, utf16le,
+          utf16be, utf32, utf32le,utf32be. If omitted, the default is
+          ascii.</entry>
+        </row>
+
+        <row>
           <entry><emphasis>dfuwuid</emphasis></entry>
 
-          <entry>The attribute name to recieve the null-terminated string
+          <entry>The definition name to receive the null-terminated string
           containing the DFU workunit ID (DFUWUID) generated for the
           job.</entry>
         </row>

+ 10 - 0
docs/HPCCDataHandling/DH-Mods/DH-Mod1.xml

@@ -588,6 +588,16 @@
 
                     <entry>Check this box to compress the files.</entry>
                   </row>
+
+                  <row>
+                    <entry><emphasis role="bold">Quoted
+                    Terminator</emphasis></entry>
+
+                    <entry>Check this box to indicate that the terminator
+                    character can be included in a quoted field. If unchecked,
+                    it allows quicker partitioning of the file (avoiding a
+                    complete file scan).</entry>
+                  </row>
                 </tbody>
               </tgroup>
             </informaltable></para>

+ 3 - 0
docs/HPCCSystemAdmin/HPCCSystemAdministratorsGuide.xml

@@ -1082,6 +1082,9 @@ lock=/var/lock/HPCCSystems</programlisting>
     </sect1>
 
     <!--Inclusions-As-Sect1-->
+ <xi:include href="Installing_and_RunningTheHPCCPlatform/Inst-Mods/hpcc_ldap.xml"
+                xpointer="element(/1)"
+                xmlns:xi="http://www.w3.org/2001/XInclude" />
 
     <xi:include href="Installing_and_RunningTheHPCCPlatform/Inst-Mods/UserSecurityMaint.xml"
                 xpointer="User_Security_Maint"

+ 2 - 2
ecl/eclagent/eclagent.cpp

@@ -2289,7 +2289,7 @@ void EclAgentWorkflowMachine::doExecutePersistItem(IRuntimeWorkflowItem & item)
         if (agent.queryWorkUnit()->getDebugValueBool("expandPersistInputDependencies", false))
             doExecuteItemDependencies(item, wfid);
         if (maxPersistCopies > 0)
-            agent.deleteLRUPersists(logicalName, maxPersistCopies-1);
+            agent.deleteLRUPersists(logicalName, (unsigned)(maxPersistCopies-1));
         doExecuteItem(item, wfid);
         agent.updatePersist(persistLock, logicalName, thisPersist->eclCRC, thisPersist->allCRC);
     }
@@ -2707,7 +2707,7 @@ static int comparePersistAccess(IInterface * const *_a, IInterface * const *_b)
 
 }
 
-void EclAgent::deleteLRUPersists(const char * logicalName, int keep)
+void EclAgent::deleteLRUPersists(const char * logicalName, unsigned keep)
 {
     StringBuffer lfn;
     expandLogicalName(lfn, logicalName);

+ 1 - 1
ecl/eclagent/eclagent.ipp

@@ -495,7 +495,7 @@ public:
     void finishPersist(const char * persistName, IRemoteConnection *persistLock);
     void updatePersist(IRemoteConnection *persistLock, const char * logicalName, unsigned eclCRC, unsigned __int64 allCRC);
     void checkPersistMatches(const char * logicalName, unsigned eclCRC);
-    virtual void deleteLRUPersists(const char * logicalName, int keep);
+    virtual void deleteLRUPersists(const char * logicalName, unsigned keep);
     virtual bool queryResolveFilesLocally() { return resolveFilesLocally; }
     virtual bool queryRemoteWorkunit() { return isRemoteWorkunit; }
     virtual bool queryWriteResultsToStdout() { return writeResultsToStdout; }

+ 1 - 1
ecl/eclcc/reservedwords.cpp

@@ -561,7 +561,7 @@ void printKeywordsToXml()
      unsigned int nGroups = sizeof(keywordList)/sizeof(keywordList[0]);
 
      buffer.append("<xml>\n");
-     for (int i = 0; i < nGroups; ++i)
+     for (unsigned i = 0; i < nGroups; ++i)
      {
          buffer.append("  <cat group=\"").append(keywordList[i].group).append("\">\n");
          unsigned int j = 0;

+ 1 - 1
ecl/eclcmd/roxie/ecl-roxie.cpp

@@ -129,7 +129,7 @@ void roxieStatusReport(IPropertyTree *hashTree, unsigned reporting, unsigned not
 
     if (attached && detached)
     {
-        fputs("Mismatched DALI Attachement\n", stderr);
+        fputs("Mismatched DALI Attachment\n", stderr);
         fprintf(stderr, "  %d Node(s) attached to DALI\n", attached);
         fprintf(stderr, "  %d Node(s) detached from DALI\n", detached);
     }

+ 4 - 4
ecl/hql/hqlgram.y

@@ -5249,8 +5249,8 @@ compareExpr
                             parser->normalizeExpression($4);
                             parser->normalizeExpression($4, type_dictionary, false);
                             OwnedHqlExpr dict = $4.getExpr();
-                            OwnedHqlExpr row = createValue(no_rowvalue, makeNullType(), $1.getExpr());
-                            OwnedHqlExpr indict = createINDictExpr(*parser->errorHandler, $4.pos, row, dict);
+                            OwnedHqlExpr expr = $1.getExpr();
+                            OwnedHqlExpr indict = createINDictExpr(*parser->errorHandler, $4.pos, expr, dict);
                             $$.setExpr(getInverse(indict));
                             $$.setPosition($3);
                         }
@@ -5271,8 +5271,8 @@ compareExpr
                             parser->normalizeExpression($3);
                             parser->normalizeExpression($3, type_dictionary, false);
                             OwnedHqlExpr dict = $3.getExpr();
-                            OwnedHqlExpr row = createValue(no_rowvalue, makeNullType(), $1.getExpr());
-                            $$.setExpr(createINDictExpr(*parser->errorHandler, $3.pos, row, dict));
+                            OwnedHqlExpr expr = $1.getExpr();
+                            $$.setExpr(createINDictExpr(*parser->errorHandler, $3.pos, expr, dict));
                             $$.setPosition($2);
                         }
     | dataRow TOK_IN dictionary

+ 30 - 6
ecl/hql/hqlutil.cpp

@@ -5990,20 +5990,44 @@ IHqlExpression *getDictionarySearchRecord(IHqlExpression *record)
     return recursiveStretchFields(keyrec);
 }
 
-IHqlExpression * createSelectMapRow(IErrorReceiver & errorProcessor, ECLlocation & location, IHqlExpression * dict, IHqlExpression *values)
+static IHqlExpression *createTransformFromRowValue(IErrorReceiver & errorProcessor, ECLlocation & location, IHqlExpression *dict, IHqlExpression * rowValue)
 {
     OwnedHqlExpr record = getDictionarySearchRecord(dict->queryRecord());
     TempTableTransformer transformer(errorProcessor, location, true);
-    OwnedHqlExpr newTransform = transformer.createTempTableTransform(values, record);
+    return transformer.createTempTableTransform(rowValue, record);
+}
+
+
+IHqlExpression *createRowForDictExpr(IErrorReceiver & errorProcessor, ECLlocation & location, IHqlExpression *expr, IHqlExpression *dict)
+{
+    OwnedHqlExpr rowValue = createValue(no_rowvalue, makeNullType(), LINK(expr));
+    OwnedHqlExpr newTransform = createTransformFromRowValue(errorProcessor, location, dict, rowValue);
+    return createRow(no_createrow, newTransform.getClear());
+}
+
+
+IHqlExpression * createSelectMapRow(IErrorReceiver & errorProcessor, ECLlocation & location, IHqlExpression * dict, IHqlExpression *values)
+{
+    //Always process the expression and create a row since this also validates the search expression
+    OwnedHqlExpr newTransform = createTransformFromRowValue(errorProcessor, location, dict, values);
+
+    //If only a single expression is being looked up then create no_selectmap(dict, expr) instead of no_selectmap(dict, row) to avoid unnecessary aliases.
+    if (getFlatFieldCount(newTransform->queryRecord()) == 1)
+        return createRow(no_selectmap, LINK(dict), LINK(values->queryChild(0)));
+
     return createRow(no_selectmap, LINK(dict), createRow(no_createrow, newTransform.getClear()));
 }
 
 IHqlExpression *createINDictExpr(IErrorReceiver & errorProcessor, ECLlocation & location, IHqlExpression *expr, IHqlExpression *dict)
 {
-    OwnedHqlExpr record = getDictionarySearchRecord(dict->queryRecord());
-    TempTableTransformer transformer(errorProcessor, location, true);
-    OwnedHqlExpr newTransform = transformer.createTempTableTransform(expr, record);
-    return createBoolExpr(no_indict, createRow(no_createrow, newTransform.getClear()), LINK(dict));
+    //Always process the expression and create a row since this also validates the search expression
+    OwnedHqlExpr row = createRowForDictExpr(errorProcessor, location, expr, dict);
+
+    //If only a single expression is being looked up then create no_indict(expr,dict) instead of no_indict(row,dict) to avoid unnecessary row aliases.
+    if (getFlatFieldCount(row->queryRecord()) == 1)
+        return createBoolExpr(no_indict, LINK(expr), LINK(dict));
+
+    return createBoolExpr(no_indict, LINK(row), LINK(dict));
 }
 
 IHqlExpression *createINDictRow(IErrorReceiver & errorProcessor, ECLlocation & location, IHqlExpression *row, IHqlExpression *dict)

+ 1 - 0
ecl/hql/hqlutil.hpp

@@ -466,6 +466,7 @@ extern HQL_API bool isNullList(IHqlExpression * expr);
 extern HQL_API IHqlExpression *getDictionaryKeyRecord(IHqlExpression *record);
 extern HQL_API IHqlExpression *getDictionarySearchRecord(IHqlExpression *record);
 extern HQL_API IHqlExpression * createSelectMapRow(IErrorReceiver & errorProcessor, ECLlocation & location, IHqlExpression * dict, IHqlExpression *values);
+extern HQL_API IHqlExpression * createRowForDictExpr(IErrorReceiver & errorProcessor, ECLlocation & location, IHqlExpression *expr, IHqlExpression *dict);
 extern HQL_API IHqlExpression * createINDictExpr(IErrorReceiver & errorProcessor, ECLlocation & location, IHqlExpression *expr, IHqlExpression *dict);
 extern HQL_API IHqlExpression *createINDictRow(IErrorReceiver & errorProcessor, ECLlocation & location, IHqlExpression *row, IHqlExpression *dict);
 extern HQL_API IHqlExpression * convertTempRowToCreateRow(IErrorReceiver & errorProcessor, ECLlocation & location, IHqlExpression * expr);

+ 3 - 3
ecl/hqlcpp/hqlcpp.ipp

@@ -940,7 +940,7 @@ public:
     void useFunction(IHqlExpression * funcdef);
     void useLibrary(const char * libname);
     void finalizeResources();
-    void generateStatistics(const char * targetDir, const char * varient);
+    void generateStatistics(const char * targetDir, const char * variant);
 
             unsigned getHints()                             { return hints; }
     inline bool queryEvaluateCoLocalRowInvariantInExtract() const { return options.evaluateCoLocalRowInvariantInExtract; }
@@ -980,7 +980,7 @@ public:
     //or isIndependentMaybeShared is false, and the code that is inserted is never implicitly shared.
     bool getInvariantMemberContext(BuildCtx & ctx, BuildCtx * * declarectx, BuildCtx * * initctx, bool isIndependentMaybeShared, bool invariantEachStart);
 
-    IPropertyTree * gatherFieldUsage(const char * varient, const IPropertyTree * exclude);
+    IPropertyTree * gatherFieldUsage(const char * variant, const IPropertyTree * exclude);
     void writeFieldUsage(const char * targetDir, IPropertyTree * xml, const char * variant);
 
 public:
@@ -1017,7 +1017,7 @@ public:
 
     IHqlExpression * getRtlFieldKey(IHqlExpression * expr, IHqlExpression * ownerRecord);
     unsigned buildRtlField(StringBuffer * instanceName, IHqlExpression * fieldKey);
-    unsigned buildRtlType(StringBuffer & instanceName, ITypeInfo * type);
+    unsigned buildRtlType(StringBuffer & instanceName, ITypeInfo * type, unsigned typeFlags);
     unsigned buildRtlRecordFields(StringBuffer & instanceName, IHqlExpression * record, IHqlExpression * rowRecord);
     unsigned expandRtlRecordFields(StringBuffer & fieldListText, IHqlExpression * record, IHqlExpression * rowRecord);
     unsigned buildRtlIfBlockField(StringBuffer & instanceName, IHqlExpression * ifblock, IHqlExpression * rowRecord);

+ 19 - 2
ecl/hqlcpp/hqlcset.cpp

@@ -817,6 +817,9 @@ InlineLinkedDictionaryCursor::InlineLinkedDictionaryCursor(HqlCppTranslator & _t
 
 IHqlExpression * InlineLinkedDictionaryCursor::getFirstSearchValue(IHqlExpression * searchExpr, IHqlExpression * searchRecord)
 {
+    if (!searchExpr->isDatarow())
+        return LINK(searchExpr);
+
     if (searchExpr->getOperator() == no_alias)
         searchExpr = searchExpr->queryChild(0);
 
@@ -881,7 +884,14 @@ BoundRow * InlineLinkedDictionaryCursor::buildSelectMap(BuildCtx & ctx, IHqlExpr
         translator.buildDictionaryHashClass(record, lookupHelperName);
         args.append(*createQuoted(lookupHelperName, makeBoolType()));
         args.append(*LINK(dictionary));
-        args.append(*LINK(searchExpr));
+        if (!searchExpr->isDatarow())
+        {
+            //NOTE: This call should never fail since it has already succeeded in the parser.
+            ECLlocation unknownLocation;
+            args.append(*createRowForDictExpr(translator.queryErrorProcessor(), unknownLocation, searchExpr, dictionary));
+        }
+        else
+            args.append(*LINK(searchExpr));
         args.append(*::createRow(no_null, LINK(record))); // the default record
         lookupFunction = dictionaryLookupId;
     }
@@ -945,7 +955,14 @@ void InlineLinkedDictionaryCursor::buildInDataset(BuildCtx & ctx, IHqlExpression
         translator.buildDictionaryHashClass(record, lookupHelperName);
         args.append(*createQuoted(lookupHelperName, makeBoolType()));
         args.append(*LINK(dictionary));
-        args.append(*LINK(searchExpr));
+        if (!searchExpr->isDatarow())
+        {
+            //NOTE: This call should never fail since it has already succeeded in the parser.
+            ECLlocation unknownLocation;
+            args.append(*createRowForDictExpr(translator.queryErrorProcessor(), unknownLocation, searchExpr, dictionary));
+        }
+        else
+            args.append(*LINK(searchExpr));
         lookupFunction = dictionaryLookupExistsId;
     }
     OwnedHqlExpr call = translator.bindFunctionCall(lookupFunction, args, makeBoolType());

+ 41 - 31
ecl/hqlcpp/hqlhtcpp.cpp

@@ -3504,6 +3504,11 @@ IHqlExpression * HqlCppTranslator::getRtlFieldKey(IHqlExpression * expr, IHqlExp
     return LINK(expr);
 }
 
+bool checkXpathIsNonScalar(const char *xpath)
+{
+    return (strpbrk(xpath, "/?*[]<>")!=NULL); //anything other than a single tag/attr name cannot name a scalar field
+}
+
 unsigned HqlCppTranslator::buildRtlField(StringBuffer * instanceName, IHqlExpression * fieldKey)
 {
     BuildCtx declarectx(*code, declareAtom);
@@ -3544,22 +3549,6 @@ unsigned HqlCppTranslator::buildRtlField(StringBuffer * instanceName, IHqlExpres
             break;
         }
 
-        StringBuffer typeName;
-        typeFlags = buildRtlType(typeName, fieldType);
-
-        StringBuffer lowerName;
-        lowerName.append(field->queryName()).toLowerCase();
-
-        if (options.debugGeneratedCpp)
-        {
-            name.append("rf_");
-            convertToValidLabel(name, lowerName.str(), lowerName.length());
-            name.append("_").append(++nextFieldId);
-        }
-        else
-            name.append("rf").append(++nextFieldId);
-
-
         StringBuffer xpathName, xpathItem;
         switch (fieldType->getTypeCode())
         {
@@ -3579,8 +3568,28 @@ unsigned HqlCppTranslator::buildRtlField(StringBuffer * instanceName, IHqlExpres
             break;
         }
 
-        if (xpathName.length() && (xpathName.charAt(0) == '@'))
-            typeFlags |= RFTMhasxmlattr;
+        if (xpathName.length())
+        {
+            if (xpathName.charAt(0) == '@')
+                typeFlags |= RFTMhasxmlattr;
+            if (checkXpathIsNonScalar(xpathName))
+                typeFlags |= RFTMhasnonscalarxpath;
+        }
+
+        StringBuffer typeName;
+        typeFlags = buildRtlType(typeName, fieldType, typeFlags); //benefit to adding other flags to generated code as well?
+
+        StringBuffer lowerName;
+        lowerName.append(field->queryName()).toLowerCase();
+
+        if (options.debugGeneratedCpp)
+        {
+            name.append("rf_");
+            convertToValidLabel(name, lowerName.str(), lowerName.length());
+            name.append("_").append(++nextFieldId);
+        }
+        else
+            name.append("rf").append(++nextFieldId);
 
         //Format of the xpath field is (nested-item 0x01 repeated-item)
         StringBuffer xpathFull, xpathCppText;
@@ -3731,14 +3740,15 @@ unsigned HqlCppTranslator::getRtlFieldInfo(StringBuffer & fieldInfoName, IHqlExp
     return buildRtlField(&fieldInfoName, fieldKey);
 }
 
-unsigned HqlCppTranslator::buildRtlType(StringBuffer & instanceName, ITypeInfo * type)
+unsigned HqlCppTranslator::buildRtlType(StringBuffer & instanceName, ITypeInfo * type, unsigned typeFlags)
 {
     assertex(type);
     type_t tc = type->getTypeCode();
     if (tc == type_record)
         type = queryUnqualifiedType(type);
 
-    OwnedHqlExpr search = createVariable("t", LINK(type));
+    VStringBuffer searchKey("t%d", typeFlags);
+    OwnedHqlExpr search = createVariable(searchKey, LINK(type));
     BuildCtx declarectx(*code, declareAtom);
     HqlExprAssociation * match = declarectx.queryMatchExpr(search);
     if (match)
@@ -3760,7 +3770,7 @@ unsigned HqlCppTranslator::buildRtlType(StringBuffer & instanceName, ITypeInfo *
     else
         name.append("ty").append(++nextTypeId);
 
-    unsigned fieldType= 0;
+    unsigned fieldType = typeFlags;
     if (tc == type_alien)
     {
         ITypeInfo * physicalType = queryAlienType(type)->queryPhysicalType();
@@ -3869,7 +3879,7 @@ unsigned HqlCppTranslator::buildRtlType(StringBuffer & instanceName, ITypeInfo *
         {
             className.clear().append("RtlRowTypeInfo");
             arguments.append(",&");
-            childType = buildRtlType(arguments, ::queryRecordType(type));
+            childType = buildRtlType(arguments, ::queryRecordType(type), 0);
 //          fieldType |= (childType & RFTMcontainsifblock);
             if (hasLinkCountedModifier(type))
                 fieldType |= RFTMlinkcounted;
@@ -3880,7 +3890,7 @@ unsigned HqlCppTranslator::buildRtlType(StringBuffer & instanceName, ITypeInfo *
         {
             className.clear().append("RtlDatasetTypeInfo");
             arguments.append(",&");
-            childType = buildRtlType(arguments, ::queryRecordType(type));
+            childType = buildRtlType(arguments, ::queryRecordType(type), 0);
             if (hasLinkCountedModifier(type))
                 fieldType |= RFTMlinkcounted;
             break;
@@ -3889,7 +3899,7 @@ unsigned HqlCppTranslator::buildRtlType(StringBuffer & instanceName, ITypeInfo *
         {
             className.clear().append("RtlDictionaryTypeInfo");
             arguments.append(",&");
-            childType = buildRtlType(arguments, ::queryRecordType(type));
+            childType = buildRtlType(arguments, ::queryRecordType(type), 0);
             if (hasLinkCountedModifier(type))
                 fieldType |= RFTMlinkcounted;
             StringBuffer lookupHelperName;
@@ -3900,7 +3910,7 @@ unsigned HqlCppTranslator::buildRtlType(StringBuffer & instanceName, ITypeInfo *
     case type_set:
         className.clear().append("RtlSetTypeInfo");
         arguments.append(",&");
-        childType = buildRtlType(arguments, type->queryChildType());
+        childType = buildRtlType(arguments, type->queryChildType(), 0);
         break;
     case type_unicode:
         className.clear().append("RtlUnicodeTypeInfo");
@@ -4117,7 +4127,7 @@ void HqlCppTranslator::buildMetaInfo(MetaInstance & instance)
             assertex(!instance.isGrouped());
 
             StringBuffer typeName;
-            unsigned recordTypeFlags = buildRtlType(typeName, record->queryType());
+            unsigned recordTypeFlags = buildRtlType(typeName, record->queryType(), 0);
             s.clear().append("virtual const RtlTypeInfo * queryTypeInfo() const { return &").append(typeName).append("; }");
             metactx.addQuoted(s);
 
@@ -6031,10 +6041,10 @@ static int compareTrackedSourceByName(CInterface * const * _left, CInterface * c
     return stricmp(leftName, rightName);
 }
 
-IPropertyTree * HqlCppTranslator::gatherFieldUsage(const char * varient, const IPropertyTree * exclude)
+IPropertyTree * HqlCppTranslator::gatherFieldUsage(const char * variant, const IPropertyTree * exclude)
 {
     Owned<IPropertyTree> sources = createPTree("usedsources");
-    sources->setProp("@varient", varient);
+    sources->setProp("@varient", variant);
     trackedSources.sort(compareTrackedSourceByName);
     ForEachItemIn(i, trackedSources)
     {
@@ -6099,11 +6109,11 @@ void HqlCppTranslator::writeFieldUsage(const char * targetDir, IPropertyTree * s
 }
 
 
-void HqlCppTranslator::generateStatistics(const char * targetDir, const char * varient)
+void HqlCppTranslator::generateStatistics(const char * targetDir, const char * variant)
 {
     if ((options.reportFieldUsage || options.reportFileUsage) && trackedSources.ordinality())
     {
-        Owned<IPropertyTree> sources = gatherFieldUsage(varient, NULL);
+        Owned<IPropertyTree> sources = gatherFieldUsage(variant, NULL);
         writeFieldUsage(targetDir, sources, NULL);
     }
 }
@@ -6781,7 +6791,7 @@ ABoundActivity * HqlCppTranslator::buildActivity(BuildCtx & ctx, IHqlExpression
                 }
         }
     }
-    catch (IError * e)
+    catch (IError *)
     {
         throw;
     }

+ 2 - 3
ecl/hqlcpp/hqliproj.cpp

@@ -1996,9 +1996,8 @@ ProjectExprKind ImplicitProjectTransformer::getProjectExprKind(IHqlExpression *
         return CreateRecordSourceActivity;
     case no_createdictionary:
         return FixedInputActivity;
-    case no_indict:
     case no_selectmap:
-        return FixedInputActivity;
+        return SourceActivity;
     case no_extractresult:
     case no_apply:
         return SinkActivity;
@@ -3163,7 +3162,7 @@ IHqlExpression * ImplicitProjectTransformer::process(IHqlExpression * expr)
         // same as roxie, but also maybe worth inserting projects to minimise the amount of data that is spilled.
         break;
     case ThorLCRCluster:
-        //worth inserting projects to reduce copying, spilling, but primarily data transfered between nodes.
+        //worth inserting projects to reduce copying, spilling, but primarily data transferred between nodes.
         if (options.insertProjectCostLevel || options.optimizeSpills)
             insertProjects();
         break;

+ 3 - 3
ecl/hqlcpp/hqlttcpp.cpp

@@ -6081,9 +6081,9 @@ IHqlExpression * WorkflowTransformer::transformInternalCall(IHqlExpression * tra
     IHqlExpression * funcDef = transformed->queryDefinition();
     Owned<IHqlExpression> newFuncDef = transform(funcDef);
 
-    HqlExprArray paramters;
-    unwindChildren(paramters, transformed);
-    OwnedHqlExpr rebound = createReboundFunction(newFuncDef, paramters);
+    HqlExprArray parameters;
+    unwindChildren(parameters, transformed);
+    OwnedHqlExpr rebound = createReboundFunction(newFuncDef, parameters);
     inheritDependencies(rebound);
     copyDependencies(queryBodyExtra(newFuncDef), queryBodyExtra(rebound));
     return rebound.getClear();

+ 1 - 1
ecl/hthor/hthor.cpp

@@ -6110,7 +6110,7 @@ void CHThorDictionaryWorkUnitWriteActivity::execute()
         builder.appendOwn(row);
         processed++;
     }
-    size32_t usedCount = rtlDictionaryCount(builder.getcount(), builder.queryrows());
+    unsigned __int64 usedCount = rtlDictionaryCount(builder.getcount(), builder.queryrows());
 
     // In absense of OPT_OUTPUTLIMIT check pre 5.2 legacy name OPT_OUTPUTLIMIT_LEGACY
     size32_t outputLimit = agent.queryWorkUnit()->getDebugValueInt(OPT_OUTPUTLIMIT, agent.queryWorkUnit()->getDebugValueInt(OPT_OUTPUTLIMIT_LEGACY, defaultDaliResultLimit)) * 0x100000;

+ 1 - 1
esp/clients/LoggingClient/LocalDataLogger.cpp

@@ -171,7 +171,7 @@ MemoryBuffer& CLocalDataLogger::readData(MemoryBuffer& dataCached,const char* ca
                         size32_t memfilesize = (size32_t)filesize;
                         //Check size isn't >= 2^32
                         assertex(filesize == memfilesize);
-                        io->read(0, filesize, dataCached.reserveTruncate(memfilesize));
+                        io->read(0, memfilesize, dataCached.reserveTruncate(memfilesize));
                         DBGLOG("Managed to read");
                         return dataCached;
                     }

+ 3 - 1
esp/platform/espcfg.cpp

@@ -526,7 +526,9 @@ public:
             if (fio)
             {
                 offset_t len=fio->size();
-                if (fio->read(0, len, buff.reserveTruncate(len))==len)
+                size32_t memlen = (size32_t)len;
+                assertex(len == memlen);
+                if (fio->read(0, memlen, buff.reserveTruncate(memlen))==len)
                     return true;
             }
         }

+ 2 - 2
esp/platform/espthread.hpp

@@ -39,8 +39,8 @@ protected:
 public:
     IMPLEMENT_IINTERFACE;
     
-   CEspProtocolThread(const char *name = "Unkown service type");
-   CEspProtocolThread(ISocket *sock, const char *name = "Unkown service type");
+   CEspProtocolThread(const char *name = "Unknown service type");
+   CEspProtocolThread(ISocket *sock, const char *name = "Unknown service type");
 
    virtual ~CEspProtocolThread();
    virtual void start();

+ 1 - 1
esp/services/common/jsonhelpers.hpp

@@ -157,7 +157,7 @@ namespace JsonHelpers
 
         StringBuffer temp;
         IArrayOf<IException>& exceptions = e->getArray();
-        for (int i = 0 ; i < exceptions.ordinality(); i++)
+        for (unsigned i = 0 ; i < exceptions.ordinality(); i++)
         {
             appendJSONExceptionItem(s, e->errorCode(), e->errorMessage(temp.clear()).str(), objname, arrayName);
         }

+ 3 - 3
esp/services/ws_dfu/ws_dfuService.cpp

@@ -4264,8 +4264,8 @@ bool CWsDfuEx::onDFUGetFileMetaData(IEspContext &context, IEspDFUGetFileMetaData
 {
     class CDFUFileMetaDataReader
     {
-        int totalColumnCount;
-        int keyedColumnCount;
+        unsigned totalColumnCount;
+        unsigned keyedColumnCount;
         StringBuffer XmlSchema, XmlXPathSchema;
         IArrayOf<IEspDFUDataColumn> dataColumns;
         const IResultSetMetaData& meta;
@@ -4314,7 +4314,7 @@ bool CWsDfuEx::onDFUGetFileMetaData(IEspContext &context, IEspDFUGetFileMetaData
     public:
         CDFUFileMetaDataReader(const IResultSetMetaData& _meta) : meta(_meta)
         {
-            totalColumnCount = meta.getColumnCount();
+            totalColumnCount = (unsigned)meta.getColumnCount();
             keyedColumnCount = meta.getNumKeyedColumns();
             unsigned i = 0;
             for (; i < keyedColumnCount; i++)

+ 1 - 1
esp/test/httptest/httptest.cpp

@@ -465,7 +465,7 @@ int HttpClient::sendRequest(int times, HttpStat& stat, StringBuffer& req)
     else
         request.append(c1);
 
-    int seq = 2;
+    unsigned seq = 2;
     while(seq < req.length() && !endofheaders)
     {
         char c = req.charAt(seq);

+ 1 - 1
esp/test/httptest/httptest.hpp

@@ -52,7 +52,7 @@ public:
         fprintf(ofile, "Total data received:              %" I64F "d\n", totalresplen);
         __int64 totallen = totalreqlen + totalresplen;
         fprintf(ofile, "Total data transferred:           %" I64F "d\n", totallen);
-        fprintf(ofile, "Data transfered per second:       %5.1f\n", totallen/(msecs*0.001));
+        fprintf(ofile, "Data transferred per second:      %5.1f\n", totallen/(msecs*0.001));
         fprintf(ofile, "Slowest round trip(millisecond):  %d\n", slowest);
         fprintf(ofile, "Fastest round trip(millisecond):  %d\n", fastest);
     }

+ 3 - 3
esp/tools/soapplus/http.cpp

@@ -69,7 +69,7 @@ void HttpStat::printStat(FILE* ofile)
         __int64 totallen = totalreqlen + totalresplen;
         fprintf(ofile, "Total data transferred:           %Ld\n", totallen);
         if(duration > 0)
-            fprintf(ofile, "Data transfered per second:       %5.1f\n", totallen/(duration*0.001));
+            fprintf(ofile, "Data transferred per second:      %5.1f\n", totallen/(duration*0.001));
         if(numrequests > 0)
         {
             fprintf(ofile, "Slowest round trip(millisecond):  %d\n", slowest);
@@ -1351,7 +1351,7 @@ int HttpClient::validate(StringBuffer& xml)
         if(http_tracelevel > 0)
         {
             IArrayOf<IException> &es = me->getArray();
-            for (int i=0; i<es.ordinality(); i++)
+            for (unsigned i=0; i<es.ordinality(); i++)
             {
                 StringBuffer msg;
                 IException& e = es.item(i);
@@ -1430,7 +1430,7 @@ int HttpClient::sendRequest(StringBuffer& req, IFileIO* request_output, IFileIO*
     else
         request.append(c1);
 
-    int seq = 2;
+    unsigned seq = 2;
     while(seq < req.length() && !endofheaders)
     {
         char c = req.charAt(seq);

+ 1 - 1
roxie/ccd/ccdcontext.cpp

@@ -53,7 +53,7 @@ class CSlaveDebugContext : public CBaseDebugContext
     4. There is a problem when a slave hits a breakpoint in that the breakpoint cound have been deleted by the time it gets a chance to tell the Roxie server - can't
        happen in local case because of the critical block at the head of checkBreakpoint but the local copy of BPs out on slave CAN get out of date. Should we care?
        Should there be a "Sorry, your breakpoints are out of date, here's the new set" response?
-       Actually what we do is recheck the BP on the server, and ensure that breakpoint indexes are persistant. DONE
+       Actually what we do is recheck the BP on the server, and ensure that breakpoint indexes are persistent. DONE
     5. We need to serialize over our graph info if changed since last time.
     6. I think we need to change implementation of debugGraph to support children. Then we have a place to put a proxy for a remote one.
        - id's should probably be structured so we can use a hash table at each level

+ 1 - 1
roxie/ccd/ccdserver.cpp

@@ -2494,7 +2494,7 @@ public:
     }
 
     // Note that this caching mechanism (unlike the old keyed-join specific one) does not common up cases where multiple 
-    // identical queries are in-flight at the same time. But if we can make it persistant between queries that will 
+    // identical queries are in-flight at the same time. But if we can make it persistent between queries that will
     // more than make up for it
 };
 

+ 1 - 1
roxie/roxieclient/roxieclient.cpp

@@ -261,7 +261,7 @@ void RoxieThread::immediateOutput(size32_t len, const char* result)
     }
     else
     {
-        throw MakeStringException(-1, "Output stream not set. Pleaes set default outputstream, or use bxml as output format");
+        throw MakeStringException(-1, "Output stream not set. Please set default outputstream, or use bxml as output format");
     }
 }
 

+ 28 - 22
rtl/eclrtl/rtlfield.cpp

@@ -39,6 +39,12 @@ static const char * queryXPath(const RtlFieldInfo * field)
     return field->name->str();
 }
 
+static const char * queryScalarXPath(const RtlFieldInfo * field)
+{
+    if (field->type->hasNonScalarXpath())
+        return field->name->str();
+    return queryXPath(field);
+}
 
 static bool hasOuterXPath(const RtlFieldInfo * field)
 {
@@ -140,7 +146,7 @@ size32_t RtlBoolTypeInfo::process(const byte * self, const byte * selfrow, const
 
 size32_t RtlBoolTypeInfo::toXML(const byte * self, const byte * selfrow, const RtlFieldInfo * field, IXmlWriter & target) const
 {
-    target.outputBool(*(const bool *)self, queryXPath(field));
+    target.outputBool(*(const bool *)self, queryScalarXPath(field));
     return sizeof(bool);
 }
 
@@ -174,7 +180,7 @@ size32_t RtlRealTypeInfo::process(const byte * self, const byte * selfrow, const
 
 size32_t RtlRealTypeInfo::toXML(const byte * self, const byte * selfrow, const RtlFieldInfo * field, IXmlWriter & target) const
 {
-    target.outputReal(value(self), queryXPath(field));
+    target.outputReal(value(self), queryScalarXPath(field));
     return length;
 }
 
@@ -201,9 +207,9 @@ size32_t RtlIntTypeInfo::process(const byte * self, const byte * selfrow, const
 size32_t RtlIntTypeInfo::toXML(const byte * self, const byte * selfrow, const RtlFieldInfo * field, IXmlWriter & target) const
 {
     if (isUnsigned())
-        target.outputUInt(rtlReadUInt(self, length), length, queryXPath(field));
+        target.outputUInt(rtlReadUInt(self, length), length, queryScalarXPath(field));
     else
-        target.outputInt(rtlReadInt(self, length), length, queryXPath(field));
+        target.outputInt(rtlReadInt(self, length), length, queryScalarXPath(field));
     return length;
 }
 
@@ -231,9 +237,9 @@ size32_t RtlSwapIntTypeInfo::process(const byte * self, const byte * selfrow, co
 size32_t RtlSwapIntTypeInfo::toXML(const byte * self, const byte * selfrow, const RtlFieldInfo * field, IXmlWriter & target) const
 {
     if (isUnsigned())
-        target.outputUInt(rtlReadSwapUInt(self, length), length, queryXPath(field));
+        target.outputUInt(rtlReadSwapUInt(self, length), length, queryScalarXPath(field));
     else
-        target.outputInt(rtlReadSwapInt(self, length), length, queryXPath(field));
+        target.outputInt(rtlReadSwapInt(self, length), length, queryScalarXPath(field));
     return length;
 }
 
@@ -267,9 +273,9 @@ size32_t RtlPackedIntTypeInfo::toXML(const byte * self, const byte * selfrow, co
 {
     size32_t fieldsize = rtlGetPackedSize(self);
     if (isUnsigned())
-        target.outputUInt(rtlGetPackedUnsigned(self), fieldsize, queryXPath(field));
+        target.outputUInt(rtlGetPackedUnsigned(self), fieldsize, queryScalarXPath(field));
     else
-        target.outputInt(rtlGetPackedSigned(self), fieldsize, queryXPath(field));
+        target.outputInt(rtlGetPackedSigned(self), fieldsize, queryScalarXPath(field));
     return fieldsize;
 }
 
@@ -373,11 +379,11 @@ size32_t RtlStringTypeInfo::toXML(const byte * self, const byte * selfrow, const
         unsigned lenAscii;
         rtlDataAttr ascii;
         rtlEStrToStrX(lenAscii, ascii.refstr(), thisLength, str);
-        target.outputString(lenAscii, ascii.getstr(), queryXPath(field));
+        target.outputString(lenAscii, ascii.getstr(), queryScalarXPath(field));
     }
     else
     {
-        target.outputString(thisLength, str, queryXPath(field));
+        target.outputString(thisLength, str, queryScalarXPath(field));
     }
     return thisSize;
 }
@@ -453,7 +459,7 @@ size32_t RtlDataTypeInfo::toXML(const byte * self, const byte * selfrow, const R
         thisSize = sizeof(size32_t) + thisLength;
     }
 
-    target.outputData(thisLength, str, queryXPath(field));
+    target.outputData(thisLength, str, queryScalarXPath(field));
     return thisSize;
 }
 
@@ -530,10 +536,10 @@ size32_t RtlVarStringTypeInfo::toXML(const byte * self, const byte * selfrow, co
         unsigned lenAscii;
         rtlDataAttr ascii;
         rtlEStrToStrX(lenAscii, ascii.refstr(), thisLength, str);
-        target.outputString(lenAscii, ascii.getstr(), queryXPath(field));
+        target.outputString(lenAscii, ascii.getstr(), queryScalarXPath(field));
     }
     else
-        target.outputString(thisLength, str, queryXPath(field));
+        target.outputString(thisLength, str, queryScalarXPath(field));
 
     return thisSize;
 }
@@ -611,7 +617,7 @@ size32_t RtlQStringTypeInfo::toXML(const byte * self, const byte * selfrow, cons
         thisSize = sizeof(size32_t) + rtlQStrSize(thisLength);
     }
 
-    target.outputQString(thisLength, str, queryXPath(field));
+    target.outputQString(thisLength, str, queryScalarXPath(field));
     return thisSize;
 }
 
@@ -657,9 +663,9 @@ size32_t RtlDecimalTypeInfo::toXML(const byte * self, const byte * selfrow, cons
 {
     size32_t thisSize = calcSize();
     if (isUnsigned())
-        target.outputUDecimal(self, thisSize, getDecimalPrecision(), queryXPath(field));
+        target.outputUDecimal(self, thisSize, getDecimalPrecision(), queryScalarXPath(field));
     else
-        target.outputDecimal(self, thisSize, getDecimalPrecision(), queryXPath(field));
+        target.outputDecimal(self, thisSize, getDecimalPrecision(), queryScalarXPath(field));
     return thisSize;
 }
 
@@ -690,7 +696,7 @@ size32_t RtlCharTypeInfo::toXML(const byte * self, const byte * selfrow, const R
         rtlEStrToStr(1, &c, 1, str);
     else
         c = *str;
-    target.outputString(1, &c, queryXPath(field));
+    target.outputString(1, &c, queryScalarXPath(field));
     return 1;
 }
 
@@ -767,7 +773,7 @@ size32_t RtlUnicodeTypeInfo::toXML(const byte * self, const byte * selfrow, cons
         thisSize = sizeof(size32_t) + thisLength * sizeof(UChar);
     }
 
-    target.outputUnicode(thisLength, ustr, queryXPath(field));
+    target.outputUnicode(thisLength, ustr, queryScalarXPath(field));
     return thisSize;
 }
 
@@ -831,7 +837,7 @@ size32_t RtlVarUnicodeTypeInfo::toXML(const byte * self, const byte * selfrow, c
     else
         thisSize = (thisLength + 1) * sizeof(UChar);
 
-    target.outputUnicode(thisLength, ustr, queryXPath(field));
+    target.outputUnicode(thisLength, ustr, queryScalarXPath(field));
     return thisSize;
 }
 
@@ -877,7 +883,7 @@ size32_t RtlUtf8TypeInfo::toXML(const byte * self, const byte * selfrow, const R
     unsigned thisLength = rtlReadUInt4(self);
     unsigned thisSize = sizeof(size32_t) + rtlUtf8Size(thisLength, str);
 
-    target.outputUtf8(thisLength, str, queryXPath(field));
+    target.outputUtf8(thisLength, str, queryScalarXPath(field));
     return thisSize;
 }
 
@@ -1420,9 +1426,9 @@ size32_t RtlBitfieldTypeInfo::toXML(const byte * self, const byte * selfrow, con
 {
     size32_t fieldsize = size(self, selfrow);
     if (isUnsigned())
-        target.outputUInt(unsignedValue(self), fieldsize, queryXPath(field));
+        target.outputUInt(unsignedValue(self), fieldsize, queryScalarXPath(field));
     else
-        target.outputInt(signedValue(self), fieldsize, queryXPath(field));
+        target.outputInt(signedValue(self), fieldsize, queryScalarXPath(field));
     return fieldsize;
 }
 

+ 2 - 1
rtl/include/eclhelper.hpp

@@ -326,6 +326,7 @@ enum RtlFieldTypeMask
 
     RFTMalien               = 0x00000800,                   // this is the physical format of a user defined type, if unknown size we can't calculate it
     RFTMcontainsifblock     = 0x00000800,                   // contains an if block - if set on a record then it contains ifblocks, so can't work out field offsets.
+    RFTMhasnonscalarxpath   = 0x00001000,                   // field xpath contains only one node, and is therefore usable for naming scalar fields
 
     RFTMcontainsunknown     = 0x10000000,                   // contains a field of unknown type that we can't process properly
     RFTMinvalidxml          = 0x20000000,                   // cannot be called to generate xml
@@ -363,6 +364,7 @@ struct RtlTypeInfo : public RtlITypeInfo
     inline bool isFixedSize() const { return (fieldType & RFTMunknownsize) == 0; }
     inline bool isLinkCounted() const { return (fieldType & RFTMlinkcounted) != 0; }
     inline bool isUnsigned() const { return (fieldType & RFTMunsigned) != 0; }
+    inline bool hasNonScalarXpath() const { return (fieldType & RFTMhasnonscalarxpath) != 0; }
     inline unsigned getDecimalDigits() const { return (length & 0xffff); }
     inline unsigned getDecimalPrecision() const { return (length >> 16); }
     inline unsigned getBitfieldIntSize() const { return (length & 0xff); }
@@ -376,7 +378,6 @@ public:
                                     // if RFTMunknownsize then maxlength (records) [maxcount(datasets)]
 };
 
-
 //Core struct used for representing meta for a field.
 struct RtlFieldInfo
 {

+ 2 - 2
system/hrpc/hrpcmp.cpp

@@ -425,7 +425,7 @@ public:
     }
 
     
-    //Receive will fill HRPCbuffer with what is heard (recieved message)
+    //Receive will fill HRPCbuffer with what is heard (received message)
     void Receive(HRPCbuffer &c,int timeo)
     {
         mb.clear();
@@ -445,7 +445,7 @@ public:
         h->winrev();
     }
 
-    //block until there is a message recieved by this node
+    //block until there is a message received by this node
     bool Listen()
     {   
         return state->Listen();

+ 2 - 0
system/include/platform.h

@@ -93,8 +93,10 @@ typedef memsize_t rowsize_t;
 
 #ifdef _WIN32
 #define I64C(n) n##i64
+#define U64C(n) n##ui64
 #else
 #define I64C(n) n##LL
+#define U64C(n) n##ULL
 #endif
 
 // **** END   OF X-PLATFORM SECTION ****

+ 11 - 11
system/mp/mpcomm.cpp

@@ -70,10 +70,10 @@
 #define VERIFY_DELAY            (1*60*1000)  // 1 Minute
 #define VERIFY_TIMEOUT          (1*60*1000)  // 1 Minute
 
-#define DIGIT1 (256UL*256UL*256UL*65536UL)
-#define DIGIT2 (256UL*256UL*65536UL)
-#define DIGIT3 (256UL*65536UL)
-#define DIGIT4 (65536UL)
+#define DIGIT1 U64C(0x10000000000) // (256ULL*256ULL*256ULL*65536ULL)
+#define DIGIT2 U64C(0x100000000)   // (256ULL*256ULL*65536ULL)
+#define DIGIT3 U64C(0x1000000)     // (256ULL*65536ULL)
+#define DIGIT4 U64C(0x10000)       // (65536ULL)
 
 #define _TRACING
 
@@ -676,7 +676,7 @@ class CMPChannel: public CInterface
     bool closed;
     IArrayOf<ISocket> keptsockets;
     CriticalSection attachsect;
-    unsigned long attachaddrval;
+    unsigned __int64 attachaddrval;
     SocketEndpoint attachep;
     atomic_t attachchk;
 
@@ -730,7 +730,7 @@ protected: friend class CMPPacketReader;
 
                 unsigned __int64 addrval = DIGIT1*id[0].ip[0] + DIGIT2*id[0].ip[1] + DIGIT3*id[0].ip[2] + DIGIT4*id[0].ip[3] + id[0].port;
 #ifdef _TRACE
-                PROGLOG("MP: connect addrval = %lu", addrval);
+                PROGLOG("MP: connect addrval = %" I64F "u", addrval);
 #endif
 
                 newsock->write(&id[0],sizeof(id)); 
@@ -773,7 +773,7 @@ protected: friend class CMPPacketReader;
                             if (remoteep.equals(attachep))
                             {
 #ifdef _TRACE
-                                PROGLOG("MP: deadlock situation [] attachaddrval = %lu addrval = %lu", attachaddrval, addrval);
+                                PROGLOG("MP: deadlock situation [] attachaddrval = %" I64F "u addrval = %" I64F "u", attachaddrval, addrval);
 #endif
                                 if (attachaddrval < addrval)
                                     break;
@@ -934,7 +934,7 @@ public:
 
     void reset();
 
-    bool attachSocket(ISocket *newsock,const SocketEndpoint &_remoteep,const SocketEndpoint &_localep,bool ismaster,size32_t *confirm, unsigned long addrval=0);
+    bool attachSocket(ISocket *newsock,const SocketEndpoint &_remoteep,const SocketEndpoint &_localep,bool ismaster,size32_t *confirm, unsigned __int64 addrval=0);
 
     bool writepacket(const void *hdr,size32_t hdrsize,const void *hdr2,size32_t hdr2size,const void *body,size32_t bodysize,CTimeMon &tm)
     {
@@ -1558,7 +1558,7 @@ CMPChannel::~CMPChannel()
     reader->Release();
 }
 
-bool CMPChannel::attachSocket(ISocket *newsock,const SocketEndpoint &_remoteep,const SocketEndpoint &_localep,bool ismaster,size32_t *confirm, unsigned long addrval) // takes ownership if succeeds
+bool CMPChannel::attachSocket(ISocket *newsock,const SocketEndpoint &_remoteep,const SocketEndpoint &_localep,bool ismaster,size32_t *confirm, unsigned __int64 addrval) // takes ownership if succeeds
 {
     struct attachdTor
     {
@@ -1568,7 +1568,7 @@ bool CMPChannel::attachSocket(ISocket *newsock,const SocketEndpoint &_remoteep,c
     } attachChk (attachchk);
 
 #ifdef _FULLTRACE       
-    PROGLOG("MP: attachSocket on entry, ismaster = %d, confirm = %p, channelsock = %p, addrval = %u", ismaster, confirm, channelsock, addrval);
+    PROGLOG("MP: attachSocket on entry, ismaster = %d, confirm = %p, channelsock = %p, addrval = %" I64F "u", ismaster, confirm, channelsock, addrval);
 #endif
 
     {
@@ -1908,7 +1908,7 @@ int CMPConnectThread::run()
 
                 unsigned __int64 addrval = DIGIT1*id[0].ip[0] + DIGIT2*id[0].ip[1] + DIGIT3*id[0].ip[2] + DIGIT4*id[0].ip[3] + id[0].port;
 #ifdef _TRACE
-                PROGLOG("MP: Connect Thread: addrval = %lu", addrval);
+                PROGLOG("MP: Connect Thread: addrval = %" I64F "u", addrval);
 #endif
 
                 if (_remoteep.isNull() || hostep.isNull())

+ 8 - 0
testing/regress/ecl/key/xmloutScalarXpath.xml

@@ -0,0 +1,8 @@
+<Dataset name='OriginalReadRow'>
+ <Row><L1><L2><fname>MOE</fname><lname>DOE</lname><pr>1</pr><st>11TH</st><zi>11</zi><ag>31</ag><ix>315367</ix></L2><L2><fname>JOE</fname><lname>POE</lname><pr>2</pr><st>22ND</st><zi>11</zi><ag>32</ag><ix>315370</ix></L2><L2><fname>XOE</fname><lname>ROE</lname><pr>3</pr><st>33RD</st><zi>11</zi><ag>33</ag><ix>315204</ix></L2></L1></Row>
+</Dataset>
+<Dataset name='Result 2'>
+</Dataset>
+<Dataset name='readWrittenDataset'>
+ <Row><L1><L2><fname>MOE</fname><lname>DOE</lname><pr>1</pr><st>11TH</st><zi>11</zi><ag>31</ag><ix>315367</ix></L2><L2><fname>JOE</fname><lname>POE</lname><pr>2</pr><st>22ND</st><zi>11</zi><ag>32</ag><ix>315370</ix></L2><L2><fname>XOE</fname><lname>ROE</lname><pr>3</pr><st>33RD</st><zi>11</zi><ag>33</ag><ix>315204</ix></L2></L1></Row>
+</Dataset>

+ 50 - 0
testing/regress/ecl/xmloutScalarXpath.ecl

@@ -0,0 +1,50 @@
+origReadRec :=       RECORD
+   string fn {xpath('fname')};
+   string ln {xpath('lname')};
+   string pr {xpath('Rec/prange')};
+   string st {xpath('Rec/street')};
+   string zi {xpath('Rec/zips')};
+   string ag {xpath('Rec/age')};
+   integer8 ix {xpath('Rec/id')};
+END;
+
+L1rec := RECORD
+   DATASET(origReadRec) deep{xpath('L1/L2')};
+END;
+
+
+x := u8'<root><L1>' +
+       u8'<L2><fname>MOE</fname><lname>DOE</lname>' +
+         u8'<Rec><prange>1</prange><street>11TH</street><zips>11</zips><age>31</age><id>315367</id></Rec>' +
+       u8'</L2>' +
+       u8'<L2><fname>JOE</fname><lname>POE</lname>' +
+         u8'<Rec><prange>2</prange><street>22ND</street><zips>11</zips><age>32</age><id>315370</id></Rec>' +
+       u8'</L2>' +
+       u8'<L2><fname>XOE</fname><lname>ROE</lname>' +
+         u8'<Rec><prange>3</prange><street>33RD</street><zips>11</zips><age>33</age><id>315204</id></Rec>' +
+       u8'</L2>' +
+     u8'</L1></root>';
+
+
+xrow := FROMXML(L1Rec, x);
+output(xrow, named('OriginalReadRow'));
+
+
+
+scalarReadRec :=       RECORD
+   string fn {xpath('fname')};
+   string ln {xpath('lname')};
+   string pr;
+   string st;
+   string zi;
+   string ag;
+   integer8 ix;
+END;
+
+readL1rec := RECORD
+   DATASET(scalarReadRec) deep{xpath('L1/L2')};
+END;
+
+output(Dataset(xrow),,'REGRESS::TEMP::output_scalar_xpath.xml',overwrite, xml);
+readWrittenXml := dataset(DYNAMIC('REGRESS::TEMP::output_scalar_xpath.xml'), readL1Rec, xml('Dataset/Row'));
+output(readWrittenXml, named('readWrittenDataset'));

+ 1 - 1
thorlcr/master/thgraphmanager.cpp

@@ -413,7 +413,7 @@ void CJobManager::run()
                             unsigned e = msTick() - t;
                             StringBuffer msg;
                             if (_item.get())
-                                msg.append("Jobqueue item retreived");
+                                msg.append("Jobqueue item retrieved");
                             else
                                 msg.append("Nothing found on jobq::dequeue");
                             if (e>=5000)

+ 1 - 1
tools/backupnode/backupnode.cpp

@@ -221,7 +221,7 @@ static void usage()
     printf("  -D - overwrite existing files if size/date mismatch\n");
     printf("  -E - set compression state of existing files\n");
     printf("  -F <file> - use option XML file\n");
-    printf("  -I <ext> - ignore files that have specified extention\n");
+    printf("  -I <ext> - ignore files that have specified extension\n");
     printf("  -M - ignore sub-second differences when comparing file dates\n");
     printf("  -N - Include files even if slave count does not match filename\n");
     printf("  -Q - quiet mode: only errors are reported\n");

+ 3 - 3
tools/esdlcmd/esdlcmd_core.cpp

@@ -228,7 +228,7 @@ public:
 
             loadTransform( fullxsltpath, params);
 
-            for( int i=0; i < optXformTimes; i++ )
+            for( unsigned i=0; i < optXformTimes; i++ )
             {
                 doTransform( *structs, outputBuffer, optVersion, opts.get(), NULL, optFlags );
             }
@@ -268,7 +268,7 @@ public:
         puts("                        only used for inheritance, and collapses their elements into their child. That simplifies the\n" );
         puts("                        stylesheet. By default this option is on.");
         puts("  --no-arrayof : Supresses the use of the arrrayof element. arrayof optimizes the XML output to include 'ArrayOf...'\n" );
-        puts("                        structure definitions for those EsdlArray elements with no item_tag attribute. Works in conjuction\n" );
+        puts("                        structure definitions for those EsdlArray elements with no item_tag attribute. Works in conjunction\n" );
         puts("                        with an optimized stylesheet that doesn't generate these itself. This defaults to on.");
     }
 
@@ -549,7 +549,7 @@ public:
             createParams();
             loadTransform( fullxsltpath, params);
 
-            for( int i=0; i < optXformTimes; i++ )
+            for( unsigned i=0; i < optXformTimes; i++ )
             {
                 doTransform( *structs, outputBuffer, optVersion, opts.get(), NULL, optFlags );
             }

+ 2 - 2
tools/testsocket/testsocket.cpp

@@ -600,7 +600,7 @@ void usage(int exitCode)
 {
     printf("testsocket ip<:port> [flags] [query | -f[f] file.sql | -]\n");
     printf("  -         take query from stdin\n");
-    printf("  -a        abort before input recieved\n");
+    printf("  -a        abort before input received\n");
     printf("  -a1       abort after first packet receieved\n");
     printf("  -c        test sending response to a socket\n");
     printf("  -cb       test sending response to a block mode socket\n");
@@ -614,7 +614,7 @@ void usage(int exitCode)
     printf("  -n        multiple results - keep going until socket closes\n");
     printf("  -o        set output filename\n");
     printf("  -or       set output filename for raw output\n");
-    printf("  -persist  use persistant connection\n");
+    printf("  -persist  use persistent connection\n");
     printf("  -pr <text>add a prefix to the query\n");
     printf("  -q        quiet - don't echo query\n");
     printf("  -qname xx Use xx as queryname in place of the xml root element name\n");