/ Check-in [f5ac98ef]
Login

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

Overview
Comment:Update requirement marks to reflect changes in wording in the documentation. No changes to code.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:f5ac98efb5d5f7751c5c560bed9c7885e60ac4bc
User & Date: drh 2016-11-22 19:15:05
Context
2016-11-22
20:29
Add a new requirement mark for CAST expressions. check-in: bee2859b user: drh tags: trunk
19:15
Update requirement marks to reflect changes in wording in the documentation. No changes to code. check-in: f5ac98ef user: drh tags: trunk
01:26
Remove unnecessary OP_Close opcodes for a size reduction and performance increase. check-in: 32be7aae user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/e_expr.test.

  1782   1782       CREATE TABLE t2(a, b);
  1783   1783       INSERT INTO t2 VALUES('one', 'two');
  1784   1784       INSERT INTO t2 VALUES('three', NULL);
  1785   1785       INSERT INTO t2 VALUES(4, 5.0);
  1786   1786     }
  1787   1787   } {}
  1788   1788   
  1789         -# EVIDENCE-OF: R-00980-39256 A SELECT statement enclosed in parentheses
  1790         -# may appear as a scalar quantity.
         1789  +# EVIDENCE-OF: R-43573-23448 A SELECT statement enclosed in parentheses
         1790  +# is a subquery.
  1791   1791   #
  1792   1792   # EVIDENCE-OF: R-56294-03966 All types of SELECT statement, including
  1793   1793   # aggregate and compound SELECT queries (queries with keywords like
  1794   1794   # UNION or EXCEPT) are allowed as scalar subqueries.
  1795   1795   #
  1796   1796   do_expr_test e_expr-35.1.1 { (SELECT 35)   } integer 35
  1797   1797   do_expr_test e_expr-35.1.2 { (SELECT NULL) } null {}
................................................................................
  1802   1802   do_expr_test e_expr-35.1.5 { 
  1803   1803     (SELECT b FROM t2 UNION SELECT a+1 FROM t2)
  1804   1804   } null {}
  1805   1805   do_expr_test e_expr-35.1.6 { 
  1806   1806     (SELECT a FROM t2 UNION SELECT COALESCE(b, 55) FROM t2 ORDER BY 1)
  1807   1807   } integer 4
  1808   1808   
  1809         -# EVIDENCE-OF: R-46899-53765 A SELECT used as a scalar quantity must
  1810         -# return a result set with a single column.
         1809  +# EVIDENCE-OF: R-22239-33740 A subquery that returns two or more columns
         1810  +# is a row value subquery and can only be used as the operand of a
         1811  +# comparison operator.
  1811   1812   #
  1812   1813   # The following block tests that errors are returned in a bunch of cases
  1813   1814   # where a subquery returns more than one column.
  1814   1815   #
  1815   1816   set M {/1 {sub-select returns [23] columns - expected 1}/}
  1816   1817   foreach {tn sql} {
  1817   1818     1     { SELECT (SELECT * FROM t2 UNION SELECT a+1, b+1 FROM t2) }
................................................................................
  1820   1821     4     { SELECT (SELECT NULL, NULL, NULL) }
  1821   1822     5     { SELECT (SELECT * FROM t2) }
  1822   1823     6     { SELECT (SELECT * FROM (SELECT 1, 2, 3)) }
  1823   1824   } {
  1824   1825     do_catchsql_test e_expr-35.2.$tn $sql $M
  1825   1826   }
  1826   1827   
  1827         -# EVIDENCE-OF: R-35764-28041 The result of the expression is the value
  1828         -# of the only column in the first row returned by the SELECT statement.
         1828  +# EVIDENCE-OF: R-18318-14995 The value of a subquery expression is the
         1829  +# first row of the result from the enclosed SELECT statement.
  1829   1830   #
  1830         -# EVIDENCE-OF: R-41898-06686 If the SELECT yields more than one result
  1831         -# row, all rows after the first are ignored.
         1831  +# EVIDENCE-OF: R-15900-52156 In other words, an implied "LIMIT 1" is
         1832  +# added to the subquery, overriding an explicitly coded LIMIT.
  1832   1833   #
  1833   1834   do_execsql_test e_expr-36.3.1 {
  1834   1835     CREATE TABLE t4(x, y);
  1835   1836     INSERT INTO t4 VALUES(1, 'one');
  1836   1837     INSERT INTO t4 VALUES(2, 'two');
  1837   1838     INSERT INTO t4 VALUES(3, 'three');
  1838   1839   } {}
