diff options
author | drh <> | 2022-04-15 15:47:14 +0000 |
---|---|---|
committer | drh <> | 2022-04-15 15:47:14 +0000 |
commit | a99e325468d0c46919cf8a88f7c0b5bb8a4987a8 (patch) | |
tree | 3d929a2ac23c4e6acd1a1aadd57ed06c39939f28 /src/insert.c | |
parent | 358424aeff71bc8b38053b822091f4c6532ec5b1 (diff) | |
download | sqlite-a99e325468d0c46919cf8a88f7c0b5bb8a4987a8.tar.gz sqlite-a99e325468d0c46919cf8a88f7c0b5bb8a4987a8.zip |
Enhance the IdList object to exist in a single memory allocation (rather than
a separate allocate for the base object and the array of IDs). Also permit
an IdList object to store an Expr pointer together with each name.
FossilOrigin-Name: 40f3c95871e6f40f287ef2756abafb8fc56dffdd0af69436e5c7d8e95022d94e
Diffstat (limited to 'src/insert.c')
-rw-r--r-- | src/insert.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/insert.c b/src/insert.c index 2593f353b..9b97b99a3 100644 --- a/src/insert.c +++ b/src/insert.c @@ -851,13 +851,15 @@ void sqlite3Insert( */ bIdListInOrder = (pTab->tabFlags & (TF_OOOHidden|TF_HasStored))==0; if( pColumn ){ + assert( pColumn->eU4!=EU4_EXPR ); + pColumn->eU4 = EU4_IDX; for(i=0; i<pColumn->nId; i++){ - pColumn->a[i].idx = -1; + pColumn->a[i].u4.idx = -1; } for(i=0; i<pColumn->nId; i++){ for(j=0; j<pTab->nCol; j++){ if( sqlite3StrICmp(pColumn->a[i].zName, pTab->aCol[j].zCnName)==0 ){ - pColumn->a[i].idx = j; + pColumn->a[i].u4.idx = j; if( i!=j ) bIdListInOrder = 0; if( j==pTab->iPKey ){ ipkColumn = i; assert( !withoutRowid ); @@ -1159,7 +1161,8 @@ void sqlite3Insert( } } if( pColumn ){ - for(j=0; j<pColumn->nId && pColumn->a[j].idx!=i; j++){} + assert( pColumn->eU4==EU4_IDX ); + for(j=0; j<pColumn->nId && pColumn->a[j].u4.idx!=i; j++){} if( j>=pColumn->nId ){ /* A column not named in the insert column list gets its ** default value */ |