NUMERIC conversions

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

NUMERIC conversions

Cezary H. Noweta

Could you change/fix a bit strange behaviour mentioned in
Fixing it for every released version of SQLite is a bit tormenting:

1. SELECT CAST('9000000000000000001' AS NUMERIC);
2. SELECT CAST('9000000000000000001 ' AS NUMERIC);

(The second text has a trailing space)

Ad. 1. A reasonable behaviour, however inconsistent with the doc
(lang_expr.html), which states that ``Casting a TEXT or BLOB value into
NUMERIC first does a forced conversion into REAL but then further
converts the result into INTEGER''. If it was converted to REAL it would
lose the final ``1''.

Ad. 2. There is no need to waste the final ``1'', which produces an
inconsistency with pt. 1. For the sake of sanity it should not be kept,
though it is consistent with the doc (IMHO the doc/specification should
be changed).

-- best regards

Cezary H. Noweta
sqlite-users mailing list
[hidden email]