diff options
author | drh <drh@noemail.net> | 2019-10-22 21:01:34 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2019-10-22 21:01:34 +0000 |
commit | e70fa7feba0b07eb1b5fe4f5373182875e709b32 (patch) | |
tree | 8fdb5f25be29883e784f2bf13bc2deeabdf0ca04 /src/insert.c | |
parent | 7b8ab230dce94ccbca56a204589066bca1201d28 (diff) | |
download | sqlite-e70fa7feba0b07eb1b5fe4f5373182875e709b32.tar.gz sqlite-e70fa7feba0b07eb1b5fe4f5373182875e709b32.zip |
Take the declared column time into account when computing the values for
generated columns, and apply appropriate affinity.
FossilOrigin-Name: 9e04ba22dfce3998e61331ac229ff543ecccc590284c9dd5def21efbe594fba0
Diffstat (limited to 'src/insert.c')
-rw-r--r-- | src/insert.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/insert.c b/src/insert.c index 1995f9634..be5f49c9e 100644 --- a/src/insert.c +++ b/src/insert.c @@ -240,14 +240,14 @@ void sqlite3ComputeGeneratedColumns( if( colFlags & COLFLAG_VIRTUAL ){ /* Virtual columns go at the end */ assert( pTab->nNVCol+nv == sqlite3TableColumnToStorage(pTab,i) ); - sqlite3ExprCode(pParse, pTab->aCol[i].pDflt, - iRegStore+pTab->nNVCol+nv); + sqlite3ExprCodeGeneratedColumn(pParse, &pTab->aCol[i], + iRegStore+pTab->nNVCol+nv); }else{ /* Stored columns go in column order */ assert( i-nv == sqlite3TableColumnToStorage(pTab,i) ); - sqlite3ExprCode(pParse, pTab->aCol[i].pDflt, iRegStore+i-nv); + sqlite3ExprCodeGeneratedColumn(pParse, &pTab->aCol[i], iRegStore+i-nv); } - colFlags &= ~COLFLAG_NOTAVAIL; + pTab->aCol[i].colFlags &= ~COLFLAG_NOTAVAIL; } if( (colFlags & COLFLAG_VIRTUAL)!=0 ) nv++; } |