diff options
author | drh <drh@noemail.net> | 2019-01-17 20:19:35 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-01-17 20:19:35 +0000 |
commit | 21908b2166875fcaf92b194c00719d9031da5fa6 (patch) | |
tree | d07354e37baa7b49cbd23d83badd2de68cb556f1 /src/insert.c | |
parent | 934d4f7bac2b43c7888dab130bdcf45ee302c535 (diff) | |
download | sqlite-21908b2166875fcaf92b194c00719d9031da5fa6.tar.gz sqlite-21908b2166875fcaf92b194c00719d9031da5fa6.zip |
Disable the xfer-optimization if the two tables have the same root page
due to schema corruption.
FossilOrigin-Name: f31b3bd2a6a8aa35a6454f37f3a4b4595e2ad74256cd180439019ab4c6c2059e
Diffstat (limited to 'src/insert.c')
-rw-r--r-- | src/insert.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/insert.c b/src/insert.c index 7301d87a1..a69e625a1 100644 --- a/src/insert.c +++ b/src/insert.c @@ -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) ){ |