Skip to content

Commit 3c03e84

Browse files
committed
1.Revise comment on noteTemporaryFile(...) return value
2.Ensure that CSpillingSortAlgorithm functions are not affected by the changes to EclAgent::getTempfileBase(...) Signed-off-by: Dave Streeter <dave.streeter@lexisnexisrisk.com>
1 parent 80c0424 commit 3c03e84

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

ecl/eclagent/eclagent.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,8 @@ const char *EclAgent::noteTemporaryFile(const char *name)
654654
inserted = tempFileSet.emplace(tempFilename.str());
655655
}
656656

657-
// The lock is intentionally scoped to insertion; the checks below use only
658-
// the local insertion result and do not access shared state.
657+
// The returned pointer refers to the std::string stored in tempFileSet and
658+
// is only valid while that entry remains in the set.
659659

660660
if (!inserted.second)
661661
{

ecl/hthor/hthor.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4818,6 +4818,7 @@ void CHThorJoinActivity::ready()
48184818
RoxieSortAlgorithm sortAlgorithm = isStable ? stableSpillingQuickSortAlgorithm : spillingQuickSortAlgorithm;
48194819
StringBuffer tempBase;
48204820
agent.getTempfileBase(tempBase);
4821+
tempBase.setLength(tempBase.length() - 1); // remove the path separator, as the sort does not want it
48214822
if (helper.isLeftAlreadySorted())
48224823
sortedLeftInput.setown(createDegroupedInputReader(&input->queryStream()));
48234824
else
@@ -5455,6 +5456,7 @@ void CHThorSelfJoinActivity::ready()
54555456
RoxieSortAlgorithm sortAlgorithm = isStable ? stableSpillingQuickSortAlgorithm : spillingQuickSortAlgorithm;
54565457
StringBuffer tempBase;
54575458
agent.getTempfileBase(tempBase);
5459+
tempBase.setLength(tempBase.length() - 1); // remove the path separator, as the sort does not want it
54585460
groupedInput.setown(createSortedGroupedInputReader(&input->queryStream(), compareLeft, createSortAlgorithm(sortAlgorithm, compareLeft, *queryRowManager(), input->queryOutputMeta(), agent.queryCodeContext(), tempBase, activityId)));
54595461
}
54605462
leftOuterJoin = (helper.getJoinFlags() & JFleftouter) != 0;

0 commit comments

Comments
 (0)