Ticket #1662 (http://www.sqlite.org/cvstrac/tktview?tn=1662)
complains that SQLite is not converting strings into numbers
if the string contains leading spaces.  This happens because
SQLite just hands the string to strtod() and strtod() does not
recognize numbers with leading spaces.  (Actually, strtod is
not used - our own internal implementation gets called, but
it works about the same.)

So the question is:  should this be changed.  Should SQLite
ignore leading space in strings when trying to determine if
the string looks like a number.

This has far-reaching implications.  Right now if you say:

    CREATE TABLE t1(a REAL);
    INSERT INTO t1 VALUES('    12.34');

The t1.a column will be filled with a string because the
leading spaces on the string make it not look like a number,
as far as SQLite is concerned.  If you had said:

    INSERT INTO t1 VALUES('23.45');

Then the string does look like a number and gets converted.

If the change requested by ticket #1662 is implemented then
both INSERTs above would convert their arguments to numbers.
As it currently stands, only the second INSERT converts its
argument.

Which is the correct behavior?  Is this important enough to
change (and possible cause problems in legacy code)?

--
D. Richard Hipp   <[EMAIL PROTECTED]>

Reply via email to