/ 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 Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/util.c.

   556    556   
   557    557     /* store the result */
   558    558     *pResult = result;
   559    559   
   560    560     /* return true if number and no extra non-whitespace chracters after */
   561    561     if( z==zEnd && nDigit>0 && eValid && eType>0 ){
   562    562       return eType;
   563         -  }else if( eType>=2 && (eType==3 || eValid) ){
          563  +  }else if( eType>=2 && (eType==3 || eValid) && nDigit>0 ){
   564    564       return -1;
   565    565     }else{
   566    566       return 0;
   567    567     }
   568    568   #else
   569    569     return !sqlite3Atoi64(z, pResult, length, enc);
   570    570   #endif /* SQLITE_OMIT_FLOATING_POINT */

Changes to test/cast.test.

   426    426   #
   427    427   do_execsql_test cast-7.20 {
   428    428     DROP TABLE IF EXISTS t0;
   429    429     CREATE TABLE t0 (c0 TEXT);
   430    430     INSERT INTO t0(c0) VALUES ('1.0');
   431    431     SELECT CAST(c0 AS NUMERIC) FROM t0;
   432    432   } {1}
          433  +
          434  +# 2019-06-10
          435  +# https://sqlite.org/src/info/27de823723a41df45af3
          436  +#
          437  +do_execsql_test cast-7.30 {
          438  +  SELECT -'.';
          439  +} 0
          440  +do_execsql_test cast-7.31 {
          441  +  SELECT '.'+0;
          442  +} 0
          443  +do_execsql_test cast-7.32 {
          444  +  SELECT CAST('.' AS numeric);
          445  +} 0
          446  +do_execsql_test cast-7.33 {
          447  +  SELECT -CAST('.' AS numeric);
          448  +} 0
          449  +
   433    450   
   434    451   finish_test