1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Fix a problem with sqlite3changegroup_schema() and patchsets.

FossilOrigin-Name: c4ab4200dc2538e1132d87d70fd309b26b0da8a918fede1cb09b567ea40ec889
This commit is contained in:
dan
2023-10-07 17:29:10 +00:00
parent 4bdcfc6666
commit 3b381b4afc
4 changed files with 54 additions and 47 deletions

View File

@ -5684,11 +5684,11 @@ static int sessionChangesetExtendRecord(
break;
}
}
}else{
}else if( op==SQLITE_UPDATE ){
/* Append missing "undefined" entries to the old.* record. And, if this
** is an UPDATE, to the new.* record as well. */
int iOff = 0;
if( op==SQLITE_UPDATE ){
if( pGrp->bPatch==0 ){
for(ii=0; ii<nCol; ii++){
iOff += sessionSerialLen(&aRec[iOff]);
}
@ -5702,6 +5702,9 @@ static int sessionChangesetExtendRecord(
for(ii=0; ii<(pTab->nCol-nCol); ii++){
sessionAppendByte(pOut, 0x00, &rc);
}
}else{
assert( op==SQLITE_DELETE && pGrp->bPatch );
sessionAppendBlob(pOut, aRec, nRec, &rc);
}
return rc;