Index: pages/datatype3.in
==================================================================
--- pages/datatype3.in
+++ pages/datatype3.in
@@ -314,14 +314,15 @@
The columns of a [VIEW] or FROM-clause subquery have the same affinity -as the expressions in the result set of the [SELECT] statement that implements the VIEW -or subquery. Except, column of a VIEW or subquery that are generated by expressions -that have no affinity are assigned an affinity of BLOB. +
The "columns" of a [VIEW] or FROM-clause subquery are really +the expressions +in the result set of the [SELECT] statement that implements the VIEW +or subquery. Thus, the affinity for columns of a VIEW or subquery +are determined by the expression affinity rules above. Consider an example:
CREATE TABLE t1(a INT, b TEXT, c REAL); CREATE VIEW v1(x,y,z) AS SELECT b, a+c, 42 FROM t1 WHERE b!=11; @@ -329,11 +330,11 @@The affinity of the v1.x column will be the same as the affinity of t1.b (TEXT), since v1.x maps directly into t1.b. But columns v1.y and v1.z both have no affinity, since those columns map into expression a+c and 42, and expressions always have no -affinity, so that v1.y and v1.z columns have an affinity of BLOB. +affinity.
When the [SELECT] statement that implements a [VIEW] or FROM-clause subquery is a [compound SELECT] then the affinity of each supposed column of the VIEW or subquery will be the affinity of the corresponding result column for