aboutsummaryrefslogtreecommitdiff
path: root/src/insert.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-02-27 21:16:04 +0000
committerdrh <drh@noemail.net>2016-02-27 21:16:04 +0000
commit94fa9c414a4998f60d99d6a65e1d104fe62d2436 (patch)
treeaf81d1e8e385748aee483b1322179103a5bfe646 /src/insert.c
parentfc1a84c57b52c582cb87e00a1366f6a4ee232b02 (diff)
downloadsqlite-94fa9c414a4998f60d99d6a65e1d104fe62d2436.tar.gz
sqlite-94fa9c414a4998f60d99d6a65e1d104fe62d2436.zip
Eliminate the need for the Column.zDflt (using Column.pDflt instead) to reduce
the amount of memory needed to hold the schema. FossilOrigin-Name: d8c94a46dfa94930732c2de2aa79675c5087d36e
Diffstat (limited to 'src/insert.c')
-rw-r--r--src/insert.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/insert.c b/src/insert.c
index 7ff884b8c..03fdf09ac 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -1999,11 +1999,15 @@ static int xferOptimization(
return 0; /* tab2 must be NOT NULL if tab1 is */
}
/* Default values for second and subsequent columns need to match. */
- if( i>0
- && ((pDestCol->zDflt==0)!=(pSrcCol->zDflt==0)
- || (pDestCol->zDflt && strcmp(pDestCol->zDflt, pSrcCol->zDflt)!=0))
- ){
- return 0; /* Default values must be the same for all columns */
+ if( i>0 ){
+ assert( pDestCol->pDflt==0 || pDestCol->pDflt->op==TK_SPAN );
+ assert( pSrcCol->pDflt==0 || pSrcCol->pDflt->op==TK_SPAN );
+ if( (pDestCol->pDflt==0)!=(pSrcCol->pDflt==0)
+ || (pDestCol->pDflt && strcmp(pDestCol->pDflt->u.zToken,
+ pSrcCol->pDflt->u.zToken)!=0)
+ ){
+ return 0; /* Default values must be the same for all columns */
+ }
}
}
for(pDestIdx=pDest->pIndex; pDestIdx; pDestIdx=pDestIdx->pNext){