Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HPCC-32307 Fix inappropriate setting of dirPerPart flag in roxie cloneSubFile #19154

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading