diff options
author | drh <> | 2025-06-18 19:04:28 +0000 |
---|---|---|
committer | drh <> | 2025-06-18 19:04:28 +0000 |
commit | ab9c91ae82d2e4f062dde175727bfd3e23a5e99c (patch) | |
tree | f9685f32f22de61f38b6271de5a1cd52778f5237 /src/expr.c | |
parent | bcf25e7129a84a8c15d30157596eed5a64bfa0db (diff) | |
download | sqlite-ab9c91ae82d2e4f062dde175727bfd3e23a5e99c.tar.gz sqlite-ab9c91ae82d2e4f062dde175727bfd3e23a5e99c.zip |
Extend the pedantic enforcement of type to VIRTUAL columns.
FossilOrigin-Name: b734c74e55acb26eb61b60937bef870f4b55b2e2e7560a22362f5f31ba2fcd03
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/expr.c b/src/expr.c index 606a4cd7e..6730128fb 100644 --- a/src/expr.c +++ b/src/expr.c @@ -4269,7 +4269,12 @@ void sqlite3ExprCodeGeneratedColumn( iAddr = 0; } sqlite3ExprCodeCopy(pParse, sqlite3ColumnExpr(pTab,pCol), regOut); - if( pCol->affinity>=SQLITE_AFF_TEXT ){ + if( (pCol->colFlags & COLFLAG_VIRTUAL)!=0 + && (pTab->tabFlags & TF_Strict)!=0 + ){ + int p3 = 2+(int)(pCol - pTab->aCol); + sqlite3VdbeAddOp4(v, OP_TypeCheck, regOut, 1, p3, (char*)pTab, P4_TABLE); + }else if( pCol->affinity>=SQLITE_AFF_TEXT ){ sqlite3VdbeAddOp4(v, OP_Affinity, regOut, 1, 0, &pCol->affinity, 1); } if( iAddr ) sqlite3VdbeJumpHere(v, iAddr); |