/ Check-in [ebb81dad]
Login

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

Overview
Comment:Adjust requirements marks and add new requirements tests.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ebb81dad1f43dac4636cd44d4055d1d4b198c675f73e23c5a2d8d992ae27fe1f
User & Date: drh 2019-06-12 22:46:04
Context
2019-06-13
13:52
Fix a minor error in a test script, and harmless compiler warnings in the CLI code. check-in: eaa34626 user: drh tags: trunk
2019-06-12
22:46
Adjust requirements marks and add new requirements tests. check-in: ebb81dad user: drh tags: trunk
20:51
As a special case, casting '-0.0' into numeric should yield 0. Fix for ticket [674385aeba91c774]. check-in: 491f0f9b user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/insert.c.

  1421   1421         sqlite3VdbeVerifyAbortable(v, onError);
  1422   1422         sqlite3ExprIfTrue(pParse, pExpr, allOk, SQLITE_JUMPIFNULL);
  1423   1423         if( onError==OE_Ignore ){
  1424   1424           sqlite3VdbeGoto(v, ignoreDest);
  1425   1425         }else{
  1426   1426           char *zName = pCheck->a[i].zName;
  1427   1427           if( zName==0 ) zName = pTab->zName;
  1428         -        if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-15569-63625 */
         1428  +        if( onError==OE_Replace ) onError = OE_Abort; /* IMP: R-26383-51744 */
  1429   1429           sqlite3HaltConstraint(pParse, SQLITE_CONSTRAINT_CHECK,
  1430   1430                                 onError, zName, P4_TRANSIENT,
  1431   1431                                 P5_ConstraintCheck);
  1432   1432         }
  1433   1433         sqlite3VdbeResolveLabel(v, allOk);
  1434   1434       }
  1435   1435       pParse->iSelfTab = 0;

