diff options
author | drh <> | 2024-02-26 22:28:21 +0000 |
---|---|---|
committer | drh <> | 2024-02-26 22:28:21 +0000 |
commit | f79b0bdcbfb46164cfd665d256f2862bf3f42a7c (patch) | |
tree | 2879e03bf4e0a898bc7409dbce327876c2280caa /src | |
parent | 7c6433cfff58499a7ee2c9b103590359e0cf5226 (diff) | |
download | sqlite-f79b0bdcbfb46164cfd665d256f2862bf3f42a7c.tar.gz sqlite-f79b0bdcbfb46164cfd665d256f2862bf3f42a7c.zip |
The quote() SQL function should convert +Inf into 9.0e+999 and -Inf into
-9.0e+999. See [forum:/forumpost/6675b25108|forum post 6675b25108].
FossilOrigin-Name: 85dd79a6edecfc8c6307c6d215998f76dab086aa14528ddc64eb9955501becfd
Diffstat (limited to 'src')
-rw-r--r-- | src/func.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/func.c b/src/func.c index 249c17857..9fbd1e9e1 100644 --- a/src/func.c +++ b/src/func.c @@ -1101,13 +1101,13 @@ void sqlite3QuoteValue(StrAccum *pStr, sqlite3_value *pValue){ double r1, r2; const char *zVal; r1 = sqlite3_value_double(pValue); - sqlite3_str_appendf(pStr, "%!.15g", r1); + sqlite3_str_appendf(pStr, "%!0.15g", r1); zVal = sqlite3_str_value(pStr); if( zVal ){ sqlite3AtoF(zVal, &r2, pStr->nChar, SQLITE_UTF8); if( r1!=r2 ){ sqlite3_str_reset(pStr); - sqlite3_str_appendf(pStr, "%!.20e", r1); + sqlite3_str_appendf(pStr, "%!0.20e", r1); } } break; |