Author: paul
Date: 2006-01-27 16:40:55 +0100 (Fri, 27 Jan 2006)
New Revision: 1060
Log:
r6742@frost: paul | 2006-01-27 08:27:58 -0600
General revisions.
Modified:
trunk/
trunk/refman-4.1/sql-syntax.xml
trunk/refman-5.0/sql-syntax.xml
trunk/refman-5.1/sql-syntax.xml
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:6740
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:2564
+ b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:6742
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:2564
Modified: trunk/refman-4.1/sql-syntax.xml
===================================================================
--- trunk/refman-4.1/sql-syntax.xml 2006-01-27 14:11:52 UTC (rev 1059)
+++ trunk/refman-4.1/sql-syntax.xml 2006-01-27 15:40:55 UTC (rev 1060)
@@ -3081,7 +3081,8 @@
<literal>old_table</literal>, you can create another table
<literal>new_table</literal> that has the same structure but is
empty, and then replace the existing table with the empty one as
- follows:
+ follows (assuming that <literal>backup_table</literal> does not
+ already exist):
</para>
<remark role="help-description-end"/>
@@ -3089,26 +3090,27 @@
<remark role="help-example"/>
<programlisting>
-CREATE TABLE <replaceable>new_table</replaceable> (...);
-RENAME TABLE <replaceable>old_table</replaceable> TO <replaceable>backup_table</replaceable>, <replaceable>new_table</replaceable> TO <replaceable>old_table</replaceable>;
+CREATE TABLE new_table (...);
+RENAME TABLE old_table TO backup_table, new_table TO old_table;
</programlisting>
<para>
If the statement renames more than one table, renaming
operations are done from left to right. If you want to swap two
- table names, you can do so like this (assuming that no table
- named <literal>tmp_table</literal> already exists):
+ table names, you can do so like this (assuming that
+ <literal>tmp_table</literal> does not already exist):
</para>
<programlisting>
-RENAME TABLE <replaceable>old_table</replaceable> TO <replaceable>tmp_table</replaceable>,
- <replaceable>new_table</replaceable> TO <replaceable>old_table</replaceable>,
- <replaceable>tmp_table</replaceable> TO <replaceable>new_table</replaceable>;
+RENAME TABLE old_table TO tmp_table,
+ new_table TO old_table,
+ tmp_table TO new_table;
</programlisting>
<para>
- As long as two databases are on the same filesystem you can also
- rename a table to move it from one database to another:
+ As long as two databases are on the same filesystem, you can use
+ <literal>RENAME TABLE</literal> to move a table from one
+ database to another:
</para>
<programlisting>
@@ -3612,8 +3614,8 @@
other threads and is not closed until the thread calls
<literal>HANDLER ... CLOSE</literal> or the thread terminates.
If you open the table using an alias, further references to the
- table with other <literal>HANDLER</literal> statements must use
- the alias rather than the table name.
+ open table with other <literal>HANDLER</literal> statements must
+ use the alias rather than the table name.
</para>
<para>
@@ -3623,21 +3625,31 @@
multiple-column index, specify the index column values as a
comma-separated list. Either specify values for all the columns
in the index, or specify values for a leftmost prefix of the
- index columns. Suppose that an index includes three columns
- named <literal>col_a</literal>, <literal>col_b</literal>, and
- <literal>col_c</literal>, in that order. The
- <literal>HANDLER</literal> statement can specify values for all
- three columns in the index, or for the columns in a leftmost
- prefix. For example:
+ index columns. Suppose that an index <literal>my_idx</literal>
+ includes three columns named <literal>col_a</literal>,
+ <literal>col_b</literal>, and <literal>col_c</literal>, in that
+ order. The <literal>HANDLER</literal> statement can specify
+ values for all three columns in the index, or for the columns in
+ a leftmost prefix. For example:
</para>
<programlisting>
-HANDLER ... <replaceable>index_name</replaceable> = (col_a_val,col_b_val,col_c_val) ...
-HANDLER ... <replaceable>index_name</replaceable> = (col_a_val,col_b_val) ...
-HANDLER ... <replaceable>index_name</replaceable> = (col_a_val) ...
+HANDLER ... READ my_idx = (col_a_val,col_b_val,col_c_val) ...
+HANDLER ... READ my_idx = (col_a_val,col_b_val) ...
+HANDLER ... READ my_idx = (col_a_val) ...
</programlisting>
<para>
+ To employ the <literal>HANDLER</literal> interface to refer to a
+ table's <literal>PRIMARY KEY</literal>, use the quoted
+ identifier <literal>`PRIMARY`</literal>:
+ </para>
+
+<programlisting>
+HANDLER <replaceable>tbl_name</replaceable> READ `PRIMARY` ...
+</programlisting>
+
+ <para>
The second <literal>HANDLER ... READ</literal> syntax fetches a
row from the table in index order that matches the
<literal>WHERE</literal> condition.
@@ -3648,11 +3660,12 @@
row from the table in natural row order that matches the
<literal>WHERE</literal> condition. It is faster than
<literal>HANDLER <replaceable>tbl_name</replaceable> READ
- index_name</literal> when a full table scan is desired. Natural
- row order is the order in which rows are stored in a
- <literal>MyISAM</literal> table data file. This statement works
- for <literal>InnoDB</literal> tables as well, but there is no
- such concept because there is no separate data file.
+ <replaceable>index_name</replaceable></literal> when a full
+ table scan is desired. Natural row order is the order in which
+ rows are stored in a <literal>MyISAM</literal> table data file.
+ This statement works for <literal>InnoDB</literal> tables as
+ well, but there is no such concept because there is no separate
+ data file.
</para>
<para>
@@ -3670,26 +3683,16 @@
</para>
<para>
- <emphasis>Note</emphasis>: To employ the
- <literal>HANDLER</literal> interface to refer to a table's
- <literal>PRIMARY KEY</literal>, use the quoted identifier
- <literal>`PRIMARY`</literal>:
- </para>
-
-<programlisting>
-HANDLER <replaceable>tbl_name</replaceable> READ `PRIMARY` > (...);
-</programlisting>
-
- <para>
<literal>HANDLER</literal> is a somewhat low-level statement.
For example, it does not provide consistency. That is,
<literal>HANDLER ... OPEN</literal> does
<emphasis>not</emphasis> take a snapshot of the table, and does
<emphasis>not</emphasis> lock the table. This means that after a
<literal>HANDLER ... OPEN</literal> statement is issued, table
- data can be modified (by this or any other thread) and these
- modifications might appear only partially in <literal>HANDLER
- ... NEXT</literal> or <literal>HANDLER ... PREV</literal> scans.
+ data can be modified (by the current thread or other threads)
+ and these modifications might be only partially visible to
+ <literal>HANDLER ... NEXT</literal> or <literal>HANDLER ...
+ PREV</literal> scans.
</para>
<para>
@@ -3752,9 +3755,10 @@
<listitem>
<para>
- <literal>HANDLER</literal> makes it much easier to port
- applications that use an <literal>ISAM</literal>-like
- interface to MySQL.
+ For applications that use a low-level
+ <literal>ISAM</literal>-like interface,
+ <literal>HANDLER</literal> makes it much easier to port them
+ to MySQL.
</para>
</listitem>
Modified: trunk/refman-5.0/sql-syntax.xml
===================================================================
--- trunk/refman-5.0/sql-syntax.xml 2006-01-27 14:11:52 UTC (rev 1059)
+++ trunk/refman-5.0/sql-syntax.xml 2006-01-27 15:40:55 UTC (rev 1060)
@@ -3071,7 +3071,8 @@
<literal>old_table</literal>, you can create another table
<literal>new_table</literal> that has the same structure but is
empty, and then replace the existing table with the empty one as
- follows:
+ follows (assuming that <literal>backup_table</literal> does not
+ already exist):
</para>
<remark role="help-description-end"/>
@@ -3079,26 +3080,27 @@
<remark role="help-example"/>
<programlisting>
-CREATE TABLE <replaceable>new_table</replaceable> (...);
-RENAME TABLE <replaceable>old_table</replaceable> TO <replaceable>backup_table</replaceable>, <replaceable>new_table</replaceable> TO <replaceable>old_table</replaceable>;
+CREATE TABLE new_table (...);
+RENAME TABLE old_table TO backup_table, new_table TO old_table;
</programlisting>
<para>
If the statement renames more than one table, renaming
operations are done from left to right. If you want to swap two
- table names, you can do so like this (assuming that no table
- named <literal>tmp_table</literal> already exists):
+ table names, you can do so like this (assuming that
+ <literal>tmp_table</literal> does not already exist):
</para>
<programlisting>
-RENAME TABLE <replaceable>old_table</replaceable> TO <replaceable>tmp_table</replaceable>,
- <replaceable>new_table</replaceable> TO <replaceable>old_table</replaceable>,
- <replaceable>tmp_table</replaceable> TO <replaceable>new_table</replaceable>;
+RENAME TABLE old_table TO tmp_table,
+ new_table TO old_table,
+ tmp_table TO new_table;
</programlisting>
<para>
- As long as two databases are on the same filesystem you can also
- rename a table to move it from one database to another:
+ As long as two databases are on the same filesystem, you can use
+ <literal>RENAME TABLE</literal> to move a table from one
+ database to another:
</para>
<programlisting>
@@ -3106,6 +3108,12 @@
</programlisting>
<para>
+ As of MySQL 5.0.14, <literal>RENAME TABLE</literal> also works
+ for views, as long as you do not try to rename a view into a
+ different database.
+ </para>
+
+ <para>
When you execute <literal>RENAME</literal>, you cannot have any
locked tables or active transactions. You must also have the
<literal>ALTER</literal> and <literal>DROP</literal> privileges
@@ -3119,11 +3127,6 @@
everything to its original state.
</para>
- <para>
- As of MySQL 5.0.14, <literal>RENAME TABLE</literal> also works
- for views, as long as you do not try to rename a view into a
- different database.
- </para>
</section>
@@ -3548,8 +3551,8 @@
other threads and is not closed until the thread calls
<literal>HANDLER ... CLOSE</literal> or the thread terminates.
If you open the table using an alias, further references to the
- table with other <literal>HANDLER</literal> statements must use
- the alias rather than the table name.
+ open table with other <literal>HANDLER</literal> statements must
+ use the alias rather than the table name.
</para>
<para>
@@ -3559,21 +3562,31 @@
multiple-column index, specify the index column values as a
comma-separated list. Either specify values for all the columns
in the index, or specify values for a leftmost prefix of the
- index columns. Suppose that an index includes three columns
- named <literal>col_a</literal>, <literal>col_b</literal>, and
- <literal>col_c</literal>, in that order. The
- <literal>HANDLER</literal> statement can specify values for all
- three columns in the index, or for the columns in a leftmost
- prefix. For example:
+ index columns. Suppose that an index <literal>my_idx</literal>
+ includes three columns named <literal>col_a</literal>,
+ <literal>col_b</literal>, and <literal>col_c</literal>, in that
+ order. The <literal>HANDLER</literal> statement can specify
+ values for all three columns in the index, or for the columns in
+ a leftmost prefix. For example:
</para>
<programlisting>
-HANDLER ... <replaceable>index_name</replaceable> = (col_a_val,col_b_val,col_c_val) ...
-HANDLER ... <replaceable>index_name</replaceable> = (col_a_val,col_b_val) ...
-HANDLER ... <replaceable>index_name</replaceable> = (col_a_val) ...
+HANDLER ... READ my_idx = (col_a_val,col_b_val,col_c_val) ...
+HANDLER ... READ my_idx = (col_a_val,col_b_val) ...
+HANDLER ... READ my_idx = (col_a_val) ...
</programlisting>
<para>
+ To employ the <literal>HANDLER</literal> interface to refer to a
+ table's <literal>PRIMARY KEY</literal>, use the quoted
+ identifier <literal>`PRIMARY`</literal>:
+ </para>
+
+<programlisting>
+HANDLER <replaceable>tbl_name</replaceable> READ `PRIMARY` ...
+</programlisting>
+
+ <para>
The second <literal>HANDLER ... READ</literal> syntax fetches a
row from the table in index order that matches the
<literal>WHERE</literal> condition.
@@ -3584,11 +3597,12 @@
row from the table in natural row order that matches the
<literal>WHERE</literal> condition. It is faster than
<literal>HANDLER <replaceable>tbl_name</replaceable> READ
- index_name</literal> when a full table scan is desired. Natural
- row order is the order in which rows are stored in a
- <literal>MyISAM</literal> table data file. This statement works
- for <literal>InnoDB</literal> tables as well, but there is no
- such concept because there is no separate data file.
+ <replaceable>index_name</replaceable></literal> when a full
+ table scan is desired. Natural row order is the order in which
+ rows are stored in a <literal>MyISAM</literal> table data file.
+ This statement works for <literal>InnoDB</literal> tables as
+ well, but there is no such concept because there is no separate
+ data file.
</para>
<para>
@@ -3606,26 +3620,16 @@
</para>
<para>
- <emphasis>Note</emphasis>: To employ the
- <literal>HANDLER</literal> interface to refer to a table's
- <literal>PRIMARY KEY</literal>, use the quoted identifier
- <literal>`PRIMARY`</literal>:
- </para>
-
-<programlisting>
-HANDLER <replaceable>tbl_name</replaceable> READ `PRIMARY` > (...);
-</programlisting>
-
- <para>
<literal>HANDLER</literal> is a somewhat low-level statement.
For example, it does not provide consistency. That is,
<literal>HANDLER ... OPEN</literal> does
<emphasis>not</emphasis> take a snapshot of the table, and does
<emphasis>not</emphasis> lock the table. This means that after a
<literal>HANDLER ... OPEN</literal> statement is issued, table
- data can be modified (by this or any other thread) and these
- modifications might appear only partially in <literal>HANDLER
- ... NEXT</literal> or <literal>HANDLER ... PREV</literal> scans.
+ data can be modified (by the current thread or other threads)
+ and these modifications might be only partially visible to
+ <literal>HANDLER ... NEXT</literal> or <literal>HANDLER ...
+ PREV</literal> scans.
</para>
<para>
@@ -3688,9 +3692,10 @@
<listitem>
<para>
- <literal>HANDLER</literal> makes it much easier to port
- applications that use an <literal>ISAM</literal>-like
- interface to MySQL.
+ For applications that use a low-level
+ <literal>ISAM</literal>-like interface,
+ <literal>HANDLER</literal> makes it much easier to port them
+ to MySQL.
</para>
</listitem>
Modified: trunk/refman-5.1/sql-syntax.xml
===================================================================
--- trunk/refman-5.1/sql-syntax.xml 2006-01-27 14:11:52 UTC (rev 1059)
+++ trunk/refman-5.1/sql-syntax.xml 2006-01-27 15:40:55 UTC (rev 1060)
@@ -3680,7 +3680,8 @@
<literal>old_table</literal>, you can create another table
<literal>new_table</literal> that has the same structure but is
empty, and then replace the existing table with the empty one as
- follows:
+ follows (assuming that <literal>backup_table</literal> does not
+ already exist):
</para>
<remark role="help-description-end"/>
@@ -3688,26 +3689,27 @@
<remark role="help-example"/>
<programlisting>
-CREATE TABLE <replaceable>new_table</replaceable> (...);
-RENAME TABLE <replaceable>old_table</replaceable> TO <replaceable>backup_table</replaceable>, <replaceable>new_table</replaceable> TO <replaceable>old_table</replaceable>;
+CREATE TABLE new_table (...);
+RENAME TABLE old_table TO backup_table, new_table TO old_table;
</programlisting>
<para>
If the statement renames more than one table, renaming
operations are done from left to right. If you want to swap two
- table names, you can do so like this (assuming that no table
- named <literal>tmp_table</literal> already exists):
+ table names, you can do so like this (assuming that
+ <literal>tmp_table</literal> does not already exist):
</para>
<programlisting>
-RENAME TABLE <replaceable>old_table</replaceable> TO <replaceable>tmp_table</replaceable>,
- <replaceable>new_table</replaceable> TO <replaceable>old_table</replaceable>,
- <replaceable>tmp_table</replaceable> TO <replaceable>new_table</replaceable>;
+RENAME TABLE old_table TO tmp_table,
+ new_table TO old_table,
+ tmp_table TO new_table;
</programlisting>
<para>
- As long as two databases are on the same filesystem you can also
- rename a table to move it from one database to another:
+ As long as two databases are on the same filesystem, you can use
+ <literal>RENAME TABLE</literal> to move a table from one
+ database to another:
</para>
<programlisting>
@@ -3715,6 +3717,11 @@
</programlisting>
<para>
+ <literal>RENAME TABLE</literal> also works for views, as long as
+ you do not try to rename a view into a different database.
+ </para>
+
+ <para>
When you execute <literal>RENAME</literal>, you cannot have any
locked tables or active transactions. You must also have the
<literal>ALTER</literal> and <literal>DROP</literal> privileges
@@ -3728,11 +3735,6 @@
everything to its original state.
</para>
- <para>
- <literal>RENAME TABLE</literal> also works for views, as long as
- you do not try to rename a view into a different database.
- </para>
-
</section>
</section>
@@ -4156,8 +4158,8 @@
other threads and is not closed until the thread calls
<literal>HANDLER ... CLOSE</literal> or the thread terminates.
If you open the table using an alias, further references to the
- table with other <literal>HANDLER</literal> statements must use
- the alias rather than the table name.
+ open table with other <literal>HANDLER</literal> statements must
+ use the alias rather than the table name.
</para>
<para>
@@ -4167,21 +4169,31 @@
multiple-column index, specify the index column values as a
comma-separated list. Either specify values for all the columns
in the index, or specify values for a leftmost prefix of the
- index columns. Suppose that an index includes three columns
- named <literal>col_a</literal>, <literal>col_b</literal>, and
- <literal>col_c</literal>, in that order. The
- <literal>HANDLER</literal> statement can specify values for all
- three columns in the index, or for the columns in a leftmost
- prefix. For example:
+ index columns. Suppose that an index <literal>my_idx</literal>
+ includes three columns named <literal>col_a</literal>,
+ <literal>col_b</literal>, and <literal>col_c</literal>, in that
+ order. The <literal>HANDLER</literal> statement can specify
+ values for all three columns in the index, or for the columns in
+ a leftmost prefix. For example:
</para>
<programlisting>
-HANDLER ... <replaceable>index_name</replaceable> = (col_a_val,col_b_val,col_c_val) ...
-HANDLER ... <replaceable>index_name</replaceable> = (col_a_val,col_b_val) ...
-HANDLER ... <replaceable>index_name</replaceable> = (col_a_val) ...
+HANDLER ... READ my_idx = (col_a_val,col_b_val,col_c_val) ...
+HANDLER ... READ my_idx = (col_a_val,col_b_val) ...
+HANDLER ... READ my_idx = (col_a_val) ...
</programlisting>
<para>
+ To employ the <literal>HANDLER</literal> interface to refer to a
+ table's <literal>PRIMARY KEY</literal>, use the quoted
+ identifier <literal>`PRIMARY`</literal>:
+ </para>
+
+<programlisting>
+HANDLER <replaceable>tbl_name</replaceable> READ `PRIMARY` ...
+</programlisting>
+
+ <para>
The second <literal>HANDLER ... READ</literal> syntax fetches a
row from the table in index order that matches the
<literal>WHERE</literal> condition.
@@ -4192,11 +4204,12 @@
row from the table in natural row order that matches the
<literal>WHERE</literal> condition. It is faster than
<literal>HANDLER <replaceable>tbl_name</replaceable> READ
- index_name</literal> when a full table scan is desired. Natural
- row order is the order in which rows are stored in a
- <literal>MyISAM</literal> table data file. This statement works
- for <literal>InnoDB</literal> tables as well, but there is no
- such concept because there is no separate data file.
+ <replaceable>index_name</replaceable></literal> when a full
+ table scan is desired. Natural row order is the order in which
+ rows are stored in a <literal>MyISAM</literal> table data file.
+ This statement works for <literal>InnoDB</literal> tables as
+ well, but there is no such concept because there is no separate
+ data file.
</para>
<para>
@@ -4214,26 +4227,16 @@
</para>
<para>
- <emphasis>Note</emphasis>: To employ the
- <literal>HANDLER</literal> interface to refer to a table's
- <literal>PRIMARY KEY</literal>, use the quoted identifier
- <literal>`PRIMARY`</literal>:
- </para>
-
-<programlisting>
-HANDLER <replaceable>tbl_name</replaceable> READ `PRIMARY` > (...);
-</programlisting>
-
- <para>
<literal>HANDLER</literal> is a somewhat low-level statement.
For example, it does not provide consistency. That is,
<literal>HANDLER ... OPEN</literal> does
<emphasis>not</emphasis> take a snapshot of the table, and does
<emphasis>not</emphasis> lock the table. This means that after a
<literal>HANDLER ... OPEN</literal> statement is issued, table
- data can be modified (by this or any other thread) and these
- modifications might appear only partially in <literal>HANDLER
- ... NEXT</literal> or <literal>HANDLER ... PREV</literal> scans.
+ data can be modified (by the current thread or other threads)
+ and these modifications might be only partially visible to
+ <literal>HANDLER ... NEXT</literal> or <literal>HANDLER ...
+ PREV</literal> scans.
</para>
<para>
@@ -4296,9 +4299,10 @@
<listitem>
<para>
- <literal>HANDLER</literal> makes it much easier to port
- applications that use an <literal>ISAM</literal>-like
- interface to MySQL.
+ For applications that use a low-level
+ <literal>ISAM</literal>-like interface,
+ <literal>HANDLER</literal> makes it much easier to port them
+ to MySQL.
</para>
</listitem>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r1060 - in trunk: . refman-4.1 refman-5.0 refman-5.1 | paul | 27 Jan |