/ Check-in [7893e525]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Modify testable statement ids in a few test files to account for recent docsrc changes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7893e525953da6c97eaea23fe94d26e1e635edea
User & Date: dan 2010-09-24 08:00:11
Context
2010-09-24
18:08
Merge experimental branch back into trunk. check-in: 83ecec5d user: dan tags: trunk
09:32
Add experimental branch disallowing VACUUM when there are one or more active SQL statements. check-in: c1ebcacd user: dan tags: experimental
08:00
Modify testable statement ids in a few test files to account for recent docsrc changes. check-in: 7893e525 user: dan tags: trunk
2010-09-23
18:47
Add tests to e_delete.test. check-in: fab3b383 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/e_delete.test.

    62     62     }
    63     63   } {}
    64     64   do_delete_tests e_delete-1.1 {
    65     65     1  "DELETE FROM t1       ; SELECT * FROM t1"       {}
    66     66     2  "DELETE FROM main.t2  ; SELECT * FROM t2"       {}
    67     67   }
    68     68   
    69         -# EVIDENCE-OF: R-25092-63878 If a WHERE clause is supplied, then only
    70         -# those rows for which evaluating the WHERE clause and casting the
    71         -# result to a NUMERIC value produces a result other than NULL or zero
    72         -# (integer value 0 or real value 0.0).
           69  +# EVIDENCE-OF: R-30203-16177 If a WHERE clause is supplied, then only
           70  +# those rows for which the result of evaluating the WHERE clause as a
           71  +# boolean expression is true are deleted.
    73     72   #
    74     73   do_delete_tests e_delete-1.2 {
    75     74     1  "DELETE FROM t3 WHERE 1       ; SELECT x FROM t3"       {}
    76     75     2  "DELETE FROM main.t4 WHERE 0  ; SELECT x FROM t4"       {1 2 3 4 5}
    77     76     3  "DELETE FROM t4 WHERE 0.0     ; SELECT x FROM t4"       {1 2 3 4 5}
    78     77     4  "DELETE FROM t4 WHERE NULL    ; SELECT x FROM t4"       {1 2 3 4 5}
    79     78     5  "DELETE FROM t4 WHERE y!='two'; SELECT x FROM t4"       {2}

Changes to test/e_select.test.

   503    503       1 { SELECT * FROM t1 CROSS JOIN t2 }           $t1_cross_t2        \
   504    504       2 { SELECT * FROM t1 AS y CROSS JOIN t1 AS x } $t1_cross_t1        \
   505    505       3 { SELECT * FROM t1 INNER JOIN t2 }           $t1_cross_t2        \
   506    506       4 { SELECT * FROM t1 AS y INNER JOIN t1 AS x } $t1_cross_t1        \
   507    507   ]
   508    508   
   509    509   
   510         -# EVIDENCE-OF: R-45641-53865 If there is an ON clause specified, then
          510  +# EVIDENCE-OF: R-22775-56496 If there is an ON clause specified, then
   511    511   # the ON expression is evaluated for each row of the cartesian product
   512         -# and the result cast to a numeric value as if by a CAST expression. All
   513         -# rows for which the expression evaluates to NULL or zero (integer value
   514         -# 0 or real value 0.0) are excluded from the dataset.
          512  +# as a boolean expression. All rows for which the expression evaluates
          513  +# to false are excluded from the dataset.
   515    514   #
   516    515   foreach {tn select res} [list                                              \
   517    516       1 { SELECT * FROM t1 %JOIN% t2 ON (1) }       $t1_cross_t2             \
   518    517       2 { SELECT * FROM t1 %JOIN% t2 ON (0) }       [list]                   \
   519    518       3 { SELECT * FROM t1 %JOIN% t2 ON (NULL) }    [list]                   \
   520    519       4 { SELECT * FROM t1 %JOIN% t2 ON ('abc') }   [list]                   \
   521    520       5 { SELECT * FROM t1 %JOIN% t2 ON ('1ab') }   $t1_cross_t2             \
................................................................................
   542    541     cannot join using column %s - column not present in both tables
   543    542   } {
   544    543     1 { SELECT * FROM t1, t3 USING (b) }   "b"
   545    544     2 { SELECT * FROM t3, t1 USING (c) }   "c"
   546    545     3 { SELECT * FROM t3, (SELECT a AS b, b AS c FROM t1) USING (a) }   "a"
   547    546   } 
   548    547   
   549         -# EVIDENCE-OF: R-42568-37000 For each pair of namesake columns, the
          548  +# EVIDENCE-OF: R-55987-04584 For each pair of namesake columns, the
   550    549   # expression "lhs.X = rhs.X" is evaluated for each row of the cartesian
   551         -# product and the result cast to a numeric value. All rows for which one
   552         -# or more of the expressions evaluates to NULL or zero are excluded from
   553         -# the result set.
          550  +# product as a boolean expression. All rows for which one or more of the
          551  +# expressions evaluates to false are excluded from the result set.
   554    552   #
   555    553   do_select_tests e_select-1.5 {
   556    554     1 { SELECT * FROM t1, t3 USING (a)   }  {a one 1 b two 2}
   557    555     2 { SELECT * FROM t3, t4 USING (a,c) }  {b 2}
   558    556   } 
   559    557   
   560    558   # EVIDENCE-OF: R-54046-48600 When comparing values as a result of a
