MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:jon.stephens Date:October 27 2009 6:01am
Subject:svn commit - mysqldoc@docsrva: r17327 - in trunk: refman-4.1 refman-5.0 refman-5.1 refman-5.4 refman-5.5 refman-6.0.sav
View as plain text  
Author: jstephens
Date: 2009-10-27 07:01:09 +0100 (Tue, 27 Oct 2009)
New Revision: 17327

Log:

Row constructors cannot be used with scalar subqueries.

Fixes Docs Bug #48292.



Modified:
   trunk/refman-4.1/sql-syntax-data-manipulation.xml
   trunk/refman-5.0/sql-syntax-data-manipulation.xml
   trunk/refman-5.1/sql-syntax-data-manipulation.xml
   trunk/refman-5.4/sql-syntax-data-manipulation.xml
   trunk/refman-5.5/sql-syntax-data-manipulation.xml
   trunk/refman-6.0.sav/sql-syntax-data-manipulation.xml


Modified: trunk/refman-4.1/sql-syntax-data-manipulation.xml
===================================================================
--- trunk/refman-4.1/sql-syntax-data-manipulation.xml	2009-10-27 02:32:01 UTC (rev 17326)
+++ trunk/refman-4.1/sql-syntax-data-manipulation.xml	2009-10-27 06:01:09 UTC (rev 17327)
Changed blocks: 1, Lines Added: 14, Lines Deleted: 7; 1872 bytes

@@ -5751,21 +5751,28 @@
       </para>
 
       <para>
-        Row constructors are legal in other contexts as well. For
-        example, the following two statements are semantically
-        equivalent (although in MySQL &current-series; only the second
-        one can be optimized):
+        In MySQL &current-series;, a row constructor is used for
+        comparisons with subqueries that return two or more columns.
+        When a subquery returns a single column, this is regarded as a
+        scalar value and not as a row; a row constructor cannot be used
+        with a subquery that does not return at least two columns. Thus,
+        a query such as <literal>SELECT * FROM t1 WHERE ROW(1) = (SELECT
+        column1 FROM t2)</literal> fails with a syntax error.
       </para>
 
+      <para>
+        Row constructors are legal in other contexts. For example, the
+        following two statements are semantically equivalent (although
+        in MySQL &current-series; only the second one can be optimized):
+      </para>
+
 <programlisting>
 SELECT * FROM t1 WHERE (column1,column2) = (1,1);
 SELECT * FROM t1 WHERE column1 = 1 AND column2 = 1;
 </programlisting>
 
       <para>
-        The normal use of row constructors is for comparisons with
-        subqueries that return two or more columns. For example, the
-        following query answers the request, <quote>find all rows in
+        The following query answers the request, <quote>find all rows in
         table <literal>t1</literal> that also exist in table
         <literal>t2</literal></quote>:
       </para>


Modified: trunk/refman-5.0/sql-syntax-data-manipulation.xml
===================================================================
--- trunk/refman-5.0/sql-syntax-data-manipulation.xml	2009-10-27 02:32:01 UTC (rev 17326)
+++ trunk/refman-5.0/sql-syntax-data-manipulation.xml	2009-10-27 06:01:09 UTC (rev 17327)
Changed blocks: 1, Lines Added: 14, Lines Deleted: 7; 1862 bytes

@@ -6640,21 +6640,28 @@
       </para>
 
       <para>
-        Row constructors are legal in other contexts as well. For
-        example, the following two statements are semantically
-        equivalent (although the first one cannot be optimized until
-        MySQL 5.0.26):
+        In MySQL &current-series;, a row constructor is used for
+        comparisons with subqueries that return two or more columns.
+        When a subquery returns a single column, this is regarded as a
+        scalar value and not as a row; a row constructor cannot be used
+        with a subquery that does not return at least two columns. Thus,
+        a query such as <literal>SELECT * FROM t1 WHERE ROW(1) = (SELECT
+        column1 FROM t2)</literal> fails with a syntax error.
       </para>
 
