Skip to content

Commit

Permalink
Merge pull request #19154 from jakesmith/HPCC-32307-roxie-1filepart-fix
Browse files Browse the repository at this point in the history
HPCC-32307 Fix inappropriate setting of dirPerPart flag in roxie cloneSubFile

Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Sep 26, 2024
2 parents 7d52012 + 08f5d32 commit 50ed84f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dali/dfu/dfuutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,10 +503,10 @@ class CFileCloner
if (iskey&&repeattlk)
spec.setRepeatedCopies(CPDMSRP_lastRepeated,false);
StringBuffer dstpartmask;
getPartMask(dstpartmask,destfilename,srcfdesc->numParts());
unsigned numParts = srcfdesc->numParts();
getPartMask(dstpartmask, destfilename, numParts);
dstfdesc->setPartMask(dstpartmask.str());
unsigned np = srcfdesc->numParts();
dstfdesc->setNumParts(srcfdesc->numParts());
dstfdesc->setNumParts(numParts);
StringBuffer dir;
StringBuffer dstdir;
getLFNDirectoryUsingBaseDir(dstdir, dstlfn.get(), spec.defaultBaseDir.get());
Expand All @@ -518,7 +518,7 @@ class CFileCloner
DBGLOG("cloneSubFile: destfilename='%s', plane='%s', dirPerPart=%s", destfilename, cluster1.get(), boolToStr(plane->queryDirPerPart()));

FileDescriptorFlags newFlags = srcfdesc->getFlags();
if (plane->queryDirPerPart())
if (plane->queryDirPerPart() && (numParts > 1))
newFlags |= FileDescriptorFlags::dirperpart;
else
newFlags &= ~FileDescriptorFlags::dirperpart;
Expand All @@ -530,7 +530,7 @@ class CFileCloner
if (iskey&&!cluster2.isEmpty())
dstfdesc->addCluster(cluster2,grp2,spec2);

for (unsigned pn=0;pn<srcfdesc->numParts();pn++) {
for (unsigned pn=0; pn<numParts; pn++) {
offset_t sz = srcfdesc->queryPart(pn)->queryProperties().getPropInt64("@size",-1);
if (sz!=(offset_t)-1)
dstfdesc->queryPart(pn)->queryProperties().setPropInt64("@size",sz);
Expand Down

0 comments on commit 50ed84f

Please sign in to comment.