SQLite

Check-in [57050162]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:A string consisting of a single '.' is not a floating point literal with extra text at the end. Fix for ticket [412bba9b22c677da]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 57050162294efec90caa5cc3c2f8c1a85215526adcf57b284ce2d2e799286b78
User & Date: drh 2019-06-10 23:45:10
Context
2019-06-11
01:30
Remove a comment made obsolete by check-in [71643deb6bbad4b4]. No changes to code. (check-in: 211c8002 user: drh tags: trunk)
2019-06-10
23:45
A string consisting of a single '.' is not a floating point literal with extra text at the end. Fix for ticket [412bba9b22c677da] (check-in: 57050162 user: drh tags: trunk)
19:17
Have ALTER TABLE commands ignore the lhs of "expr IN ()" and "expr NOT IN ()" expressions, just as other queries do. Fix for [533010b8ca]. (check-in: 71643deb user: dan tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/util.c.

556
557
558
559
560
561
562
563
564
565
566
567
568
569
570

  /* store the result */
  *pResult = result;

  /* return true if number and no extra non-whitespace chracters after */
  if( z==zEnd && nDigit>0 && eValid && eType>0 ){
    return eType;
  }else if( eType>=2 && (eType==3 || eValid) ){
    return -1;
  }else{
    return 0;
  }
#else
  return !sqlite3Atoi64(z, pResult, length, enc);
#endif /* SQLITE_OMIT_FLOATING_POINT */







|







556
557
558
559
560
561
562
563
564
565
566
567
568
569
570

  /* store the result */
  *pResult = result;

  /* return true if number and no extra non-whitespace chracters after */
  if( z==zEnd && nDigit>0 && eValid && eType>0 ){
    return eType;
  }else if( eType>=2 && (eType==3 || eValid) && nDigit>0 ){
    return -1;
  }else{
    return 0;
  }
#else
  return !sqlite3Atoi64(z, pResult, length, enc);
#endif /* SQLITE_OMIT_FLOATING_POINT */

Changes to test/cast.test.

426
427
428
429
430
431
432

















433
434
#
do_execsql_test cast-7.20 {
  DROP TABLE IF EXISTS t0;
  CREATE TABLE t0 (c0 TEXT);
  INSERT INTO t0(c0) VALUES ('1.0');
  SELECT CAST(c0 AS NUMERIC) FROM t0;
} {1}


















finish_test







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
#
do_execsql_test cast-7.20 {
  DROP TABLE IF EXISTS t0;
  CREATE TABLE t0 (c0 TEXT);
  INSERT INTO t0(c0) VALUES ('1.0');
  SELECT CAST(c0 AS NUMERIC) FROM t0;
} {1}

# 2019-06-10
# https://sqlite.org/src/info/27de823723a41df45af3
#
do_execsql_test cast-7.30 {
  SELECT -'.';
} 0
do_execsql_test cast-7.31 {
  SELECT '.'+0;
} 0
do_execsql_test cast-7.32 {
  SELECT CAST('.' AS numeric);
} 0
do_execsql_test cast-7.33 {
  SELECT -CAST('.' AS numeric);
} 0


finish_test