+      <para>
+        Row constructors are legal in other contexts. For example, the
+        following two statements are semantically equivalent (although
+        in MySQL &current-series; only the second one can be optimized):
+      </para>
+
 <programlisting>
 SELECT * FROM t1 WHERE (column1,column2) = (1,1);
 SELECT * FROM t1 WHERE column1 = 1 AND column2 = 1;
 </programlisting>
 
       <para>
-        The normal use of row constructors is for comparisons with
-        subqueries that return two or more columns. For example, the
-        following query answers the request, <quote>find all rows in
+        The following query answers the request, <quote>find all rows in
         table <literal>t1</literal> that also exist in table
         <literal>t2</literal></quote>:
       </para>


Modified: trunk/refman-5.1/sql-syntax-data-manipulation.xml
===================================================================
--- trunk/refman-5.1/sql-syntax-data-manipulation.xml	2009-10-27 02:32:01 UTC (rev 17326)
+++ trunk/refman-5.1/sql-syntax-data-manipulation.xml	2009-10-27 06:01:09 UTC (rev 17327)
Changed blocks: 1, Lines Added: 14, Lines Deleted: 7; 1862 bytes

@@ -6883,21 +6883,28 @@
       </para>
 
       <para>
-        Row constructors are legal in other contexts as well. For
-        example, the following two statements are semantically
-        equivalent (although the first one cannot be optimized until
-        MySQL 5.1.12):
+        In MySQL &current-series;, a row constructor is used for
+        comparisons with subqueries that return two or more columns.
+        When a subquery returns a single column, this is regarded as a
+        scalar value and not as a row; a row constructor cannot be used
+        with a subquery that does not return at least two columns. Thus,
+        a query such as <literal>SELECT * FROM t1 WHERE ROW(1) = (SELECT
+        column1 FROM t2)</literal> fails with a syntax error.
       </para>
 
+      <para>
+        Row constructors are legal in other contexts. For example, the
+        following two statements are semantically equivalent (although
+        in MySQL &current-series; only the second one can be optimized):
+      </para>
+
 <programlisting>
 SELECT * FROM t1 WHERE (column1,column2) = (1,1);
 SELECT * FROM t1 WHERE column1 = 1 AND column2 = 1;
 </programlisting>
 
       <para>
-        The normal use of row constructors is for comparisons with
-        subqueries that return two or more columns. For example, the
-        following query answers the request, <quote>find all rows in
+        The following query answers the request, <quote>find all rows in
         table <literal>t1</literal> that also exist in table
         <literal>t2</literal></quote>:
       </para>


Modified: trunk/refman-5.4/sql-syntax-data-manipulation.xml
===================================================================
--- trunk/refman-5.4/sql-syntax-data-manipulation.xml	2009-10-27 02:32:01 UTC (rev 17326)
+++ trunk/refman-5.4/sql-syntax-data-manipulation.xml	2009-10-27 06:01:09 UTC (rev 17327)
Changed blocks: 1, Lines Added: 14, Lines Deleted: 6; 1790 bytes

@@ -6861,20 +6861,28 @@
       </para>
 
       <para>
-        Row constructors are legal in other contexts as well. For
-        example, the following two statements are semantically
-        equivalent:
+        In MySQL &current-series;, a row constructor is used for
+        comparisons with subqueries that return two or more columns.
+        When a subquery returns a single column, this is regarded as a
+        scalar value and not as a row; a row constructor cannot be used
+        with a subquery that does not return at least two columns. Thus,
+        a query such as <literal>SELECT * FROM t1 WHERE ROW(1) = (SELECT
+        column1 FROM t2)</literal> fails with a syntax error.
       </para>
 
+      <para>
+        Row constructors are legal in other contexts. For example, the
+        following two statements are semantically equivalent (although
+        in MySQL &current-series; only the second one can be optimized):
+      </para>
+
 <programlisting>
 SELECT * FROM t1 WHERE (column1,column2) = (1,1);
 SELECT * FROM t1 WHERE column1 = 1 AND column2 = 1;
 </programlisting>
 
       <para>
