mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Change to [44135d6ea84f7ba6] that retains the historical datatype ("INT", not "NUM") for a table created as follows: "CREATE TABLE t1 AS SELECT CAST(123 AS INT) AS value;". The use of FLEXNUM only occurs on compound queries.
FossilOrigin-Name: 6d5b5896261c62a7e130b47416ee8c25793859a2afcb1646c257600537a5b71b
This commit is contained in:
@@ -2332,8 +2332,6 @@ void sqlite3SubqueryColumnTypes(
|
||||
pCol->affinity = sqlite3ExprAffinity(p);
|
||||
if( pCol->affinity<=SQLITE_AFF_NONE ){
|
||||
pCol->affinity = aff;
|
||||
}else if( pCol->affinity>=SQLITE_AFF_NUMERIC && p->op==TK_CAST ){
|
||||
pCol->affinity = SQLITE_AFF_FLEXNUM;
|
||||
}
|
||||
if( pCol->affinity>=SQLITE_AFF_TEXT && pSelect->pNext ){
|
||||
int m = 0;
|
||||
@@ -2347,6 +2345,9 @@ void sqlite3SubqueryColumnTypes(
|
||||
if( pCol->affinity>=SQLITE_AFF_NUMERIC && (m&0x02)!=0 ){
|
||||
pCol->affinity = SQLITE_AFF_BLOB;
|
||||
}
|
||||
if( pCol->affinity>=SQLITE_AFF_NUMERIC && p->op==TK_CAST ){
|
||||
pCol->affinity = SQLITE_AFF_FLEXNUM;
|
||||
}
|
||||
}
|
||||
zType = columnType(&sNC, p, 0, 0, 0);
|
||||
if( zType==0 || pCol->affinity!=sqlite3AffinityType(zType, 0) ){
|
||||
|
||||
Reference in New Issue
Block a user