Author: paul
Date: 2009-03-05 04:23:41 +0100 (Thu, 05 Mar 2009)
New Revision: 14103
Log:
r39285@frost: paul | 2009-03-04 21:26:51 -0500
Fix docs bug:
Bug#42834: SELECT ... INTO Statement and Error: 1329 SQLSTATE: 02000
(ER_SP_FETCH_NO_DATA)
Modified:
trunk/refman-4.1/sql-syntax-data-manipulation.xml
trunk/refman-5.0/sql-syntax-compound-statements.xml
trunk/refman-5.0/sql-syntax-data-manipulation.xml
trunk/refman-5.1/events.xml
trunk/refman-5.1/sql-syntax-compound-statements.xml
trunk/refman-5.1/sql-syntax-data-manipulation.xml
trunk/refman-6.0/events.xml
trunk/refman-6.0/sql-syntax-compound-statements.xml
trunk/refman-6.0/sql-syntax-data-manipulation.xml
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:41755
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:39283
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:36872
+ 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:41755
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:39285
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:36872
Modified: trunk/refman-4.1/sql-syntax-data-manipulation.xml
===================================================================
--- trunk/refman-4.1/sql-syntax-data-manipulation.xml 2009-03-05 02:12:25 UTC (rev 14102)
+++ trunk/refman-4.1/sql-syntax-data-manipulation.xml 2009-03-05 03:23:41 UTC (rev 14103)
Changed blocks: 1, Lines Added: 6, Lines Deleted: 2; 1046 bytes
@@ -4147,10 +4147,14 @@
<listitem>
<para>
- As of MySQL 4.1, The <literal>INTO</literal> clause can name a
+ As of MySQL 4.1, the <literal>INTO</literal> clause can name a
list of one or more user-defined variables. The selected
values are assigned to the variables. The number of variables
- must match the number of columns.
+ must match the number of columns. The query should return a
+ single row. If the query returns no rows, error 1065 occurs
+ (<literal>Query was empty</literal>). If the query returns
+ multiple rows, error 1172 occurs (<literal>Result consisted of
+ more than one row</literal>).
</para>
</listitem>
Modified: trunk/refman-5.0/sql-syntax-compound-statements.xml
===================================================================
--- trunk/refman-5.0/sql-syntax-compound-statements.xml 2009-03-05 02:12:25 UTC (rev 14102)
+++ trunk/refman-5.0/sql-syntax-compound-statements.xml 2009-03-05 03:23:41 UTC (rev 14103)
Changed blocks: 2, Lines Added: 19, Lines Deleted: 6; 2238 bytes
@@ -293,9 +293,13 @@
<para>
<literal>SELECT ... INTO</literal> syntax enables selected
- columns to be stored directly into variables. The statement must
- retrieve only a single row. If it is possible that the statement
- may retrieve multiple rows, you can use <literal>LIMIT
+ columns to be stored directly into variables. The query should
+ return a single row. If the query returns no rows, a warning
+ with error code 1329 occurs (<literal>No data</literal>), and
+ the variable values remain unchanged. If the query returns
+ multiple rows, error 1172 occurs (<literal>Result consisted of
+ more than one row</literal>). If it is possible that the
+ statement may retrieve multiple rows, you can use <literal>LIMIT
1</literal> to limit the result set to a single row.
</para>
@@ -526,10 +530,19 @@
<para>
<literal>NOT FOUND</literal> is shorthand for the class of
SQLSTATE values that begin with <literal>'02'</literal>.
- This is relevant only within the context of cursors and is
- used to control what happens when a cursor reaches the end
- of a data set.
+ This is relevant only the context of cursors and is used to
+ control what happens when a cursor reaches the end of a data
+ set. If no more rows are available, a No Data condition
+ occurs with SQLSTATE value 02000. To detect this condition,
+ you can set up a handler for it (or for a <literal>NOT
+ FOUND</literal> condition). An example is shown in
+ <xref linkend="cursors"/>. This condition also occurs for
+ <literal>SELECT ... INTO
+ <replaceable>var_list</replaceable></literal> statements
+ that retrieve no rows.
</para>
+
+ <para></para>
</listitem>
<listitem>
Modified: trunk/refman-5.0/sql-syntax-data-manipulation.xml
===================================================================
--- trunk/refman-5.0/sql-syntax-data-manipulation.xml 2009-03-05 02:12:25 UTC (rev 14102)
+++ trunk/refman-5.0/sql-syntax-data-manipulation.xml 2009-03-05 03:23:41 UTC (rev 14103)
Changed blocks: 1, Lines Added: 9, Lines Deleted: 1; 1204 bytes
@@ -4432,7 +4432,15 @@
parameters or local variables within a stored function or
procedure body (see <xref linkend="select-into-statement"/>).
The selected values are assigned to the variables. The number
- of variables must match the number of columns.
+ of variables must match the number of columns. The query
+ should return a single row. If the query returns no rows, a
+ warning with error code 1329 occurs (<literal>No
+ data</literal>), and the variable values remain unchanged. If
+ the query returns multiple rows, error 1172 occurs
+ (<literal>Result consisted of more than one row</literal>). If
+ it is possible that the statement may retrieve multiple rows,
+ you can use <literal>LIMIT 1</literal> to limit the result set
+ to a single row.
</para>
</listitem>
Modified: trunk/refman-5.1/events.xml
===================================================================
--- trunk/refman-5.1/events.xml 2009-03-05 02:12:25 UTC (rev 14102)
+++ trunk/refman-5.1/events.xml 2009-03-05 03:23:41 UTC (rev 14103)
Changed blocks: 2, Lines Added: 39, Lines Deleted: 22; 3265 bytes
@@ -673,28 +673,29 @@
<para>
Information about the state of the Event Scheduler for debugging
and troubleshooting purposes can be obtained as follows:
+ </para>
- <itemizedlist>
+ <itemizedlist>
- <listitem>
- <para>
- In debugging builds of MySQL 5.1.11, you can use the
- <literal>SHOW SCHEDULER STATUS</literal> statement; see
- <xref linkend="show-scheduler-status"/>. This statement was
- removed in MySQL 5.1.12. We intend to implement an SQL
- statement providing similar functionality in a future MySQL
- release.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ In debugging builds of MySQL 5.1.11, you can use the
+ <literal>SHOW SCHEDULER STATUS</literal> statement; see
+ <xref linkend="show-scheduler-status"/>. This statement was
+ removed in MySQL 5.1.12. We intend to implement an SQL
+ statement providing similar functionality in a future MySQL
+ release.
+ </para>
+ </listitem>
- <listitem>
- <para>
- Beginning with MySQL 5.1.12, event scheduler status
- information can be obtained by running <command>mysqladmin
- debug</command> (see <xref linkend="mysqladmin"/>); after
- running this command, the server's error log contains output
- relating to the Event Scheduler, similar to what is shown
- here:
+ <listitem>
+ <para>
+ Beginning with MySQL 5.1.12, event scheduler status
+ information can be obtained by running <command>mysqladmin
+ debug</command> (see <xref linkend="mysqladmin"/>); after
+ running this command, the server's error log contains output
+ relating to the Event Scheduler, similar to what is shown
+ here:
<programlisting>
Events status:
@@ -720,10 +721,26 @@
WOC : NO
Next activation : 0000-00-00 00:00:00
</programlisting>
- </para>
- </listitem>
+ </para>
+ </listitem>
- </itemizedlist>
+ </itemizedlist>
+
+ <para>
+ For <literal>SELECT ... INTO
+ <replaceable>var_list</replaceable></literal> statements, if the
+ query returns multiple rows, error 1172 occurs (<literal>Result
+ consisted of more than one row</literal>). In the context of such
+ statements that occur as part of events executed by the Event
+ Scheduler, diagnostics messages (not only errors, but also
+ warnings) are written to the error log, and, on Windows, to the
+ application event log. For frequently executed events, it is
+ possible for this to result in many logged messages. For either
+ condition, you can avoid this problem by declaring a condition
+ handler; see <xref linkend="declare-handler"/>. For statements
+ that may may retrieve multiple rows, another strategy is to use
+ <literal>LIMIT 1</literal> to limit the result set to a single
+ row.
</para>
</section>
Modified: trunk/refman-5.1/sql-syntax-compound-statements.xml
===================================================================
--- trunk/refman-5.1/sql-syntax-compound-statements.xml 2009-03-05 02:12:25 UTC (rev 14102)
+++ trunk/refman-5.1/sql-syntax-compound-statements.xml 2009-03-05 03:23:41 UTC (rev 14103)
Changed blocks: 2, Lines Added: 27, Lines Deleted: 6; 2689 bytes
@@ -293,12 +293,24 @@
<para>
<literal>SELECT ... INTO</literal> syntax enables selected
- columns to be stored directly into variables. The statement must
- retrieve only a single row. If it is possible that the statement
- may retrieve multiple rows, you can use <literal>LIMIT
+ columns to be stored directly into variables. The query should
+ return a single row. If the query returns no rows, a warning
+ with error code 1329 occurs (<literal>No data</literal>), and
+ the variable values remain unchanged. If the query returns
+ multiple rows, error 1172 occurs (<literal>Result consisted of
+ more than one row</literal>). If it is possible that the
+ statement may retrieve multiple rows, you can use <literal>LIMIT
1</literal> to limit the result set to a single row.
</para>
+ <para>
+ In the context of such statements that occur as part of events
+ executed by the Event Scheduler, diagnostics messages (not only
+ errors, but also warnings) are written to the error log, and, on
+ Windows, to the application event log. For additional
+ information, see <xref linkend="events-status-info"/>.
+ </para>
+
<remark role="help-description-end"/>
<remark role="help-example"/>
@@ -526,10 +538,19 @@
<para>
<literal>NOT FOUND</literal> is shorthand for the class of
SQLSTATE values that begin with <literal>'02'</literal>.
- This is relevant only within the context of cursors and is
- used to control what happens when a cursor reaches the end
- of a data set.
+ This is relevant only the context of cursors and is used to
+ control what happens when a cursor reaches the end of a data
+ set. If no more rows are available, a No Data condition
+ occurs with SQLSTATE value 02000. To detect this condition,
+ you can set up a handler for it (or for a <literal>NOT
+ FOUND</literal> condition). An example is shown in
+ <xref linkend="cursors"/>. This condition also occurs for
+ <literal>SELECT ... INTO
+ <replaceable>var_list</replaceable></literal> statements
+ that retrieve no rows.
</para>
+
+ <para></para>
</listitem>
<listitem>
Modified: trunk/refman-5.1/sql-syntax-data-manipulation.xml
===================================================================
--- trunk/refman-5.1/sql-syntax-data-manipulation.xml 2009-03-05 02:12:25 UTC (rev 14102)
+++ trunk/refman-5.1/sql-syntax-data-manipulation.xml 2009-03-05 03:23:41 UTC (rev 14103)
Changed blocks: 1, Lines Added: 17, Lines Deleted: 1; 1604 bytes
@@ -4475,8 +4475,24 @@
parameters or local variables within a stored function or
procedure body (see <xref linkend="select-into-statement"/>).
The selected values are assigned to the variables. The number
- of variables must match the number of columns.
+ of variables must match the number of columns. The query
+ should return a single row. If the query returns no rows, a
+ warning with error code 1329 occurs (<literal>No
+ data</literal>), and the variable values remain unchanged. If
+ the query returns multiple rows, error 1172 occurs
+ (<literal>Result consisted of more than one row</literal>). If
+ it is possible that the statement may retrieve multiple rows,
+ you can use <literal>LIMIT 1</literal> to limit the result set
+ to a single row.
</para>
+
+ <para>
+ In the context of such statements that occur as part of events
+ executed by the Event Scheduler, diagnostics messages (not
+ only errors, but also warnings) are written to the error log,
+ and, on Windows, to the application event log. For additional
+ information, see <xref linkend="events-status-info"/>.
+ </para>
</listitem>
<listitem>
Modified: trunk/refman-6.0/events.xml
===================================================================
--- trunk/refman-6.0/events.xml 2009-03-05 02:12:25 UTC (rev 14102)
+++ trunk/refman-6.0/events.xml 2009-03-05 03:23:41 UTC (rev 14103)
Changed blocks: 2, Lines Added: 17, Lines Deleted: 0; 1493 bytes
@@ -622,6 +622,7 @@
<xref linkend="mysqladmin"/>); after running this command, the
server's error log contains output relating to the Event
Scheduler, similar to what is shown here:
+ </para>
<programlisting>
Events status:
@@ -647,6 +648,22 @@
WOC : NO
Next activation : 0000-00-00 00:00:00
</programlisting>
+
+ <para>
+ For <literal>SELECT ... INTO
+ <replaceable>var_list</replaceable></literal> statements, if the
+ query returns multiple rows, error 1172 occurs (<literal>Result
+ consisted of more than one row</literal>). In the context of such
+ statements that occur as part of events executed by the Event
+ Scheduler, diagnostics messages (not only errors, but also
+ warnings) are written to the error log, and, on Windows, to the
+ application event log. For frequently executed events, it is
+ possible for this to result in many logged messages. For either
+ condition, you can avoid this problem by declaring a condition
+ handler; see <xref linkend="declare-handler"/>. For statements
+ that may may retrieve multiple rows, another strategy is to use
+ <literal>LIMIT 1</literal> to limit the result set to a single
+ row.
</para>
</section>
Modified: trunk/refman-6.0/sql-syntax-compound-statements.xml
===================================================================
--- trunk/refman-6.0/sql-syntax-compound-statements.xml 2009-03-05 02:12:25 UTC (rev 14102)
+++ trunk/refman-6.0/sql-syntax-compound-statements.xml 2009-03-05 03:23:41 UTC (rev 14103)
Changed blocks: 2, Lines Added: 27, Lines Deleted: 6; 2689 bytes
@@ -287,12 +287,24 @@
<para>
<literal>SELECT ... INTO</literal> syntax enables selected
- columns to be stored directly into variables. The statement must
- retrieve only a single row. If it is possible that the statement
- may retrieve multiple rows, you can use <literal>LIMIT
+ columns to be stored directly into variables. The query should
+ return a single row. If the query returns no rows, a warning
+ with error code 1329 occurs (<literal>No data</literal>), and
+ the variable values remain unchanged. If the query returns
+ multiple rows, error 1172 occurs (<literal>Result consisted of
+ more than one row</literal>). If it is possible that the
+ statement may retrieve multiple rows, you can use <literal>LIMIT
1</literal> to limit the result set to a single row.
</para>
+ <para>
+ In the context of such statements that occur as part of events
+ executed by the Event Scheduler, diagnostics messages (not only
+ errors, but also warnings) are written to the error log, and, on
+ Windows, to the application event log. For additional
+ information, see <xref linkend="events-status-info"/>.
+ </para>
+
<remark role="help-description-end"/>
<remark role="help-example"/>
@@ -520,10 +532,19 @@
<para>
<literal>NOT FOUND</literal> is shorthand for the class of
SQLSTATE values that begin with <literal>'02'</literal>.
- This is relevant only within the context of cursors and is
- used to control what happens when a cursor reaches the end
- of a data set.
+ This is relevant only the context of cursors and is used to
+ control what happens when a cursor reaches the end of a data
+ set. If no more rows are available, a No Data condition
+ occurs with SQLSTATE value 02000. To detect this condition,
+ you can set up a handler for it (or for a <literal>NOT
+ FOUND</literal> condition). An example is shown in
+ <xref linkend="cursors"/>. This condition also occurs for
+ <literal>SELECT ... INTO
+ <replaceable>var_list</replaceable></literal> statements
+ that retrieve no rows.
</para>
+
+ <para></para>
</listitem>
<listitem>
Modified: trunk/refman-6.0/sql-syntax-data-manipulation.xml
===================================================================
--- trunk/refman-6.0/sql-syntax-data-manipulation.xml 2009-03-05 02:12:25 UTC (rev 14102)
+++ trunk/refman-6.0/sql-syntax-data-manipulation.xml 2009-03-05 03:23:41 UTC (rev 14103)
Changed blocks: 1, Lines Added: 17, Lines Deleted: 1; 1604 bytes
@@ -5097,8 +5097,24 @@
parameters or local variables within a stored function or
procedure body (see <xref linkend="select-into-statement"/>).
The selected values are assigned to the variables. The number
- of variables must match the number of columns.
+ of variables must match the number of columns. The query
+ should return a single row. If the query returns no rows, a
+ warning with error code 1329 occurs (<literal>No
+ data</literal>), and the variable values remain unchanged. If
+ the query returns multiple rows, error 1172 occurs
+ (<literal>Result consisted of more than one row</literal>). If
+ it is possible that the statement may retrieve multiple rows,
+ you can use <literal>LIMIT 1</literal> to limit the result set
+ to a single row.
</para>
+
+ <para>
+ In the context of such statements that occur as part of events
+ executed by the Event Scheduler, diagnostics messages (not
+ only errors, but also warnings) are written to the error log,
+ and, on Windows, to the application event log. For additional
+ information, see <xref linkend="events-status-info"/>.
+ </para>
</listitem>
<listitem>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r14103 - in trunk: . refman-4.1 refman-5.0 refman-5.1 refman-6.0 | paul.dubois | 5 Mar |