-        The normal use of row constructors is for comparisons with
-        subqueries that return two or more columns. For example, the
-        following query answers the request, <quote>find all rows in
+        The following query answers the request, <quote>find all rows in
         table <literal>t1</literal> that also exist in table
         <literal>t2</literal></quote>:
       </para>


Modified: trunk/refman-5.5/sql-syntax-data-manipulation.xml
===================================================================
--- trunk/refman-5.5/sql-syntax-data-manipulation.xml	2009-10-27 02:32:01 UTC (rev 17326)
+++ trunk/refman-5.5/sql-syntax-data-manipulation.xml	2009-10-27 06:01:09 UTC (rev 17327)
Changed blocks: 1, Lines Added: 14, Lines Deleted: 6; 1790 bytes

@@ -7502,20 +7502,28 @@
       </para>
 
       <para>
-        Row constructors are legal in other contexts as well. For
-        example, the following two statements are semantically
-        equivalent:
+        In MySQL &current-series;, a row constructor is used for
+        comparisons with subqueries that return two or more columns.
+        When a subquery returns a single column, this is regarded as a
+        scalar value and not as a row; a row constructor cannot be used
+        with a subquery that does not return at least two columns. Thus,
+        a query such as <literal>SELECT * FROM t1 WHERE ROW(1) = (SELECT
+        column1 FROM t2)</literal> fails with a syntax error.
       </para>
 
+      <para>
+        Row constructors are legal in other contexts. For example, the
+        following two statements are semantically equivalent (although
+        in MySQL &current-series; only the second one can be optimized):
+      </para>
+
 <programlisting>
 SELECT * FROM t1 WHERE (column1,column2) = (1,1);
 SELECT * FROM t1 WHERE column1 = 1 AND column2 = 1;
 </programlisting>
 
       <para>
-        The normal use of row constructors is for comparisons with
-        subqueries that return two or more columns. For example, the
-        following query answers the request, <quote>find all rows in
+        The following query answers the request, <quote>find all rows in
         table <literal>t1</literal> that also exist in table
         <literal>t2</literal></quote>:
       </para>


Modified: trunk/refman-6.0.sav/sql-syntax-data-manipulation.xml
===================================================================
--- trunk/refman-6.0.sav/sql-syntax-data-manipulation.xml	2009-10-27 02:32:01 UTC (rev 17326)
+++ trunk/refman-6.0.sav/sql-syntax-data-manipulation.xml	2009-10-27 06:01:09 UTC (rev 17327)
Changed blocks: 1, Lines Added: 14, Lines Deleted: 6; 1802 bytes

@@ -7499,20 +7499,28 @@
       </para>
 
       <para>
-        Row constructors are legal in other contexts as well. For
-        example, the following two statements are semantically
-        equivalent:
+        In MySQL &current-series;, a row constructor is used for
+        comparisons with subqueries that return two or more columns.
+        When a subquery returns a single column, this is regarded as a
+        scalar value and not as a row; a row constructor cannot be used
+        with a subquery that does not return at least two columns. Thus,
+        a query such as <literal>SELECT * FROM t1 WHERE ROW(1) = (SELECT
+        column1 FROM t2)</literal> fails with a syntax error.
       </para>
 
+      <para>
+        Row constructors are legal in other contexts. For example, the
+        following two statements are semantically equivalent (although
+        in MySQL &current-series; only the second one can be optimized):
+      </para>
+
 <programlisting>
 SELECT * FROM t1 WHERE (column1,column2) = (1,1);
 SELECT * FROM t1 WHERE column1 = 1 AND column2 = 1;
 </programlisting>
 
       <para>
-        The normal use of row constructors is for comparisons with
-        subqueries that return two or more columns. For example, the
-        following query answers the request, <quote>find all rows in
+        The following query answers the request, <quote>find all rows in
         table <literal>t1</literal> that also exist in table
         <literal>t2</literal></quote>:
       </para>


Thread
svn commit - mysqldoc@docsrva: r17327 - in trunk: refman-4.1 refman-5.0 refman-5.1 refman-5.4 refman-5.5 refman-6.0.savjon.stephens27 Oct