mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-24 08:21:29 +03:00
Create a new affinity called FLEXNUM that works like NUMERIC except that it
never tries to convert integer to real or real to integer. The affinity is only used internally - it is not possible to create a table column with this affinity. This affinity is used on subqueries and views that are built off of a compound SELECT and where the datatype is controlled by a CAST expression. dbsqlfuzz c9ee6f9a0a8b8fefb02cf69de2a8b67ca39525c8 FossilOrigin-Name: 44135d6ea84f7ba6b36549954b38a8bc048d5ffea5a9779e35950afa4eb2dfb2
This commit is contained in:
@@ -2140,7 +2140,8 @@ static char *createTableStmt(sqlite3 *db, Table *p){
|
||||
/* SQLITE_AFF_TEXT */ " TEXT",
|
||||
/* SQLITE_AFF_NUMERIC */ " NUM",
|
||||
/* SQLITE_AFF_INTEGER */ " INT",
|
||||
/* SQLITE_AFF_REAL */ " REAL"
|
||||
/* SQLITE_AFF_REAL */ " REAL",
|
||||
/* SQLITE_AFF_FLEXNUM */ " NUM",
|
||||
};
|
||||
int len;
|
||||
const char *zType;
|
||||
@@ -2156,10 +2157,12 @@ static char *createTableStmt(sqlite3 *db, Table *p){
|
||||
testcase( pCol->affinity==SQLITE_AFF_NUMERIC );
|
||||
testcase( pCol->affinity==SQLITE_AFF_INTEGER );
|
||||
testcase( pCol->affinity==SQLITE_AFF_REAL );
|
||||
testcase( pCol->affinity==SQLITE_AFF_FLEXNUM );
|
||||
|
||||
zType = azType[pCol->affinity - SQLITE_AFF_BLOB];
|
||||
len = sqlite3Strlen30(zType);
|
||||
assert( pCol->affinity==SQLITE_AFF_BLOB
|
||||
assert( pCol->affinity==SQLITE_AFF_BLOB
|
||||
|| pCol->affinity==SQLITE_AFF_FLEXNUM
|
||||
|| pCol->affinity==sqlite3AffinityType(zType, 0) );
|
||||
memcpy(&zStmt[k], zType, len);
|
||||
k += len;
|
||||
|
||||
Reference in New Issue
Block a user