1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Take the declared column time into account when computing the values for

generated columns, and apply appropriate affinity.

FossilOrigin-Name: 9e04ba22dfce3998e61331ac229ff543ecccc590284c9dd5def21efbe594fba0
This commit is contained in:
drh
2019-10-22 21:01:34 +00:00
parent 7b8ab230dc
commit e70fa7feba
5 changed files with 36 additions and 15 deletions

View File

@@ -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++;
}