aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-04-05 15:44:55 +0000
committerdrh <drh@noemail.net>2019-04-05 15:44:55 +0000
commit86223e8d65a6dc10ad19b5c8aa535baba86a7e5c (patch)
tree89d2cdc35648c44e6f0b5b24f112d11f2698f8b0 /src
parentd1f9932e4b26007da9fc6ef2b4a8121bcb196011 (diff)
downloadsqlite-86223e8d65a6dc10ad19b5c8aa535baba86a7e5c.tar.gz
sqlite-86223e8d65a6dc10ad19b5c8aa535baba86a7e5c.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/insert.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/insert.c b/src/insert.c
index b3535b22a..575e3a783 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -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) ){