/ Check-in [07cc955e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove some unused code from sqlite3rebaser_rebase().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sessions-rebase
Files: files | file ages | folders
SHA3-256: 07cc955eab0e993a75be82d58e17ca53c8abbcaf851983d235049599c19e582f
User & Date: dan 2018-03-22 20:11:14
Context
2018-03-22
20:35
Add APIs to the sessions module for "rebasing" changesets. check-in: 509506c7 user: dan tags: trunk
20:11
Remove some unused code from sqlite3rebaser_rebase(). Closed-Leaf check-in: 07cc955e user: dan tags: sessions-rebase
19:52
Fix another problem with rebasing updates against multiple remote changes. check-in: c8e7b5a0 user: dan tags: sessions-rebase
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/session/sqlite3session.c.

  5165   5165     int rc = SQLITE_OK;
  5166   5166     u8 *aRec = 0;
  5167   5167     int nRec = 0;
  5168   5168     int bNew = 0;
  5169   5169     SessionTable *pTab = 0;
  5170   5170     SessionBuffer sOut = {0,0,0};
  5171   5171   
  5172         -    while( SQLITE_ROW==sessionChangesetNext(pIter, &aRec, &nRec, &bNew) ){
         5172  +  while( SQLITE_ROW==sessionChangesetNext(pIter, &aRec, &nRec, &bNew) ){
  5173   5173       SessionChange *pChange = 0;
  5174   5174       int bDone = 0;
  5175   5175   
  5176   5176       if( bNew ){
  5177   5177         const char *zTab = pIter->zTab;
  5178   5178         for(pTab=p->grp.pList; pTab; pTab=pTab->pNext){
  5179   5179           if( 0==sqlite3_stricmp(pTab->zName, zTab) ) break;
................................................................................
  5188   5188         /* Append a table header to the output for this new table */
  5189   5189         sessionAppendByte(&sOut, pIter->bPatchset ? 'P' : 'T', &rc);
  5190   5190         sessionAppendVarint(&sOut, pIter->nCol, &rc);
  5191   5191         sessionAppendBlob(&sOut, pIter->abPK, pIter->nCol, &rc);
  5192   5192         sessionAppendBlob(&sOut, (u8*)pIter->zTab, strlen(pIter->zTab)+1, &rc);
  5193   5193       }
  5194   5194   
  5195         -    if( pTab ){
  5196         -      int bPkOnly = (pIter->bPatchset && pIter->op==SQLITE_DELETE);
  5197         -      int iHash = sessionChangeHash(pTab, bPkOnly, aRec, pTab->nChange);
         5195  +    if( pTab && rc==SQLITE_OK ){
         5196  +      int iHash = sessionChangeHash(pTab, 0, aRec, pTab->nChange);
  5198   5197   
  5199   5198         for(pChange=pTab->apChange[iHash]; pChange; pChange=pChange->pNext){
  5200         -        if( sessionChangeEqual(pTab, bPkOnly, aRec, 0, pChange->aRecord) ){
         5199  +        if( sessionChangeEqual(pTab, 0, aRec, 0, pChange->aRecord) ){
  5201   5200             break;
  5202   5201           }
  5203   5202         }
  5204   5203       }
  5205   5204   
  5206   5205       if( pChange ){
  5207   5206         assert( pChange->op==SQLITE_DELETE || pChange->op==SQLITE_INSERT );