1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

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.

FossilOrigin-Name: af1e5873d44d31466023ae145bdfc6b4191eb48b62e5752c6e683bcf571980e7
This commit is contained in:
drh
2019-04-05 15:44:55 +00:00
parent d1f9932e4b
commit 86223e8d65
3 changed files with 11 additions and 8 deletions

View File

@@ -2275,6 +2275,9 @@ static int xferOptimization(
if( pSrcIdx==0 ){
return 0; /* pDestIdx has no corresponding index in pSrc */
}
if( pSrcIdx->tnum==pDestIdx->tnum && pSrc->pSchema==pDest->pSchema ){
return 0; /* Corrupt schema - two indexes on the same btree */
}
}
#ifndef SQLITE_OMIT_CHECK
if( pDest->pCheck && sqlite3ExprListCompare(pSrc->pCheck,pDest->pCheck,-1) ){