Changes to src/pcache.c.

   239    239   */
   240    240   static int numberOfCachePages(PCache *p){
   241    241     if( p->szCache>=0 ){
   242    242       /* IMPLEMENTATION-OF: R-42059-47211 If the argument N is positive then the
   243    243       ** suggested cache size is set to N. */
   244    244       return p->szCache;
   245    245     }else{
   246         -    /* IMPLEMENTATION-OF: R-61436-13639 If the argument N is negative, then
   247         -    ** the number of cache pages is adjusted to use approximately abs(N*1024)
   248         -    ** bytes of memory. */
          246  +    /* IMPLEMANTATION-OF: R-59858-46238 If the argument N is negative, then the
          247  +    ** number of cache pages is adjusted to be a number of pages that would
          248  +    ** use approximately abs(N*1024) bytes of memory based on the current
          249  +    ** page size. */
   249    250       return (int)((-1024*(i64)p->szCache)/(p->szPage+p->szExtra));
   250    251     }
   251    252   }
   252    253   
   253    254   /*************************************************** General Interfaces ******
   254    255   **
   255    256   ** Initialize and shutdown the page cache subsystem. Neither of these 

Changes to test/cast.test.

   415    415   do_execsql_test cast-7.12 {
   416    416     SELECT '' - 1;
   417    417   } {-1}
   418    418   
   419    419   # 2019-06-10
   420    420   # https://www.sqlite.org/src/info/dd6bffbfb6e61db9
   421    421   #
   422         -# EVIDENCE-OF: R-09295-61337 Casting a TEXT or BLOB value into NUMERIC
   423         -# first does a forced conversion into REAL but then further converts the
   424         -# result into INTEGER if and only if the conversion from REAL to INTEGER
   425         -# is lossless and reversible.
          422  +# EVIDENCE-OF: R-55084-10555 Casting a TEXT or BLOB value into NUMERIC
          423  +# yields either an INTEGER or a REAL result.
   426    424   #
   427    425   do_execsql_test cast-7.20 {
   428    426     DROP TABLE IF EXISTS t0;
   429    427     CREATE TABLE t0 (c0 TEXT);
   430    428     INSERT INTO t0(c0) VALUES ('1.0');
   431    429     SELECT CAST(c0 AS NUMERIC) FROM t0;
   432    430   } {1}

Changes to test/e_expr.test.

  1640   1640     CAST(-9223372036854775809.0 AS INT)
  1641   1641   } integer -9223372036854775808
  1642   1642   do_expr_test e_expr-31.2.4 { 
  1643   1643     CAST(9223372036854775809.0 AS INT)
  1644   1644   } integer 9223372036854775807
  1645   1645   
  1646   1646   
  1647         -# EVIDENCE-OF: R-09295-61337 Casting a TEXT or BLOB value into NUMERIC
  1648         -# first does a forced conversion into REAL but then further converts the
  1649         -# result into INTEGER if and only if the conversion from REAL to INTEGER
  1650         -# is lossless and reversible.
         1647  +# EVIDENCE-OF: R-55084-10555 Casting a TEXT or BLOB value into NUMERIC
         1648  +# yields either an INTEGER or a REAL result.
         1649  +#
         1650  +# EVIDENCE-OF: R-48945-04866 If the input text looks like an integer
         1651  +# (there is no decimal point nor exponent) and the value is small enough
         1652  +# to fit in a 64-bit signed integer, then the result will be INTEGER.
         1653  +#
         1654  +# EVIDENCE-OF: R-47045-23194 Input text that looks like floating point
         1655  +# (there is a decimal point and/or an exponent) and the text describes a
         1656  +# value that can be losslessly converted back and forth between IEEE 754
         1657  +# 64-bit float and a 51-bit signed integer, then the result is INTEGER.
  1651   1658   #
  1652   1659   do_expr_test e_expr-32.1.1 { CAST('45'   AS NUMERIC)  } integer 45
  1653   1660   do_expr_test e_expr-32.1.2 { CAST('45.0' AS NUMERIC)  } integer 45
  1654   1661   do_expr_test e_expr-32.1.3 { CAST('45.2' AS NUMERIC)  } real 45.2
  1655   1662   do_expr_test e_expr-32.1.4 { CAST('11abc' AS NUMERIC) } integer 11
  1656   1663   do_expr_test e_expr-32.1.5 { CAST('11.1abc' AS NUMERIC) } real 11.1
         1664  +do_expr_test e_expr-32.1.6 {CAST( '9.223372036e14' AS NUMERIC)} integer  922337203600000
         1665  +do_expr_test e_expr-32.1.7 {CAST('-9.223372036e14' AS NUMERIC)} integer -922337203600000
         1666  +do_expr_test e_expr-32.1.8 {CAST( '9.223372036e15' AS NUMERIC)} real     9223372036000000.0
         1667  +do_expr_test e_expr-32.1.9 {CAST('-9.223372036e15' AS NUMERIC)} real    -9223372036000000.0
         1668  +
         1669  +
         1670  +# EVIDENCE-OF: R-50300-26941 Any text input that describes a value
         1671  +# outside the range of a 64-bit signed integer yields a REAL result.
         1672  +#
         1673  +do_expr_test e_expr-32.1.20 { CAST('9223372036854775807' AS numeric) } \
         1674  +   integer 9223372036854775807
         1675  +do_expr_test e_expr-32.1.21 { CAST('9223372036854775808' AS numeric) } \
         1676  +   real 9.22337203685478e+18
         1677  +do_expr_test e_expr-32.1.22 { CAST('-9223372036854775808' AS numeric) } \
         1678  +   integer -9223372036854775808
         1679  +do_expr_test e_expr-32.1.23 { CAST('-9223372036854775809' AS numeric) } \
         1680  +   real -9.22337203685478e+18
  1657   1681   
  1658   1682   # EVIDENCE-OF: R-30347-18702 Casting a REAL or INTEGER value to NUMERIC
  1659   1683   # is a no-op, even if a real value could be losslessly converted to an
  1660   1684   # integer.
  1661   1685   #
  1662   1686   do_expr_test e_expr-32.2.1 { CAST(13.0 AS NUMERIC) } real 13.0
  1663   1687   do_expr_test e_expr-32.2.2 { CAST(13.5 AS NUMERIC) } real 13.5