Author: paul
Date: 2006-01-27 16:41:17 +0100 (Fri, 27 Jan 2006)
New Revision: 1061
Log:
r6743@frost: paul | 2006-01-27 09:37:14 -0600
General revisions.
Modified:
trunk/
trunk/refman-4.1/optimization.xml
trunk/refman-4.1/sql-syntax.xml
trunk/refman-5.0/optimization.xml
trunk/refman-5.0/sql-syntax.xml
trunk/refman-5.1/optimization.xml
trunk/refman-5.1/sql-syntax.xml
trunk/refman-common/titles.en.ent
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:6742
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:2564
+ b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:6743
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:2564
Modified: trunk/refman-4.1/optimization.xml
===================================================================
--- trunk/refman-4.1/optimization.xml 2006-01-27 15:40:55 UTC (rev 1060)
+++ trunk/refman-4.1/optimization.xml 2006-01-27 15:41:17 UTC (rev 1061)
@@ -7619,6 +7619,15 @@
</listitem>
<listitem>
+ <para>
+ When a thread is no longer needed, the memory allocated to
+ it is released and returned to the system unless the thread
+ goes back into the thread cache. In that case, the memory
+ remains allocated.
+ </para>
+ </listitem>
+
+ <listitem>
<remark role="todo">
Where are we at with this? [js]
</remark>
Modified: trunk/refman-4.1/sql-syntax.xml
===================================================================
--- trunk/refman-4.1/sql-syntax.xml 2006-01-27 15:40:55 UTC (rev 1060)
+++ trunk/refman-4.1/sql-syntax.xml 2006-01-27 15:41:17 UTC (rev 1061)
@@ -3163,7 +3163,7 @@
<programlisting>
DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM <replaceable>tbl_name</replaceable>
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
[ORDER BY ...]
[LIMIT <replaceable>row_count</replaceable>]
</programlisting>
@@ -3176,7 +3176,7 @@
DELETE [LOW_PRIORITY] [QUICK] [IGNORE]
<replaceable>tbl_name</replaceable>[.*] [, <replaceable>tbl_name</replaceable>[.*]] ...
FROM <replaceable>table_references</replaceable>
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
</programlisting>
<para>
@@ -3187,7 +3187,7 @@
DELETE [LOW_PRIORITY] [QUICK] [IGNORE]
FROM <replaceable>tbl_name</replaceable>[.*] [, <replaceable>tbl_name</replaceable>[.*]] ...
USING <replaceable>table_references</replaceable>
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
</programlisting>
<remark role="help-syntax-end"/>
@@ -3195,17 +3195,36 @@
<remark role="help-description-begin"/>
<para>
- <literal>DELETE</literal> deletes rows from
- <replaceable>tbl_name</replaceable> that satisfy the condition
- given by <replaceable>where_definition</replaceable>, and
- returns the number of rows deleted.
+ For the single-table syntax, the <literal>DELETE</literal>
+ statement deletes rows from <replaceable>tbl_name</replaceable>
+ and returns the number of rows deleted. The
+ <literal>WHERE</literal> clause, if given, specifies the
+ conditions that identify which rows to delete. With no
+ <literal>WHERE</literal> clause, all rows are deleted. If the
+ <literal>ORDER BY</literal> clause is specified, the rows are
+ deleted in the order that is specified. The
+ <literal>LIMIT</literal> clause places a limit on the number of
+ rows that can be deleted.
</para>
<para>
- If you issue a <literal>DELETE</literal> statement with no
- <literal>WHERE</literal> clause, all rows are deleted. A faster
- way to do this, when you do not want to know the number of
- deleted rows, is to use <literal>TRUNCATE TABLE</literal>. See
+ For the multiple-table syntax, <literal>DELETE</literal> deletes
+ from each <replaceable>tbl_name</replaceable> the rows that
+ satisfy the conditions. In this case, <literal>ORDER
+ BY</literal> and <literal>LIMIT</literal> cannot be used.
+ </para>
+
+ <para>
+ <replaceable>where_condition</replaceable> is an expression that
+ evaluates to true for each row to be deleted. It is specified as
+ described in <xref linkend="select"/>.
+ </para>
+
+ <para>
+ As stated, a <literal>DELETE</literal> statement with no
+ <literal>WHERE</literal> clause deletes all rows. A faster way
+ to do this, when you do not want to know the number of deleted
+ rows, is to use <literal>TRUNCATE TABLE</literal>. See
<xref linkend="truncate"/>.
</para>
@@ -3238,8 +3257,8 @@
<para>
If you delete the row containing the maximum value for an
<literal>AUTO_INCREMENT</literal> column, the value is reused
- for an <literal>ISAM</literal> or <literal>BDB</literal> table,
- but not for a <literal>MyISAM</literal> or
+ later for an <literal>ISAM</literal> or <literal>BDB</literal>
+ table, but not for a <literal>MyISAM</literal> or
<literal>InnoDB</literal> table. If you delete all rows in the
table with <literal>DELETE FROM
<replaceable>tbl_name</replaceable></literal> (without a
@@ -3269,9 +3288,9 @@
<listitem>
<para>
- If you specify <literal>LOW_PRIORITY</literal>, execution of
- the <literal>DELETE</literal> is delayed until no other
- clients are reading from the table.
+ If you specify <literal>LOW_PRIORITY</literal>, the server
+ delays execution of the <literal>DELETE</literal> until no
+ other clients are reading from the table.
</para>
</listitem>
@@ -3290,8 +3309,8 @@
all errors during the process of deleting rows. (Errors
encountered during the parsing stage are processed in the
usual manner.) Errors that are ignored due to the use of
- this option are returned as warnings. This option first
- appeared in MySQL 4.1.1.
+ <literal>IGNORE</literal> are returned as warnings. This
+ option first appeared in MySQL 4.1.1.
</para>
</listitem>
@@ -3311,7 +3330,7 @@
reorganize tables. <literal>OPTIMIZE TABLE</literal> is easier,
but <command>myisamchk</command> is faster. See
<xref linkend="optimize-table"/>, and
- <xref linkend="optimization"/>.
+ <xref linkend="myisamchk"/>.
</para>
<para>
@@ -3383,7 +3402,7 @@
<replaceable>row_count</replaceable></literal> option to
<literal>DELETE</literal> tells the server the maximum number of
rows to be deleted before control is returned to the client.
- This can be used to ensure that a specific
+ This can be used to ensure that a given
<literal>DELETE</literal> statement does not take too much time.
You can simply repeat the <literal>DELETE</literal> statement
until the number of affected rows is less than the
@@ -3402,10 +3421,8 @@
</para>
<programlisting>
-DELETE FROM somelog
-WHERE user = 'jcole'
-ORDER BY timestamp_column
-LIMIT 1;
+DELETE FROM somelog WHERE user = 'jcole'
+ORDER BY timestamp_column LIMIT 1;
</programlisting>
<para>
@@ -3423,24 +3440,34 @@
</para>
<para>
- The first multiple-table <literal>DELETE</literal> syntax is
- supported starting from MySQL 4.0.0. The second is supported
- starting from MySQL 4.0.2. The
- <replaceable>table_references</replaceable> part lists the
+ You can specify multiple tables in a <literal>DELETE</literal>
+ statement to delete rows from one or more tables depending on
+ the particular condition in the <literal>WHERE</literal> clause.
+ However, you cannot use <literal>ORDER BY</literal> or
+ <literal>LIMIT</literal> in a multiple-table
+ <literal>DELETE</literal>. The
+ <replaceable>table_references</replaceable> clause lists the
tables involved in the join. Its syntax is described in
<xref linkend="join"/>.
</para>
<para>
- For the first syntax, only matching rows from the tables listed
- before the <literal>FROM</literal> clause are deleted. For the
- second syntax, only matching rows from the tables listed in the
- <literal>FROM</literal> clause (before the
- <literal>USING</literal> clause) are deleted. The effect is that
- you can delete rows from many tables at the same time and have
- additional tables that are used for searching:
+ The first multiple-table <literal>DELETE</literal> syntax is
+ supported starting from MySQL 4.0.0. The second is supported
+ starting from MySQL 4.0.2.
</para>
+ <para>
+ For the first multiple-table syntax, only matching rows from the
+ tables listed before the <literal>FROM</literal> clause are
+ deleted. For the second multiple-table syntax, only matching
+ rows from the tables listed in the <literal>FROM</literal>
+ clause (before the <literal>USING</literal> clause) are deleted.
+ The effect is that you can delete rows from many tables at the
+ same time and have additional tables that are used only for
+ searching:
+ </para>
+
<programlisting>
DELETE t1, t2 FROM t1, t2, t3 WHERE t1.id=t2.id AND t2.id=t3.id;
</programlisting>
@@ -5946,10 +5973,10 @@
[SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]
<replaceable>select_expr</replaceable>, ...
[FROM <replaceable>table_references</replaceable>
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
[GROUP BY {<replaceable>col_name</replaceable> | <replaceable>expr</replaceable> | <replaceable>position</replaceable>}
[ASC | DESC], ... [WITH ROLLUP]]
- [HAVING <replaceable>where_definition</replaceable>]
+ [HAVING <replaceable>where_condition</replaceable>]
[ORDER BY {<replaceable>col_name</replaceable> | <replaceable>expr</replaceable> | <replaceable>position</replaceable>}
[ASC | DESC] , ...]
[LIMIT {[<replaceable>offset</replaceable>,] <replaceable>row_count</replaceable> | <replaceable>row_count</replaceable> OFFSET <replaceable>offset</replaceable>}]
@@ -5988,7 +6015,7 @@
<listitem>
<para>
- <replaceable>where_definition</replaceable> consists of the
+ <replaceable>where_condition</replaceable> consists of the
keyword <literal>WHERE</literal> followed by an expression
that indicates the condition or conditions that rows must
satisfy to be selected.
@@ -8837,7 +8864,7 @@
<programlisting>
UPDATE [LOW_PRIORITY] [IGNORE] <replaceable>tbl_name</replaceable>
SET <replaceable>col_name1</replaceable>=<replaceable>expr1</replaceable> [, <replaceable>col_name2</replaceable>=<replaceable>expr2</replaceable> ...]
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
[ORDER BY ...]
[LIMIT <replaceable>row_count</replaceable>]
</programlisting>
@@ -8849,7 +8876,7 @@
<programlisting>
UPDATE [LOW_PRIORITY] [IGNORE] <replaceable>table_references</replaceable>
SET <replaceable>col_name1</replaceable>=<replaceable>expr1</replaceable> [, <replaceable>col_name2</replaceable>=<replaceable>expr2</replaceable> ...]
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
</programlisting>
<remark role="help-syntax-end"/>
@@ -8857,18 +8884,35 @@
<remark role="help-description-begin"/>
<para>
- The <literal>UPDATE</literal> statement updates columns in
- existing table rows with new values. The <literal>SET</literal>
- clause indicates which columns to modify and the values they
- should be given. The <literal>WHERE</literal> clause, if given,
- specifies which rows should be updated. Otherwise, all rows are
- updated. If the <literal>ORDER BY</literal> clause is specified,
- the rows are updated in the order that is specified. The
+ For the single-table syntax, the <literal>UPDATE</literal>
+ statement updates columns of existing rows in
+ <literal>tbl_name</literal> with new values. The
+ <literal>SET</literal> clause indicates which columns to modify
+ and the values they should be given. The
+ <literal>WHERE</literal> clause, if given, specifies the
+ conditions that identify which rows to update. With no
+ <literal>WHERE</literal> clause, all rows are updated. If the
+ <literal>ORDER BY</literal> clause is specified, the rows are
+ updated in the order that is specified. The
<literal>LIMIT</literal> clause places a limit on the number of
rows that can be updated.
</para>
<para>
+ For the multiple-table syntax, <literal>UPDATE</literal> updates
+ rows in each table named in
+ <replaceable>table_references</replaceable> that satisfy the
+ conditions. In this case, <literal>ORDER BY</literal> and
+ <literal>LIMIT</literal> cannot be used.
+ </para>
+
+ <para>
+ <replaceable>where_condition</replaceable> is an expression that
+ evaluates to true for each row to be updated. It is specified as
+ described in <xref linkend="select"/>.
+ </para>
+
+ <para>
The <literal>UPDATE</literal> statement supports the following
modifiers:
</para>
@@ -8907,7 +8951,7 @@
</para>
<programlisting>
-mysql> <userinput>UPDATE persondata SET age=age+1;</userinput>
+UPDATE persondata SET age=age+1;
</programlisting>
<para>
@@ -8917,7 +8961,7 @@
</para>
<programlisting>
-mysql> <userinput>UPDATE persondata SET age=age*2, age=age+1;</userinput>
+UPDATE persondata SET age=age*2, age=age+1;
</programlisting>
<para>
@@ -8987,7 +9031,10 @@
<para>
Starting with MySQL 4.0.4, you can also perform
<literal>UPDATE</literal> operations covering multiple tables.
- The <replaceable>table_references</replaceable> clause lists the
+ However, you cannot use <literal>ORDER BY</literal> or
+ <literal>LIMIT</literal> with a multiple-table
+ <literal>UPDATE</literal>. The
+ <replaceable>table_references</replaceable> clause lists the
tables involved in the join. Its syntax is described in
<xref linkend="join"/>. Here is an example:
</para>
@@ -9006,13 +9053,6 @@
</para>
<para>
- <emphasis role="bold">Note</emphasis>: You
- <emphasis>cannot</emphasis> use <literal>ORDER BY</literal> or
- <literal>LIMIT</literal> with a multiple-table
- <literal>UPDATE</literal>.
- </para>
-
- <para>
Before MySQL 4.0.18, you need the <literal>UPDATE</literal>
privilege for all tables used in a multiple-table
<literal>UPDATE</literal>, even if they were not updated. As of
Modified: trunk/refman-5.0/optimization.xml
===================================================================
--- trunk/refman-5.0/optimization.xml 2006-01-27 15:40:55 UTC (rev 1060)
+++ trunk/refman-5.0/optimization.xml 2006-01-27 15:41:17 UTC (rev 1061)
@@ -9205,6 +9205,15 @@
</listitem>
<listitem>
+ <para>
+ When a thread is no longer needed, the memory allocated to
+ it is released and returned to the system unless the thread
+ goes back into the thread cache. In that case, the memory
+ remains allocated.
+ </para>
+ </listitem>
+
+ <listitem>
<remark role="todo">
Where are we at with this? [js]
</remark>
Modified: trunk/refman-5.0/sql-syntax.xml
===================================================================
--- trunk/refman-5.0/sql-syntax.xml 2006-01-27 15:40:55 UTC (rev 1060)
+++ trunk/refman-5.0/sql-syntax.xml 2006-01-27 15:41:17 UTC (rev 1061)
@@ -3127,7 +3127,6 @@
everything to its original state.
</para>
-
</section>
</section>
@@ -3160,7 +3159,7 @@
<programlisting>
DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM <replaceable>tbl_name</replaceable>
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
[ORDER BY ...]
[LIMIT <replaceable>row_count</replaceable>]
</programlisting>
@@ -3173,7 +3172,7 @@
DELETE [LOW_PRIORITY] [QUICK] [IGNORE]
<replaceable>tbl_name</replaceable>[.*] [, <replaceable>tbl_name</replaceable>[.*]] ...
FROM <replaceable>table_references</replaceable>
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
</programlisting>
<para>
@@ -3184,7 +3183,7 @@
DELETE [LOW_PRIORITY] [QUICK] [IGNORE]
FROM <replaceable>tbl_name</replaceable>[.*] [, <replaceable>tbl_name</replaceable>[.*]] ...
USING <replaceable>table_references</replaceable>
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
</programlisting>
<remark role="help-syntax-end"/>
@@ -3192,17 +3191,36 @@
<remark role="help-description-begin"/>
<para>
- <literal>DELETE</literal> deletes rows from
- <replaceable>tbl_name</replaceable> that satisfy the condition
- given by <replaceable>where_definition</replaceable>, and
- returns the number of rows deleted.
+ For the single-table syntax, the <literal>DELETE</literal>
+ statement deletes rows from <replaceable>tbl_name</replaceable>
+ and returns the number of rows deleted. The
+ <literal>WHERE</literal> clause, if given, specifies the
+ conditions that identify which rows to delete. With no
+ <literal>WHERE</literal> clause, all rows are deleted. If the
+ <literal>ORDER BY</literal> clause is specified, the rows are
+ deleted in the order that is specified. The
+ <literal>LIMIT</literal> clause places a limit on the number of
+ rows that can be deleted.
</para>
<para>
- If you issue a <literal>DELETE</literal> statement with no
- <literal>WHERE</literal> clause, all rows are deleted. A faster
- way to do this, when you do not want to know the number of
- deleted rows, is to use <literal>TRUNCATE TABLE</literal>. See
+ For the multiple-table syntax, <literal>DELETE</literal> deletes
+ from each <replaceable>tbl_name</replaceable> the rows that
+ satisfy the conditions. In this case, <literal>ORDER
+ BY</literal> and <literal>LIMIT</literal> cannot be used.
+ </para>
+
+ <para>
+ <replaceable>where_condition</replaceable> is an expression that
+ evaluates to true for each row to be deleted. It is specified as
+ described in <xref linkend="select"/>.
+ </para>
+
+ <para>
+ As stated, a <literal>DELETE</literal> statement with no
+ <literal>WHERE</literal> clause deletes all rows. A faster way
+ to do this, when you do not want to know the number of deleted
+ rows, is to use <literal>TRUNCATE TABLE</literal>. See
<xref linkend="truncate"/>.
</para>
@@ -3211,7 +3229,7 @@
<para>
If you delete the row containing the maximum value for an
<literal>AUTO_INCREMENT</literal> column, the value is reused
- for a <literal>BDB</literal> table, but not for a
+ later for a <literal>BDB</literal> table, but not for a
<literal>MyISAM</literal> or <literal>InnoDB</literal> table. If
you delete all rows in the table with <literal>DELETE FROM
<replaceable>tbl_name</replaceable></literal> (without a
@@ -3241,9 +3259,9 @@
<listitem>
<para>
- If you specify <literal>LOW_PRIORITY</literal>, execution of
- the <literal>DELETE</literal> is delayed until no other
- clients are reading from the table.
+ If you specify <literal>LOW_PRIORITY</literal>, the server
+ delays execution of the <literal>DELETE</literal> until no
+ other clients are reading from the table.
</para>
</listitem>
@@ -3262,7 +3280,7 @@
all errors during the process of deleting rows. (Errors
encountered during the parsing stage are processed in the
usual manner.) Errors that are ignored due to the use of
- this option are returned as warnings.
+ <literal>OPTION</literal> are returned as warnings.
</para>
</listitem>
@@ -3282,7 +3300,7 @@
reorganize tables. <literal>OPTIMIZE TABLE</literal> is easier,
but <command>myisamchk</command> is faster. See
<xref linkend="optimize-table"/>, and
- <xref linkend="optimization"/>.
+ <xref linkend="myisamchk"/>.
</para>
<para>
@@ -3354,7 +3372,7 @@
<replaceable>row_count</replaceable></literal> option to
<literal>DELETE</literal> tells the server the maximum number of
rows to be deleted before control is returned to the client.
- This can be used to ensure that a specific
+ This can be used to ensure that a given
<literal>DELETE</literal> statement does not take too much time.
You can simply repeat the <literal>DELETE</literal> statement
until the number of affected rows is less than the
@@ -3373,34 +3391,31 @@
</para>
<programlisting>
-DELETE FROM somelog
-WHERE user = 'jcole'
-ORDER BY timestamp_column
-LIMIT 1;
+DELETE FROM somelog WHERE user = 'jcole'
+ORDER BY timestamp_column LIMIT 1;
</programlisting>
<para>
You can specify multiple tables in a <literal>DELETE</literal>
- statement to delete rows from one or more tables depending on a
- particular condition in multiple tables. However, you cannot use
- <literal>ORDER BY</literal> or <literal>LIMIT</literal> in a
- multiple-table <literal>DELETE</literal>.
- </para>
-
- <para>
- The <replaceable>table_references</replaceable> part lists the
+ statement to delete rows from one or more tables depending on
+ the particular condition in the <literal>WHERE</literal> clause.
+ However, you cannot use <literal>ORDER BY</literal> or
+ <literal>LIMIT</literal> in a multiple-table
+ <literal>DELETE</literal>. The
+ <replaceable>table_references</replaceable> clause lists the
tables involved in the join. Its syntax is described in
<xref linkend="join"/>.
</para>
<para>
- For the first syntax, only matching rows from the tables listed
- before the <literal>FROM</literal> clause are deleted. For the
- second syntax, only matching rows from the tables listed in the
- <literal>FROM</literal> clause (before the
- <literal>USING</literal> clause) are deleted. The effect is that
- you can delete rows from many tables at the same time and have
- additional tables that are used for searching:
+ For the first multiple-table syntax, only matching rows from the
+ tables listed before the <literal>FROM</literal> clause are
+ deleted. For the second multiple-table syntax, only matching
+ rows from the tables listed in the <literal>FROM</literal>
+ clause (before the <literal>USING</literal> clause) are deleted.
+ The effect is that you can delete rows from many tables at the
+ same time and have additional tables that are used only for
+ searching:
</para>
<programlisting>
@@ -3447,8 +3462,8 @@
</para>
<para>
- <emphasis role="bold">Note</emphasis>: You must use the alias
- (if one was given) when referring to a table name:
+ <emphasis role="bold">Note</emphasis>: If you provide an alias
+ for a table, you must use the alias when referring to the table:
</para>
<programlisting>
@@ -5946,10 +5961,10 @@
[SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]
<replaceable>select_expr</replaceable>, ...
[FROM <replaceable>table_references</replaceable>
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
[GROUP BY {<replaceable>col_name</replaceable> | <replaceable>expr</replaceable> | <replaceable>position</replaceable>}
[ASC | DESC], ... [WITH ROLLUP]]
- [HAVING <replaceable>where_definition</replaceable>]
+ [HAVING <replaceable>where_condition</replaceable>]
[ORDER BY {<replaceable>col_name</replaceable> | <replaceable>expr</replaceable> | <replaceable>position</replaceable>}
[ASC | DESC] , ...]
[LIMIT {[<replaceable>offset</replaceable>,] <replaceable>row_count</replaceable> | <replaceable>row_count</replaceable> OFFSET <replaceable>offset</replaceable>}]
@@ -5987,7 +6002,7 @@
<listitem>
<para>
- <replaceable>where_definition</replaceable> consists of the
+ <replaceable>where_condition</replaceable> consists of the
keyword <literal>WHERE</literal> followed by an expression
that indicates the condition or conditions that rows must
satisfy to be selected.
@@ -9201,7 +9216,7 @@
<programlisting>
UPDATE [LOW_PRIORITY] [IGNORE] <replaceable>tbl_name</replaceable>
SET <replaceable>col_name1</replaceable>=<replaceable>expr1</replaceable> [, <replaceable>col_name2</replaceable>=<replaceable>expr2</replaceable> ...]
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
[ORDER BY ...]
[LIMIT <replaceable>row_count</replaceable>]
</programlisting>
@@ -9213,7 +9228,7 @@
<programlisting>
UPDATE [LOW_PRIORITY] [IGNORE] <replaceable>table_references</replaceable>
SET <replaceable>col_name1</replaceable>=<replaceable>expr1</replaceable> [, <replaceable>col_name2</replaceable>=<replaceable>expr2</replaceable> ...]
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
</programlisting>
<remark role="help-syntax-end"/>
@@ -9221,18 +9236,35 @@
<remark role="help-description-begin"/>
<para>
- The <literal>UPDATE</literal> statement updates columns in
- existing table rows with new values. The <literal>SET</literal>
- clause indicates which columns to modify and the values they
- should be given. The <literal>WHERE</literal> clause, if given,
- specifies which rows should be updated. Otherwise, all rows are
- updated. If the <literal>ORDER BY</literal> clause is specified,
- the rows are updated in the order that is specified. The
+ For the single-table syntax, the <literal>UPDATE</literal>
+ statement updates columns of existing rows in
+ <literal>tbl_name</literal> with new values. The
+ <literal>SET</literal> clause indicates which columns to modify
+ and the values they should be given. The
+ <literal>WHERE</literal> clause, if given, specifies the
+ conditions that identify which rows to update. With no
+ <literal>WHERE</literal> clause, all rows are updated. If the
+ <literal>ORDER BY</literal> clause is specified, the rows are
+ updated in the order that is specified. The
<literal>LIMIT</literal> clause places a limit on the number of
rows that can be updated.
</para>
<para>
+ For the multiple-table syntax, <literal>UPDATE</literal> updates
+ rows in each table named in
+ <replaceable>table_references</replaceable> that satisfy the
+ conditions. In this case, <literal>ORDER BY</literal> and
+ <literal>LIMIT</literal> cannot be used.
+ </para>
+
+ <para>
+ <replaceable>where_condition</replaceable> is an expression that
+ evaluates to true for each row to be updated. It is specified as
+ described in <xref linkend="select"/>.
+ </para>
+
+ <para>
The <literal>UPDATE</literal> statement supports the following
modifiers:
</para>
@@ -9271,7 +9303,7 @@
</para>
<programlisting>
-mysql> <userinput>UPDATE persondata SET age=age+1;</userinput>
+UPDATE persondata SET age=age+1;
</programlisting>
<para>
@@ -9281,7 +9313,7 @@
</para>
<programlisting>
-mysql> <userinput>UPDATE persondata SET age=age*2, age=age+1;</userinput>
+UPDATE persondata SET age=age*2, age=age+1;
</programlisting>
<para>
@@ -9330,7 +9362,9 @@
<para>
You can also perform <literal>UPDATE</literal> operations
- covering multiple tables. The
+ covering multiple tables. However, you cannot use <literal>ORDER
+ BY</literal> or <literal>LIMIT</literal> with a multiple-table
+ <literal>UPDATE</literal>. The
<replaceable>table_references</replaceable> clause lists the
tables involved in the join. Its syntax is described in
<xref linkend="join"/>. Here is an example:
@@ -9350,13 +9384,6 @@
</para>
<para>
- <emphasis role="bold">Note</emphasis>: You
- <emphasis>cannot</emphasis> use <literal>ORDER BY</literal> or
- <literal>LIMIT</literal> with a multiple-table
- <literal>UPDATE</literal>.
- </para>
-
- <para>
You need the <literal>UPDATE</literal> privilege only for
columns referenced in a multiple-table <literal>UPDATE</literal>
that are actually updated. You need only the
Modified: trunk/refman-5.1/optimization.xml
===================================================================
--- trunk/refman-5.1/optimization.xml 2006-01-27 15:40:55 UTC (rev 1060)
+++ trunk/refman-5.1/optimization.xml 2006-01-27 15:41:17 UTC (rev 1061)
@@ -9347,6 +9347,15 @@
</listitem>
<listitem>
+ <para>
+ When a thread is no longer needed, the memory allocated to
+ it is released and returned to the system unless the thread
+ goes back into the thread cache. In that case, the memory
+ remains allocated.
+ </para>
+ </listitem>
+
+ <listitem>
<remark role="todo">
Where are we at with this? [js]
</remark>
Modified: trunk/refman-5.1/sql-syntax.xml
===================================================================
--- trunk/refman-5.1/sql-syntax.xml 2006-01-27 15:40:55 UTC (rev 1060)
+++ trunk/refman-5.1/sql-syntax.xml 2006-01-27 15:41:17 UTC (rev 1061)
@@ -3767,7 +3767,7 @@
<programlisting>
DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM <replaceable>tbl_name</replaceable>
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
[ORDER BY ...]
[LIMIT <replaceable>row_count</replaceable>]
</programlisting>
@@ -3780,7 +3780,7 @@
DELETE [LOW_PRIORITY] [QUICK] [IGNORE]
<replaceable>tbl_name</replaceable>[.*] [, <replaceable>tbl_name</replaceable>[.*]] ...
FROM <replaceable>table_references</replaceable>
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
</programlisting>
<para>
@@ -3791,7 +3791,7 @@
DELETE [LOW_PRIORITY] [QUICK] [IGNORE]
FROM <replaceable>tbl_name</replaceable>[.*] [, <replaceable>tbl_name</replaceable>[.*]] ...
USING <replaceable>table_references</replaceable>
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
</programlisting>
<remark role="help-syntax-end"/>
@@ -3799,17 +3799,36 @@
<remark role="help-description-begin"/>
<para>
- <literal>DELETE</literal> deletes rows from
- <replaceable>tbl_name</replaceable> that satisfy the condition
- given by <replaceable>where_definition</replaceable>, and
- returns the number of rows deleted.
+ For the single-table syntax, the <literal>DELETE</literal>
+ statement deletes rows from <replaceable>tbl_name</replaceable>
+ and returns the number of rows deleted. The
+ <literal>WHERE</literal> clause, if given, specifies the
+ conditions that identify which rows to delete. With no
+ <literal>WHERE</literal> clause, all rows are deleted. If the
+ <literal>ORDER BY</literal> clause is specified, the rows are
+ deleted in the order that is specified. The
+ <literal>LIMIT</literal> clause places a limit on the number of
+ rows that can be deleted.
</para>
<para>
- If you issue a <literal>DELETE</literal> statement with no
- <literal>WHERE</literal> clause, all rows are deleted. A faster
- way to do this, when you do not want to know the number of
- deleted rows, is to use <literal>TRUNCATE TABLE</literal>. See
+ For the multiple-table syntax, <literal>DELETE</literal> deletes
+ from each <replaceable>tbl_name</replaceable> the rows that
+ satisfy the conditions. In this case, <literal>ORDER
+ BY</literal> and <literal>LIMIT</literal> cannot be used.
+ </para>
+
+ <para>
+ <replaceable>where_condition</replaceable> is an expression that
+ evaluates to true for each row to be deleted. It is specified as
+ described in <xref linkend="select"/>.
+ </para>
+
+ <para>
+ As stated, a <literal>DELETE</literal> statement with no
+ <literal>WHERE</literal> clause deletes all rows. A faster way
+ to do this, when you do not want to know the number of deleted
+ rows, is to use <literal>TRUNCATE TABLE</literal>. See
<xref linkend="truncate"/>.
</para>
@@ -3818,7 +3837,7 @@
<para>
If you delete the row containing the maximum value for an
<literal>AUTO_INCREMENT</literal> column, the value is reused
- for a <literal>BDB</literal> table, but not for a
+ later for a <literal>BDB</literal> table, but not for a
<literal>MyISAM</literal> or <literal>InnoDB</literal> table. If
you delete all rows in the table with <literal>DELETE FROM
<replaceable>tbl_name</replaceable></literal> (without a
@@ -3848,9 +3867,9 @@
<listitem>
<para>
- If you specify <literal>LOW_PRIORITY</literal>, execution of
- the <literal>DELETE</literal> is delayed until no other
- clients are reading from the table.
+ If you specify <literal>LOW_PRIORITY</literal>, the server
+ delays execution of the <literal>DELETE</literal> until no
+ other clients are reading from the table.
</para>
</listitem>
@@ -3869,7 +3888,7 @@
all errors during the process of deleting rows. (Errors
encountered during the parsing stage are processed in the
usual manner.) Errors that are ignored due to the use of
- this option are returned as warnings.
+ <literal>OPTION</literal> are returned as warnings.
</para>
</listitem>
@@ -3889,7 +3908,7 @@
reorganize tables. <literal>OPTIMIZE TABLE</literal> is easier,
but <command>myisamchk</command> is faster. See
<xref linkend="optimize-table"/>, and
- <xref linkend="optimization"/>.
+ <xref linkend="myisamchk"/>.
</para>
<para>
@@ -3961,7 +3980,7 @@
<replaceable>row_count</replaceable></literal> option to
<literal>DELETE</literal> tells the server the maximum number of
rows to be deleted before control is returned to the client.
- This can be used to ensure that a specific
+ This can be used to ensure that a given
<literal>DELETE</literal> statement does not take too much time.
You can simply repeat the <literal>DELETE</literal> statement
until the number of affected rows is less than the
@@ -3980,34 +3999,31 @@
</para>
<programlisting>
-DELETE FROM somelog
-WHERE user = 'jcole'
-ORDER BY timestamp_column
-LIMIT 1;
+DELETE FROM somelog WHERE user = 'jcole'
+ORDER BY timestamp_column LIMIT 1;
</programlisting>
<para>
You can specify multiple tables in a <literal>DELETE</literal>
- statement to delete rows from one or more tables depending on a
- particular condition in multiple tables. However, you cannot use
- <literal>ORDER BY</literal> or <literal>LIMIT</literal> in a
- multiple-table <literal>DELETE</literal>.
- </para>
-
- <para>
- The <replaceable>table_references</replaceable> part lists the
+ statement to delete rows from one or more tables depending on
+ the particular condition in the <literal>WHERE</literal> clause.
+ However, you cannot use <literal>ORDER BY</literal> or
+ <literal>LIMIT</literal> in a multiple-table
+ <literal>DELETE</literal>. The
+ <replaceable>table_references</replaceable> clause lists the
tables involved in the join. Its syntax is described in
<xref linkend="join"/>.
</para>
<para>
- For the first syntax, only matching rows from the tables listed
- before the <literal>FROM</literal> clause are deleted. For the
- second syntax, only matching rows from the tables listed in the
- <literal>FROM</literal> clause (before the
- <literal>USING</literal> clause) are deleted. The effect is that
- you can delete rows from many tables at the same time and have
- additional tables that are used for searching:
+ For the first multiple-table syntax, only matching rows from the
+ tables listed before the <literal>FROM</literal> clause are
+ deleted. For the second multiple-table syntax, only matching
+ rows from the tables listed in the <literal>FROM</literal>
+ clause (before the <literal>USING</literal> clause) are deleted.
+ The effect is that you can delete rows from many tables at the
+ same time and have additional tables that are used only for
+ searching:
</para>
<programlisting>
@@ -4054,8 +4070,8 @@
</para>
<para>
- <emphasis role="bold">Note</emphasis>: You must use the alias
- (if one was given) when referring to a table name:
+ <emphasis role="bold">Note</emphasis>: If you provide an alias
+ for a table, you must use the alias when referring to the table:
</para>
<programlisting>
@@ -6550,10 +6566,10 @@
[SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]
<replaceable>select_expr</replaceable>, ...
[FROM <replaceable>table_references</replaceable>
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
[GROUP BY {<replaceable>col_name</replaceable> | <replaceable>expr</replaceable> | <replaceable>position</replaceable>}
[ASC | DESC], ... [WITH ROLLUP]]
- [HAVING <replaceable>where_definition</replaceable>]
+ [HAVING <replaceable>where_condition</replaceable>]
[ORDER BY {<replaceable>col_name</replaceable> | <replaceable>expr</replaceable> | <replaceable>position</replaceable>}
[ASC | DESC] , ...]
[LIMIT {[<replaceable>offset</replaceable>,] <replaceable>row_count</replaceable> | <replaceable>row_count</replaceable> OFFSET <replaceable>offset</replaceable>}]
@@ -6591,7 +6607,7 @@
<listitem>
<para>
- <replaceable>where_definition</replaceable> consists of the
+ <replaceable>where_condition</replaceable> consists of the
keyword <literal>WHERE</literal> followed by an expression
that indicates the condition or conditions that rows must
satisfy to be selected.
@@ -9785,7 +9801,7 @@
<programlisting>
UPDATE [LOW_PRIORITY] [IGNORE] <replaceable>tbl_name</replaceable>
SET <replaceable>col_name1</replaceable>=<replaceable>expr1</replaceable> [, <replaceable>col_name2</replaceable>=<replaceable>expr2</replaceable> ...]
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
[ORDER BY ...]
[LIMIT <replaceable>row_count</replaceable>]
</programlisting>
@@ -9797,7 +9813,7 @@
<programlisting>
UPDATE [LOW_PRIORITY] [IGNORE] <replaceable>table_references</replaceable>
SET <replaceable>col_name1</replaceable>=<replaceable>expr1</replaceable> [, <replaceable>col_name2</replaceable>=<replaceable>expr2</replaceable> ...]
- [WHERE <replaceable>where_definition</replaceable>]
+ [WHERE <replaceable>where_condition</replaceable>]
</programlisting>
<remark role="help-syntax-end"/>
@@ -9805,18 +9821,35 @@
<remark role="help-description-begin"/>
<para>
- The <literal>UPDATE</literal> statement updates columns in
- existing table rows with new values. The <literal>SET</literal>
- clause indicates which columns to modify and the values they
- should be given. The <literal>WHERE</literal> clause, if given,
- specifies which rows should be updated. Otherwise, all rows are
- updated. If the <literal>ORDER BY</literal> clause is specified,
- the rows are updated in the order that is specified. The
+ For the single-table syntax, the <literal>UPDATE</literal>
+ statement updates columns of existing rows in
+ <literal>tbl_name</literal> with new values. The
+ <literal>SET</literal> clause indicates which columns to modify
+ and the values they should be given. The
+ <literal>WHERE</literal> clause, if given, specifies the
+ conditions that identify which rows to update. With no
+ <literal>WHERE</literal> clause, all rows are updated. If the
+ <literal>ORDER BY</literal> clause is specified, the rows are
+ updated in the order that is specified. The
<literal>LIMIT</literal> clause places a limit on the number of
rows that can be updated.
</para>
<para>
+ For the multiple-table syntax, <literal>UPDATE</literal> updates
+ rows in each table named in
+ <replaceable>table_references</replaceable> that satisfy the
+ conditions. In this case, <literal>ORDER BY</literal> and
+ <literal>LIMIT</literal> cannot be used.
+ </para>
+
+ <para>
+ <replaceable>where_condition</replaceable> is an expression that
+ evaluates to true for each row to be updated. It is specified as
+ described in <xref linkend="select"/>.
+ </para>
+
+ <para>
The <literal>UPDATE</literal> statement supports the following
modifiers:
</para>
@@ -9855,7 +9888,7 @@
</para>
<programlisting>
-mysql> <userinput>UPDATE persondata SET age=age+1;</userinput>
+UPDATE persondata SET age=age+1;
</programlisting>
<para>
@@ -9865,7 +9898,7 @@
</para>
<programlisting>
-mysql> <userinput>UPDATE persondata SET age=age*2, age=age+1;</userinput>
+UPDATE persondata SET age=age*2, age=age+1;
</programlisting>
<para>
@@ -9914,7 +9947,9 @@
<para>
You can also perform <literal>UPDATE</literal> operations
- covering multiple tables. The
+ covering multiple tables. However, you cannot use <literal>ORDER
+ BY</literal> or <literal>LIMIT</literal> with a multiple-table
+ <literal>UPDATE</literal>. The
<replaceable>table_references</replaceable> clause lists the
tables involved in the join. Its syntax is described in
<xref linkend="join"/>. Here is an example:
@@ -9934,13 +9969,6 @@
</para>
<para>
- <emphasis role="bold">Note</emphasis>: You
- <emphasis>cannot</emphasis> use <literal>ORDER BY</literal> or
- <literal>LIMIT</literal> with a multiple-table
- <literal>UPDATE</literal>.
- </para>
-
- <para>
You need the <literal>UPDATE</literal> privilege only for
columns referenced in a multiple-table <literal>UPDATE</literal>
that are actually updated. You need only the
Modified: trunk/refman-common/titles.en.ent
===================================================================
--- trunk/refman-common/titles.en.ent 2006-01-27 15:40:55 UTC (rev 1060)
+++ trunk/refman-common/titles.en.ent 2006-01-27 15:41:17 UTC (rev 1061)
@@ -311,7 +311,7 @@
<!ENTITY title-delete-speed "Speed of <literal>DELETE</literal> Statements">
<!ENTITY title-deleted-problem "When I Insert or Update a Record in Linked Tables, I Get <literal>#DELETED#</literal>">
<!ENTITY title-deleting-from-related-tables "Deleting Rows from Related Tables">
-<!ENTITY title-describe "<literal>DESCRIBE</literal> Syntax (Get Information About Columns)">
+<!ENTITY title-describe "<literal>DESCRIBE</literal> Syntax">
<!ENTITY title-design "Design Choices">
<!ENTITY title-design-limitations "MySQL Design Limitations and Tradeoffs">
<!ENTITY title-developers "Developers at MySQL AB">
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r1061 - in trunk: . refman-4.1 refman-5.0 refman-5.1 refman-common | paul | 27 Jan |