/ Check-in [af1e5873]
Login

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

Overview
Comment:In the xfer-optimization, do early detection of when the source and destination index share the same btree, to avoid a long delay prior to reporting the database corruption.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: af1e5873d44d31466023ae145bdfc6b4191eb48b62e5752c6e683bcf571980e7
User & Date: drh 2019-04-05 15:44:55
Context
2019-04-05
16:38
Add the ability to override the new corruption detection logic of the previous checkin, in order to exercise downstream corruption detection during testing. check-in: e859d318 user: drh tags: trunk
15:44
In the xfer-optimization, do early detection of when the source and destination index share the same btree, to avoid a long delay prior to reporting the database corruption. check-in: af1e5873 user: drh tags: trunk
2019-04-04
20:55
Add further test cases to improve VDBE branch coverage. check-in: 51a95e52 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/insert.c.

  2270   2270         destHasUniqueIdx = 1;
  2271   2271       }
  2272   2272       for(pSrcIdx=pSrc->pIndex; pSrcIdx; pSrcIdx=pSrcIdx->pNext){
  2273   2273         if( xferCompatibleIndex(pDestIdx, pSrcIdx) ) break;
  2274   2274       }
  2275   2275       if( pSrcIdx==0 ){
  2276   2276         return 0;    /* pDestIdx has no corresponding index in pSrc */
         2277  +    }
         2278  +    if( pSrcIdx->tnum==pDestIdx->tnum && pSrc->pSchema==pDest->pSchema ){
         2279  +      return 0;   /* Corrupt schema - two indexes on the same btree */
  2277   2280       }
  2278   2281     }
  2279   2282   #ifndef SQLITE_OMIT_CHECK
  2280   2283     if( pDest->pCheck && sqlite3ExprListCompare(pSrc->pCheck,pDest->pCheck,-1) ){
  2281   2284       return 0;   /* Tables have different CHECK constraints.  Ticket #2252 */
  2282   2285     }
  2283   2286   #endif