Browse Source

Merge branch 'candidate-5.0.6' into candidate-5.2.0

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 10 years ago
parent
commit
853525fee5
4 changed files with 21 additions and 5 deletions
  1. 4 2
      dali/base/dadfs.cpp
  2. 1 1
      ecl/hql/hqlexpr.cpp
  3. 13 2
      ecl/hqlcpp/hqlcset.cpp
  4. 3 0
      ecl/hqlcpp/hqlcset.ipp

+ 4 - 2
dali/base/dadfs.cpp

@@ -47,6 +47,7 @@
 #define SDS_CONNECT_TIMEOUT  (1000*60*60*2)     // better than infinite
 #define SDS_SUB_LOCK_TIMEOUT (10000)
 #define SDS_TRANSACTION_RETRY (60000)
+#define SDS_UPDATEFS_TIMEOUT (10000)
 
 #define DEFAULT_NUM_DFS_THREADS 30
 #define TIMEOUT_ON_CLOSEDOWN 120000 // On closedown, give up on trying to join a thread in CDaliDFSServer after two minutes
@@ -986,6 +987,7 @@ public:
         defaultudesc.setown(createUserDescriptor());
         redirection.setown(createDFSredirection());
     }
+    unsigned queryDefaultTimeout() const { return defaultTimeout; }
 
     IDistributedFile *dolookup(CDfsLogicalFileName &logicalname, IUserDescriptor *user, bool writeattr, bool hold, bool lockSuperOwner, IDistributedFileTransaction *transaction, unsigned timeout);
 
@@ -3215,7 +3217,7 @@ protected:
             root.setown(closeConnection(removeFile));
             // NB: The file is now unlocked
             if (removeFile && !logicalName.isExternal())
-                updateFS(logicalName, timeoutMs);
+                updateFS(logicalName, parent->queryDefaultTimeout());
 
             logicalName.clear();
         }
@@ -5486,7 +5488,7 @@ public:
         clearSuperOwners(timeoutMs);
         writeLock.clear();
         root.setown(closeConnection(true));
-        updateFS(logicalName, timeoutMs);
+        updateFS(logicalName, parent->queryDefaultTimeout());
         logicalName.clear();
     }
 

+ 1 - 1
ecl/hql/hqlexpr.cpp

@@ -12573,7 +12573,7 @@ extern IHqlExpression * createCompound(node_operator op, const HqlExprArray & ac
     if (op == no_compound)
         return createCompound(actions);
     else
-        return createActionList(actions);
+        return createActionList(op, actions);
 }
 
 extern IHqlExpression * createComma(IHqlExpression * expr1, IHqlExpression * expr2)

+ 13 - 2
ecl/hqlcpp/hqlcset.cpp

@@ -817,6 +817,16 @@ InlineLinkedDictionaryCursor::InlineLinkedDictionaryCursor(HqlCppTranslator & _t
 {
 }
 
+IHqlExpression * InlineLinkedDictionaryCursor::getFirstSearchValue(IHqlExpression * searchExpr, IHqlExpression * searchRecord)
+{
+    if (searchExpr->getOperator() == no_alias)
+        searchExpr = searchExpr->queryChild(0);
+
+    IHqlExpression * matched = getExtractSelect(searchExpr->queryChild(0), queryFirstField(searchRecord), false);
+    assertex(matched);
+    return matched;
+}
+
 BoundRow * InlineLinkedDictionaryCursor::buildSelectMap(BuildCtx & ctx, IHqlExpression * mapExpr)
 {
     Owned<BoundRow> tempRow = translator.declareLinkedRow(ctx, mapExpr, false);
@@ -863,7 +873,7 @@ BoundRow * InlineLinkedDictionaryCursor::buildSelectMap(BuildCtx & ctx, IHqlExpr
     if (optimizedLookupFunc.length())
     {
         args.add(*LINK(dictionary), 0);
-        args.append(*getExtractSelect(searchExpr->queryChild(0), queryFirstField(searchRecord), false));
+        args.append(*getFirstSearchValue(searchExpr, searchRecord));
         args.append(*::createRow(no_null, LINK(record))); // the default record
         lookupFunction = createIdAtom(optimizedLookupFunc);
     }
@@ -889,6 +899,7 @@ void InlineLinkedDictionaryCursor::buildInDataset(BuildCtx & ctx, IHqlExpression
     IHqlExpression *record = ds->queryRecord();
     IHqlExpression *dictionary = inExpr->queryChild(1);
     IHqlExpression *searchExpr = inExpr->queryChild(0);
+
     HqlExprArray args;
 
     OwnedHqlExpr searchRecord = getDictionarySearchRecord(record);
@@ -927,7 +938,7 @@ void InlineLinkedDictionaryCursor::buildInDataset(BuildCtx & ctx, IHqlExpression
     if (optimizedLookupFunc.length())
     {
         args.add(*LINK(dictionary), 0);
-        args.append(*getExtractSelect(searchExpr->queryChild(0), queryFirstField(searchRecord), false));
+        args.append(*getFirstSearchValue(searchExpr, searchRecord));
         lookupFunction = createIdAtom(optimizedLookupFunc);
     }
     else

+ 3 - 0
ecl/hqlcpp/hqlcset.ipp

@@ -108,6 +108,9 @@ public:
     virtual void buildIterateClass(BuildCtx & ctx, StringBuffer & cursorName, BuildCtx * initctx) { throwUnexpected(); }
     virtual void buildCountDict(BuildCtx & ctx, CHqlBoundExpr & tgt);
     virtual void buildExistsDict(BuildCtx & ctx, CHqlBoundExpr & tgt);
+
+private:
+    IHqlExpression * getFirstSearchValue(IHqlExpression * searchExpr, IHqlExpression * searchRecord);
 };
 
 class MultiLevelDatasetCursor : public BaseDatasetCursor