diff options
author | drh <> | 2022-01-17 23:37:25 +0000 |
---|---|---|
committer | drh <> | 2022-01-17 23:37:25 +0000 |
commit | 1f3366cd68b935067005b5088f9306b57a09379d (patch) | |
tree | c59c5d495c4c29c8f074a5b0a6cb84364a66679d /src | |
parent | 14818366c72d612b660cf7b44da88786dd2f77bd (diff) | |
download | sqlite-1f3366cd68b935067005b5088f9306b57a09379d.tar.gz sqlite-1f3366cd68b935067005b5088f9306b57a09379d.zip |
Allow an "IntReal" value to count as a REAL when checking types for
insertion into a generated column on a STRICT table.
[forum:/forumpost/fa012c77796d9399|Forum post fa012c77796d9399].
FossilOrigin-Name: 1ec44d55da2ced1a1b0b78b489caff628652464f5709ee827e35409eb20ea794
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbe.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/vdbe.c b/src/vdbe.c index 015acfc0f..db9116e92 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -2986,6 +2986,8 @@ case OP_TypeCheck: { break; } case COLTYPE_REAL: { + testcase( (pIn1->flags & (MEM_Real|MEM_IntReal))==MEM_Real ); + testcase( (pIn1->flags & (MEM_Real|MEM_IntReal))==MEM_IntReal ); if( pIn1->flags & MEM_Int ){ /* When applying REAL affinity, if the result is still an MEM_Int ** that will fit in 6 bytes, then change the type to MEM_IntReal @@ -3003,7 +3005,7 @@ case OP_TypeCheck: { pIn1->flags |= MEM_Real; pIn1->flags &= ~MEM_Int; } - }else if( (pIn1->flags & MEM_Real)==0 ){ + }else if( (pIn1->flags & (MEM_Real|MEM_IntReal))==0 ){ goto vdbe_type_error; } break; |