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

Disable the xfer-optimization if the two tables have the same root page

due to schema corruption.

FossilOrigin-Name: f31b3bd2a6a8aa35a6454f37f3a4b4595e2ad74256cd180439019ab4c6c2059e
This commit is contained in:
drh
2019-01-17 20:19:35 +00:00
parent 934d4f7bac
commit 21908b2166
3 changed files with 10 additions and 9 deletions

View File

@@ -2208,7 +2208,8 @@ static int xferOptimization(
if( pSrc==0 ){
return 0; /* FROM clause does not contain a real table */
}
if( pSrc==pDest ){
if( pSrc->tnum==pDest->tnum && pSrc->pSchema==pDest->pSchema ){
testcase( pSrc!=pDest ); /* Possible due to bad sqlite_master.rootpage */
return 0; /* tab1 and tab2 may not be the same table */
}
if( HasRowid(pDest)!=HasRowid(pSrc) ){