................................................................................
  1848   1849       8  { ( SELECT group_concat(y,'') FROM t4 ) }       text    onetwothree
  1849   1850       9  { ( SELECT max(x) FROM t4 WHERE y LIKE '___') } integer 2 
  1850   1851   
  1851   1852   } {
  1852   1853     do_expr_test e_expr-36.3.$tn $expr $restype $resval
  1853   1854   }
  1854   1855   
  1855         -# EVIDENCE-OF: R-25492-41572 If the SELECT yields no rows, then the
  1856         -# value of the expression is NULL.
         1856  +# EVIDENCE-OF: R-52325-25449 The value of a subquery expression is NULL
         1857  +# if the enclosed SELECT statement returns no rows.
  1857   1858   #
  1858   1859   foreach {tn expr} {
  1859   1860       1  { ( SELECT x FROM t4 WHERE x>3 ORDER BY x )      }
  1860   1861       2  { ( SELECT x FROM t4 WHERE y<'one' ORDER BY y )  }
  1861   1862   } {
  1862   1863     do_expr_test e_expr-36.4.$tn $expr null {}
  1863   1864   }

Changes to test/e_select.test.

  1248   1248   # EVIDENCE-OF: R-02054-15343 For the purposes of detecting duplicate
  1249   1249   # rows, two NULL values are considered to be equal.
  1250   1250   #
  1251   1251   do_select_tests e_select-5.5 {
  1252   1252     1  "SELECT DISTINCT d FROM h3" {{} 2 2,3 2,4 3}
  1253   1253   }
  1254   1254   
  1255         -# EVIDENCE-OF: R-58359-52112 The normal rules for selecting a collation
  1256         -# sequence to compare text values with apply.
         1255  +# EVIDENCE-OF: R-47709-27231 The usual rules apply for selecting a
         1256  +# collation sequence to compare text values.
  1257   1257   #
  1258   1258   do_select_tests e_select-5.6 {
  1259   1259     1  "SELECT DISTINCT b FROM h1"                  {one I i four IV iv}
  1260   1260     2  "SELECT DISTINCT b COLLATE nocase FROM h1"   {one I four IV}
  1261   1261     3  "SELECT DISTINCT x FROM h2"                  {One Two Three Four}
  1262   1262     4  "SELECT DISTINCT x COLLATE binary FROM h2"   {
  1263   1263       One Two Three Four one two three four

Changes to test/tkt-80e031a00f.test.

    16     16   #
    17     17   
    18     18   set testdir [file dirname $argv0]
    19     19   source $testdir/tester.tcl
    20     20   source $testdir/lock_common.tcl
    21     21   source $testdir/malloc_common.tcl
    22     22   
    23         -# EVIDENCE-OF: R-58875-56087 The IN and NOT IN operators take a single
    24         -# scalar operand on the left and a vector operand on the right formed by
    25         -# an explicit list of zero or more scalars or by a single subquery.
    26         -#
    27     23   # EVIDENCE-OF: R-52275-55503 When the right operand is an empty set, the
    28     24   # result of IN is false and the result of NOT IN is true, regardless of
    29     25   # the left operand and even if the left operand is NULL.
    30     26   #
    31     27   # EVIDENCE-OF: R-13595-45863 Note that SQLite allows the parenthesized
    32     28   # list of scalar values on the right-hand side of an IN or NOT IN
    33     29   # operator to be an empty list but most other SQL database database