................................................................................
  1056   1054     test_join $tn.1.7  "t2 CROSS JOIN t3"      {t2 t3}
  1057   1055     test_join $tn.1.8  "t2 JOIN t3"            {t2 t3}
  1058   1056     test_join $tn.1.9  "t2, t2 AS x"           {t2 t2}
  1059   1057     test_join $tn.1.10 "t2 INNER JOIN t2 AS x" {t2 t2}
  1060   1058     test_join $tn.1.11 "t2 CROSS JOIN t2 AS x" {t2 t2}
  1061   1059     test_join $tn.1.12 "t2 JOIN t2 AS x"       {t2 t2}
  1062   1060   
  1063         -  # EVIDENCE-OF: R-45641-53865 If there is an ON clause specified, then
         1061  +  # EVIDENCE-OF: R-22775-56496 If there is an ON clause specified, then
  1064   1062     # the ON expression is evaluated for each row of the cartesian product
  1065         -  # and the result cast to a numeric value as if by a CAST expression. All
  1066         -  # rows for which the expression evaluates to NULL or zero (integer value
  1067         -  # 0 or real value 0.0) are excluded from the dataset.
         1063  +  # as a boolean expression. All rows for which the expression evaluates
         1064  +  # to false are excluded from the dataset.
  1068   1065     #
  1069   1066     test_join $tn.2.1  "t1, t2 ON (t1.a=t2.a)"  {t1 t2 -on {te_equals a a}}
  1070   1067     test_join $tn.2.2  "t2, t1 ON (t1.a=t2.a)"  {t2 t1 -on {te_equals a a}}
  1071   1068     test_join $tn.2.3  "t2, t1 ON (1)"          {t2 t1 -on te_true}
  1072   1069     test_join $tn.2.4  "t2, t1 ON (NULL)"       {t2 t1 -on te_false}
  1073   1070     test_join $tn.2.5  "t2, t1 ON (1.1-1.1)"    {t2 t1 -on te_false}
  1074   1071     test_join $tn.2.6  "t1, t2 ON (1.1-1.0)"    {t1 t2 -on te_true}
................................................................................
  1287   1284     CREATE TABLE x2(k, x, y2);
  1288   1285     INSERT INTO x2 VALUES(1, 50, X'B82838');
  1289   1286     INSERT INTO x2 VALUES(5, 84.79, 65.88);
  1290   1287     INSERT INTO x2 VALUES(3, -22, X'0E1BE452A393');
  1291   1288     INSERT INTO x2 VALUES(7, 'mistrusted', 'standardized');
  1292   1289   } {}
  1293   1290   
  1294         -# EVIDENCE-OF: R-22873-49686 If a WHERE clause is specified, the WHERE
  1295         -# expression is evaluated for each row in the input data and the result
  1296         -# cast to a numeric value. All rows for which the WHERE clause
  1297         -# expression evaluates to a NULL value or to zero (integer value 0 or
  1298         -# real value 0.0) are excluded from the dataset before continuing.
         1291  +# EVIDENCE-OF: R-06999-14330 If a WHERE clause is specified, the WHERE
         1292  +# expression is evaluated for each row in the input data as a boolean
         1293  +# expression. All rows for which the WHERE clause expression evaluates
         1294  +# to false are excluded from the dataset before continuing.
  1299   1295   #
  1300   1296   do_execsql_test e_select-3.1.1 { SELECT k FROM x1 WHERE x }         {3}
  1301   1297   do_execsql_test e_select-3.1.2 { SELECT k FROM x1 WHERE y }         {3 5 6}
  1302   1298   do_execsql_test e_select-3.1.3 { SELECT k FROM x1 WHERE z }         {1 2 6}
  1303   1299   do_execsql_test e_select-3.1.4 { SELECT k FROM x1 WHERE '1'||z    } {1 2 4 6}
  1304   1300   do_execsql_test e_select-3.1.5 { SELECT k FROM x1 WHERE x IS NULL } {4 5}
  1305   1301   do_execsql_test e_select-3.1.6 { SELECT k FROM x1 WHERE z - 78.43 } {2 4 6}
