aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2024-04-09 13:57:27 +0000
committerdrh <>2024-04-09 13:57:27 +0000
commitd21d5b21db209597aeaf41d0394cf70ddd62235d (patch)
treef67fb5c8bd60fd30b8850d4dfc40b15b65513d9b /src
parent1278ac411c04d3956380f5bcc241c2d5f7d1b57c (diff)
downloadsqlite-d21d5b21db209597aeaf41d0394cf70ddd62235d.tar.gz
sqlite-d21d5b21db209597aeaf41d0394cf70ddd62235d.zip
The read-only CHECK-constraint optimization of [34ddf02d3d21151b] inhibits the
xfer optimization for tables with CHECK constraints. However, the xfer optimization is required for correct operation of VACUUM INTO on tables that contain generated columns. Fix this by ignoring CHECK constraints when qualifying the xfer optimization while running VACUUM. Problem reported by [forum:/forumpost/3ec177d68fe7fa2c|forum post 3ec177d68fe7fa2c]. FossilOrigin-Name: a6e26e778812c8409fca77183e24d3b70189c4d02fce10c7e74cd4ccc8c8ea97
Diffstat (limited to 'src')
-rw-r--r--src/insert.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/insert.c b/src/insert.c
index c126a8395..072386e65 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -3182,7 +3182,10 @@ static int xferOptimization(
}
}
#ifndef SQLITE_OMIT_CHECK
- if( pDest->pCheck && sqlite3ExprListCompare(pSrc->pCheck,pDest->pCheck,-1) ){
+ if( pDest->pCheck
+ && (db->mDbFlags & DBFLAG_Vacuum)==0
+ && sqlite3ExprListCompare(pSrc->pCheck,pDest->pCheck,-1)
+ ){
return 0; /* Tables have different CHECK constraints. Ticket #2252 */
}
#endif