................................................................................
  1623   1619     12.2  "SELECT max(a) FROM b3 GROUP BY max(b)"
  1624   1620     12.3  "SELECT group_concat(a) FROM b3 GROUP BY a, max(b)"
  1625   1621   } {
  1626   1622     set res {1 {aggregate functions are not allowed in the GROUP BY clause}}
  1627   1623     do_catchsql_test e_select-4.$tn $select $res
  1628   1624   }
  1629   1625   
  1630         -# EVIDENCE-OF: R-40359-04817 If a HAVING clause is specified, it is
  1631         -# evaluated once for each group of rows and cast to an integer value. If
  1632         -# the result of evaluating the HAVING clause is NULL or zero (integer
  1633         -# value 0), the group is discarded.
         1626  +# EVIDENCE-OF: R-31537-00101 If a HAVING clause is specified, it is
         1627  +# evaluated once for each group of rows as a boolean expression. If the
         1628  +# result of evaluating the HAVING clause is false, the group is
         1629  +# discarded.
  1634   1630   #
  1635   1631   #   This requirement is tested by all e_select-4.13.* tests.
  1636   1632   #
  1637   1633   # EVIDENCE-OF: R-04132-09474 If the HAVING clause is an aggregate
  1638   1634   # expression, it is evaluated across all rows in the group.
  1639   1635   #
  1640   1636   #   Tested by e_select-4.13.1.*

Changes to test/e_update.test.

   142    142     1  "UPDATE t1 SET b = 'roman' ; SELECT * FROM t1"
   143    143        {1 roman  2 roman  3 roman}
   144    144   
   145    145     2  "UPDATE t1 SET a = 'greek' ; SELECT * FROM t1"
   146    146        {greek roman  greek roman  greek roman}
   147    147   }
   148    148   
   149         -# EVIDENCE-OF: R-41754-00978 Otherwise, the UPDATE affects only those
   150         -# rows for which evaluating the WHERE clause expression and casting the
   151         -# result to a NUMERIC value produces a value other than NULL or zero
   152         -# (integer value 0 or real value 0.0).
          149  +# EVIDENCE-OF: R-42117-40023 Otherwise, the UPDATE affects only those
          150  +# rows for which the result of evaluating the WHERE clause expression as
          151  +# a boolean expression is true.
   153    152   #
   154    153   do_execsql_test e_update-1.3.0 {
   155    154     DELETE FROM main.t1;
   156    155     INSERT INTO main.t1 VALUES(NULL, '');
   157    156     INSERT INTO main.t1 VALUES(1, 'i');
   158    157     INSERT INTO main.t1 VALUES(2, 'ii');
   159    158     INSERT INTO main.t1 VALUES(3, 'iii');
................................................................................
   168    167     3  "UPDATE t1 SET b = 'macedonian' WHERE a; SELECT * FROM t1"
   169    168        {{} {}  1 macedonian  2 macedonian  3 macedonian}
   170    169   
   171    170     4  "UPDATE t1 SET b = 'lithuanian' WHERE a IS NULL; SELECT * FROM t1"
   172    171        {{} lithuanian  1 macedonian  2 macedonian  3 macedonian}
   173    172   }
   174    173   
   175         -# EVIDENCE-OF: R-61178-36001 It is not an error if the WHERE clause does
   176         -# not evaluate to a non-NULL, non-zero value for any row in the table -
   177         -# this just means that the UPDATE statement affects zero rows.
          174  +# EVIDENCE-OF: R-58129-20729 It is not an error if the WHERE clause does
          175  +# not evaluate to true for any row in the table - this just means that
          176  +# the UPDATE statement affects zero rows.
   178    177   #
   179    178   do_execsql_test e_update-1.4.0 {
   180    179     DELETE FROM main.t1;
   181    180     INSERT INTO main.t1 VALUES(NULL, '');
   182    181     INSERT INTO main.t1 VALUES(1, 'i');
   183    182     INSERT INTO main.t1 VALUES(2, 'ii');
   184    183     INSERT INTO main.t1 VALUES(3, 'iii');