Below is the list of changes that have just been committed into a local
mysqldoc repository of paul. When paul does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://www.mysql.com/doc/I/n/Installing_source_tree.html
ChangeSet
1.3000 05/07/12 13:37:25 paul@stripped +3 -0
Format.
refman/tutorial.xml
1.5 05/07/12 13:37:24 paul@stripped +57 -59
Format.
refman-5.0/tutorial.xml
1.7 05/07/12 13:37:24 paul@stripped +173 -177
Format.
refman-4.1/tutorial.xml
1.5 05/07/12 13:37:24 paul@stripped +57 -58
Format.
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: paul
# Host: kite-hub.kitebird.com
# Root: /src/extern/MySQL/bk/mysqldoc
--- 1.4/refman-4.1/tutorial.xml 2005-07-12 13:34:42 -05:00
+++ 1.5/refman-4.1/tutorial.xml 2005-07-12 13:37:24 -05:00
@@ -3467,54 +3467,53 @@
See also <xref linkend="ansi-diff-foreign-keys"/>.
</para>
- <para>
- A foreign key constraint is not required merely to join two
- tables. For table types other than <literal>InnoDB</literal>, it
- is possible when defining a column to use a <literal>REFERENCES
- <replaceable>tbl_name</replaceable>(<replaceable>col_name</replaceable>)</literal> clause,
- which has no actual effect, and <emphasis>serves only as a
- memo or comment to you that the column which you are currently
- defining is intended to refer to a column in another
- table</emphasis>. It is extremely important to realize when
- using this syntax that:
- </para>
-
- <itemizedlist>
-
- <listitem><para>
- MySQL does not perform any sort of <literal>CHECK</literal> to
- make sure that <replaceable>col_name</replaceable> actually
- exists in <replaceable>tbl_name</replaceable> (or even that
- <replaceable>tbl_name</replaceable> itself exists).
- </para></listitem>
-
- <listitem><para>
- MySQL does not perform any sort of action on
- <replaceable>tbl_name</replaceable> such as deleting rows in
- response to actions taken on rows in the table which you are
- defining; in other words, this syntax induces no <literal>ON
- DELETE</literal> or <literal>ON UPDATE</literal> behaviour
- whatsoever. (While you can write an <literal>ON
- DELETE</literal> or <literal>ON UPDATE</literal> clause as
- part of the <literal>REFERENCES</literal> clause, it is also
- ignored.)
- </para></listitem>
-
- <listitem><para>
- This syntax creates a <emphasis>column</emphasis>; it does
- <emphasis role="bold">not</emphasis> create any sort of index
- or key.
- </para></listitem>
-
- <listitem><para>
- This syntax will cause an error if used in trying to define an
- <literal>InnoDB</literal> table.
- </para></listitem>
-
- </itemizedlist>
-
<para>
- You can use a column so created as a join column, as shown here:
+ A foreign key constraint is not required merely to join two tables.
+ For table types other than <literal>InnoDB</literal>, it is possible
+ when defining a column to use a <literal>REFERENCES
+ <replaceable>tbl_name</replaceable>(<replaceable>col_name</replaceable>)</literal>
+ clause, which has no actual effect, and <emphasis>serves only as a
+ memo or comment to you that the column which you are currently
+ defining is intended to refer to a column in another
+ table</emphasis>. It is extremely important to realize when using
+ this syntax that:
+ </para>
+
+ <itemizedlist>
+
+ <listitem><para>
+ MySQL does not perform any sort of <literal>CHECK</literal> to make
+ sure that <replaceable>col_name</replaceable> actually exists in
+ <replaceable>tbl_name</replaceable> (or even that
+ <replaceable>tbl_name</replaceable> itself exists).
+ </para></listitem>
+
+ <listitem><para>
+ MySQL does not perform any sort of action on
+ <replaceable>tbl_name</replaceable> such as deleting rows in
+ response to actions taken on rows in the table which you are
+ defining; in other words, this syntax induces no <literal>ON
+ DELETE</literal> or <literal>ON UPDATE</literal> behaviour
+ whatsoever. (While you can write an <literal>ON DELETE</literal> or
+ <literal>ON UPDATE</literal> clause as part of the
+ <literal>REFERENCES</literal> clause, it is also ignored.)
+ </para></listitem>
+
+ <listitem><para>
+ This syntax creates a <emphasis>column</emphasis>; it does
+ <emphasis role="bold">not</emphasis> create any sort of index or
+ key.
+ </para></listitem>
+
+ <listitem><para>
+ This syntax will cause an error if used in trying to define an
+ <literal>InnoDB</literal> table.
+ </para></listitem>
+
+ </itemizedlist>
+
+ <para>
+ You can use a column so created as a join column, as shown here:
</para>
<programlisting>
@@ -3587,11 +3586,11 @@
+----+-------+--------+-------+
</programlisting>
- <para>
- When used in this fashion, the <literal>REFERENCES</literal>
- clause is not displayed in the output of <literal>SHOW CREATE
- TABLE</literal> or <literal>DESCRIBE</literal>:
- </para>
+ <para>
+ When used in this fashion, the <literal>REFERENCES</literal> clause
+ is not displayed in the output of <literal>SHOW CREATE
+ TABLE</literal> or <literal>DESCRIBE</literal>:
+ </para>
<programlisting>
SHOW CREATE TABLE shirt\G
@@ -3606,12 +3605,12 @@
) ENGINE=MyISAM DEFAULT CHARSET=latin1
</programlisting>
- <para>
- The use of <literal>REFERENCES</literal> in this way as a
- comment or "reminder" in a column definition works
- with both <literal>MyISAM</literal> and
- <literal>BerkeleyDB</literal> tables.
- </para>
+ <para>
+ The use of <literal>REFERENCES</literal> in this way as a comment or
+ "reminder" in a column definition works with both
+ <literal>MyISAM</literal> and <literal>BerkeleyDB</literal> tables.
+ </para>
+
</section>
<section id="searching-on-two-keys">
--- 1.6/refman-5.0/tutorial.xml 2005-07-12 13:34:42 -05:00
+++ 1.7/refman-5.0/tutorial.xml 2005-07-12 13:37:24 -05:00
@@ -315,7 +315,7 @@
</programlisting>
<para>
- A command need not be given all on a single line, so that lengthy
+ A command need not be given all on a single line, so that lengthy
commands requiring several lines are not a problem.
<command>mysql</command> determines where your statement ends by
looking for the terminating semicolon, not by looking for the end of
@@ -345,15 +345,15 @@
In this example, notice how the prompt changes from
<literal>mysql></literal> to <literal>-></literal> after you
enter the first line of a multiple-line query. This is how
- <command>mysql</command> indicates that it has not yet seen a
- complete statement and is waiting for the rest. The prompt is your
- friend, because it provides valuable feedback. If you use that
- feedback, you can always be aware of what <command>mysql</command>
- is waiting for.
+ <command>mysql</command> indicates that it has not yet seen a
+ complete statement and is waiting for the rest. The prompt is your
+ friend, because it provides valuable feedback. If you use that
+ feedback, you can always be aware of what <command>mysql</command> is
+ waiting for.
</para>
<para>
- If you decide you do not want to execute a command that you are in
+ If you decide you do not want to execute a command that you are in
the process of entering, cancel it by typing <literal>\c</literal>:
</para>
@@ -416,7 +416,7 @@
<literal> '></literal>
</entry>
<entry>
- Waiting for next line, waiting for completion of a string
+ Waiting for next line, waiting for completion of a string
that began with a single quote ('<literal>'</literal>').
</entry>
</row>
@@ -425,9 +425,8 @@
<literal> "></literal>
</entry>
<entry>
- Waiting for next line, waiting for completion of a string
- that began with a double quote
- ('<literal>"</literal>').
+ Waiting for next line, waiting for completion of a string
+ that began with a double quote ('<literal>"</literal>').
</entry>
</row>
<row>
@@ -435,9 +434,9 @@
<literal> `></literal>
</entry>
<entry>
- Waiting for next line, waiting for completion of an
- identifier that began with a backtick
- ('<literal>`</literal>').
+ Waiting for next line, waiting for completion of an
+ identifier that began with a backtick
+ ('<literal>`</literal>').
</entry>
</row>
<row>
@@ -445,8 +444,8 @@
<literal> /*></literal>
</entry>
<entry>
- Waiting for next line, waiting for completion of a comment
- that began with <literal>/*</literal>.
+ Waiting for next line, waiting for completion of a comment
+ that began with <literal>/*</literal>.
</entry>
</row>
</tbody>
@@ -454,7 +453,7 @@
</informaltable>
<para>
- In the MySQL 5.0 series, the <literal>/*></literal> prompt was
+ In the MySQL 5.0 series, the <literal>/*></literal> prompt was
implemented in MySQL 5.0.6.
</para>
@@ -490,19 +489,19 @@
</programlisting>
<para>
- The <literal>'></literal> and <literal>"></literal> prompts
- occur during string collection (another way of saying that MySQL is
- waiting for completion of a string). In MySQL, you can write strings
- surrounded by either '<literal>'</literal>' or
- '<literal>"</literal>' characters (for example,
- <literal>'hello'</literal> or
- <literal>"goodbye"</literal>), and <command>mysql</command>
+ The <literal>'></literal> and <literal>"></literal>
+ prompts occur during string collection (another way of saying that
+ MySQL is waiting for completion of a string). In MySQL, you can write
+ strings surrounded by either '<literal>'</literal>' or
+ '<literal>"</literal>' characters (for example,
+ <literal>'hello'</literal> or
+ <literal>"goodbye"</literal>), and <command>mysql</command>
lets you enter strings that span multiple lines. When you see a
- <literal>'></literal> or <literal>"></literal> prompt, it
- means that you have entered a line containing a string that begins
- with a '<literal>'</literal>' or '<literal>"</literal>' quote
- character, but have not yet entered the matching quote that
- terminates the string. This often indicates that you have
+ <literal>'></literal> or <literal>"></literal> prompt, it
+ means that you have entered a line containing a string that begins
+ with a '<literal>'</literal>' or '<literal>"</literal>' quote
+ character, but have not yet entered the matching quote that
+ terminates the string. This often indicates that you have
inadvertently left out a quote character. For example:
</para>
@@ -543,8 +542,8 @@
<para>
The <literal>`></literal> prompt is similar to the
- <literal>'></literal> and <literal>"></literal> prompts, but
- indicates that you have begun but not completed a backtick-quoted
+ <literal>'></literal> and <literal>"></literal> prompts,
+ but indicates that you have begun but not completed a backtick-quoted
identifier.
</para>
@@ -581,16 +580,16 @@
</indexterm>
<para>
- Once you know how to enter commands, you are ready to access a
+ Once you know how to enter commands, you are ready to access a
database.
</para>
<para>
Suppose that you have several pets in your home (your menagerie) and
- you would like to keep track of various types of information about
- them. You can do so by creating tables to hold your data and loading
- them with the desired information. Then you can answer different
- sorts of questions about your animals by retrieving data from the
+ you would like to keep track of various types of information about
+ them. You can do so by creating tables to hold your data and loading
+ them with the desired information. Then you can answer different
+ sorts of questions about your animals by retrieving data from the
tables. This section shows you how to:
</para>
@@ -626,10 +625,10 @@
keep track of patient records. A menagerie distribution containing
some of the queries and sample data used in the following sections
can be obtained from the MySQL Web site. It is available in both
- compressed <command>tar</command>
+ compressed <command>tar</command>
(<ulink url="http://www.mysql.com/Downloads/Contrib/Examples/menagerie.tar.gz">http://www.mysql.com/Downloads/Contrib/Examples/menagerie.tar.gz</ulink>)
and Zip
- (<ulink url="http://www.mysql.com/Downloads/Contrib/Examples/menagerie.zip">http://www.mysql.com/Downloads/Contrib/Examples/menagerie.zip</ulink>)
+ (<ulink url="http://www.mysql.com/Downloads/Contrib/Examples/menagerie.zip">http://www.mysql.com/Downloads/Contrib/Examples/menagerie.zip</ulink>)
formats.
</para>
@@ -762,13 +761,13 @@
</programlisting>
<para>
- Note that <literal>menagerie</literal> in the command just shown is
- <emphasis role="bold">not</emphasis> your password. If you want to
- supply your password on the command line after the
- <literal>-p</literal> option, you must do so with no intervening
- space (for example, as <literal>-pmypassword</literal>, not as
- <literal>-p mypassword</literal>). However, putting your password on
- the command line is not recommended, because doing so exposes it to
+ Note that <literal>menagerie</literal> in the command just shown is
+ <emphasis role="bold">not</emphasis> your password. If you want to
+ supply your password on the command line after the
+ <literal>-p</literal> option, you must do so with no intervening
+ space (for example, as <literal>-pmypassword</literal>, not as
+ <literal>-p mypassword</literal>). However, putting your password on
+ the command line is not recommended, because doing so exposes it to
snooping by other users logged in on your machine.
</para>
@@ -805,8 +804,8 @@
</para>
<para>
- You want a table that contains a record for each of your pets.
- This can be called the <literal>pet</literal> table, and it should
+ You want a table that contains a record for each of your pets. This
+ can be called the <literal>pet</literal> table, and it should
contain, as a bare minimum, each animal's name. Because the name by
itself is not very interesting, the table should contain other
information. For example, if more than one person in your family
@@ -866,13 +865,13 @@
<literal>name</literal>, <literal>owner</literal>, and
<literal>species</literal> columns because the column values vary in
length. The lengths of those columns need not all be the same, and
- need not be <literal>20</literal>. In MySQL 5.0.3 and later
- versions, you can normally pick any length from
- <literal>1</literal> to <literal>65535</literal>, whatever seems
- most reasonable to you. (<emphasis role="bold">Note</emphasis>:
- Prior to MySQL 5.0.3, the upper limit was 255.) If you make a poor
- choice and it turns out later that you need a longer field, MySQL
- provides an <literal>ALTER TABLE</literal> statement.
+ need not be <literal>20</literal>. In MySQL 5.0.3 and later
+ versions, you can normally pick any length from <literal>1</literal>
+ to <literal>65535</literal>, whatever seems most reasonable to you.
+ (<emphasis role="bold">Note</emphasis>: Prior to MySQL 5.0.3, the
+ upper limit was 255.) If you make a poor choice and it turns out
+ later that you need a longer field, MySQL provides an <literal>ALTER
+ TABLE</literal> statement.
</para>
<para>
@@ -1229,10 +1228,10 @@
-> LINES TERMINATED BY '\r\n';
</programlisting>
- <para>
- (On an Apple machine running OS X, you would likely want to use
- <literal>LINES TERMINATED BY '\r'</literal>.)
- </para>
+ <para>
+ (On an Apple machine running OS X, you would likely want to use
+ <literal>LINES TERMINATED BY '\r'</literal>.)
+ </para>
<para>
You can specify the column value separator and end of line marker
@@ -1254,8 +1253,8 @@
<literal>INSERT</literal> statement is useful. In its simplest form,
you supply values for each column, in the order in which the columns
were listed in the <literal>CREATE TABLE</literal> statement.
- Suppose that Diane gets a new hamster named "Puffball".
- You could add a new record using an <literal>INSERT</literal>
+ Suppose that Diane gets a new hamster named "Puffball".
+ You could add a new record using an <literal>INSERT</literal>
statement like this:
</para>
@@ -1317,12 +1316,12 @@
</programlisting>
<para>
- <replaceable>what_to_select</replaceable> indicates what you want to
- see. This can be a list of columns, or <literal>*</literal> to
- indicate ``all columns.'' <replaceable>which_table</replaceable>
- indicates the table from which you want to retrieve data. The
+ <replaceable>what_to_select</replaceable> indicates what you want to
+ see. This can be a list of columns, or <literal>*</literal> to
+ indicate ``all columns.'' <replaceable>which_table</replaceable>
+ indicates the table from which you want to retrieve data. The
<literal>WHERE</literal> clause is optional. If it is present,
- <replaceable>conditions_to_satisfy</replaceable> specifies one or
+ <replaceable>conditions_to_satisfy</replaceable> specifies one or
more conditions that rows must satisfy to qualify for retrieval.
</para>
@@ -1534,7 +1533,7 @@
</indexterm>
<para>
- If you do not want to see entire rows from your table, just name
+ If you do not want to see entire rows from your table, just name
the columns in which you are interested, separated by commas. For
example, if you want to know when your animals were born, select
the <literal>name</literal> and <literal>birth</literal> columns:
@@ -1583,9 +1582,9 @@
</indexterm>
<para>
- Notice that the query simply retrieves the <literal>owner</literal>
- column from each record, and some of them appear more than once. To
- minimize the output, retrieve each unique output record just once
+ Notice that the query simply retrieves the <literal>owner</literal>
+ column from each record, and some of them appear more than once. To
+ minimize the output, retrieve each unique output record just once
by adding the keyword <literal>DISTINCT</literal>:
</para>
@@ -1680,13 +1679,13 @@
</programlisting>
<para>
- On character type columns, sorting — like all other
- comparison operations — is normally performed in a
- case-insensitive fashion. This means that the order is undefined
- for columns that are identical except for their case. You can force
- a case-sensitive sort for a column by using
- <literal>BINARY</literal> like so: <literal>ORDER BY BINARY
- col_name</literal>.
+ On character type columns, sorting — like all other
+ comparison operations — is normally performed in a
+ case-insensitive fashion. This means that the order is undefined
+ for columns that are identical except for their case. You can force
+ a case-sensitive sort for a column by using
+ <literal>BINARY</literal> like so: <literal>ORDER BY BINARY
+ col_name</literal>.
</para>
<para>
@@ -1812,8 +1811,8 @@
adjusts the year difference down a year if
<literal>CURDATE()</literal> occurs earlier in the year than
<literal>birth</literal>. The full expression is somewhat ungainly,
- so an <emphasis>alias</emphasis> (<literal>age</literal>) is used to make the output
- column label more meaningful.
+ so an <emphasis>alias</emphasis> (<literal>age</literal>) is used
+ to make the output column label more meaningful.
</para>
<para>
@@ -1903,7 +1902,7 @@
What if you want to know which animals have birthdays next month?
For this type of calculation, year and day are irrelevant; you
simply want to extract the month part of the
- <literal>birth</literal> column. MySQL provides several functions
+ <literal>birth</literal> column. MySQL provides several functions
for extracting parts of dates, such as <literal>YEAR()</literal>,
<literal>MONTH()</literal>, and <literal>DAYOFMONTH()</literal>.
<literal>MONTH()</literal> is the appropriate function here. To see
@@ -1929,9 +1928,9 @@
</programlisting>
<para>
- Finding animals with birthdays in the upcoming month is also
- simple. Suppose that the current month is April. Then the month
- value is <literal>4</literal> and you can look for animals born in
+ Finding animals with birthdays in the upcoming month is also
+ simple. Suppose that the current month is April. Then the month
+ value is <literal>4</literal> and you can look for animals born in
May (month <literal>5</literal>) like this:
</para>
@@ -1946,19 +1945,19 @@
<para>
There is a small complication if the current month is December. You
- cannot merely add one to the month number (<literal>12</literal>)
- and look for animals born in month <literal>13</literal>, because
- there is no such month. Instead, you look for animals born in
+ cannot merely add one to the month number (<literal>12</literal>)
+ and look for animals born in month <literal>13</literal>, because
+ there is no such month. Instead, you look for animals born in
January (month <literal>1</literal>).
</para>
<para>
- You can write the query so that it works no matter what the current
- month is, so that you do not have to use the number for a
- particular month. <literal>DATE_ADD()</literal> allows you to add a
- time interval to a given date. If you add a month to the value of
- <literal>CURDATE()</literal>, then extract the month part with
- <literal>MONTH()</literal>, the result produces the month in which
+ You can write the query so that it works no matter what the current
+ month is, so that you do not have to use the number for a
+ particular month. <literal>DATE_ADD()</literal> allows you to add a
+ time interval to a given date. If you add a month to the value of
+ <literal>CURDATE()</literal>, then extract the month part with
+ <literal>MONTH()</literal>, the result produces the month in which
to look for birthdays:
</para>
@@ -2007,8 +2006,8 @@
<para>
The <literal>NULL</literal> value can be surprising until you get
used to it. Conceptually, <literal>NULL</literal> means a missing
- unknown value and it is treated somewhat differently than other
- values. To test for <literal>NULL</literal>, you cannot use the
+ unknown value and it is treated somewhat differently than other
+ values. To test for <literal>NULL</literal>, you cannot use the
arithmetic comparison operators such as <literal>=</literal>,
<literal><</literal>, or <literal><></literal>. To
demonstrate this for yourself, try the following query:
@@ -2068,9 +2067,9 @@
assume that it is not possible to insert a zero or an empty string
into a column defined as <literal>NOT NULL</literal>, but this is
not the case. These are in fact values, whereas
- <literal>NULL</literal> means "not having a value". You
- can test this easily enough by using <literal>IS [NOT]
- NULL</literal> as shown:
+ <literal>NULL</literal> means "not having a value". You
+ can test this easily enough by using <literal>IS [NOT]
+ NULL</literal> as shown:
</para>
<programlisting>
@@ -2084,8 +2083,8 @@
<para>
Thus it is entirely possible to insert a zero or empty string into
- a <literal>NOT NULL</literal> column, as these are in fact
- <literal>NOT NULL</literal>. See
+ a <literal>NOT NULL</literal> column, as these are in fact
+ <literal>NOT NULL</literal>. See
<xref linkend="problems-with-null"/>.
</para>
@@ -2257,7 +2256,7 @@
</programlisting>
<para>
- In MySQL 5.0, if you really want to force a
+ In MySQL 5.0, if you really want to force a
<literal>REGEXP</literal> comparison to be case sensitive, use the
<literal>BINARY</literal> keyword to make one of the strings a
binary string. This query matches only lowercase
@@ -2499,7 +2498,7 @@
</programlisting>
<para>
- Or, if you wanted the number of animals per sex only for animals
+ Or, if you wanted the number of animals per sex only for animals
whose sex is known:
</para>
@@ -2747,7 +2746,7 @@
</programlisting>
<para>
- Based on what you have learned from the queries that you have run
+ Based on what you have learned from the queries that you have run
on the <literal>pet</literal> table, you should be able to perform
retrievals on the records in the <literal>event</literal> table;
the principles are the same. But when is the
@@ -3054,7 +3053,7 @@
</programlisting></listitem>
<listitem><para>
- You can distribute your script to other people so that they can also
+ You can distribute your script to other people so that they can also
run the commands.
</para></listitem>
@@ -3217,12 +3216,12 @@
<title id='title-example-maximum-row'>&title-example-maximum-row;</title>
<para>
- <emphasis>Task: Find the number, dealer, and price of the most
- expensive article.</emphasis>
+ <emphasis>Task: Find the number, dealer, and price of the most
+ expensive article.</emphasis>
</para>
<para>
- In MySQL 5.0 (and standard SQL), this is easily done with a
+ In MySQL 5.0 (and standard SQL), this is easily done with a
subquery:
</para>
@@ -3233,7 +3232,7 @@
</programlisting>
<para>
- Another solution is to sort all rows descending by price and get
+ Another solution is to sort all rows descending by price and get
only the first row using the MySQL-specific <literal>LIMIT</literal>
clause:
</para>
@@ -3246,8 +3245,8 @@
</programlisting>
<para>
- <emphasis role="bold">Note</emphasis>: If there were several most
- expensive articles, each with a price of 19.95, the
+ <emphasis role="bold">Note</emphasis>: If there were several most
+ expensive articles, each with a price of 19.95, the
<literal>LIMIT</literal> solution would show only one of them.
</para>
@@ -3258,7 +3257,7 @@
<title id='title-example-maximum-column-group'>&title-example-maximum-column-group;</title>
<para>
- <emphasis>Task: Find the highest price per article.</emphasis>
+ <emphasis>Task: Find the highest price per article.</emphasis>
</para>
<programlisting>
@@ -3283,12 +3282,12 @@
<title id='title-example-maximum-column-group-row'>&title-example-maximum-column-group-row;</title>
<para>
- <emphasis>Task: For each article, find the dealer or dealers with
- the most expensive price.</emphasis>
+ <emphasis>Task: For each article, find the dealer or dealers with
+ the most expensive price.</emphasis>
</para>
<para>
- In MySQL 5.0 (as in standard SQL, this problem can be solved with a
+ In MySQL 5.0 (as in standard SQL, this problem can be solved with a
subquery like this one:
</para>
@@ -3300,7 +3299,6 @@
WHERE s1.article = s2.article);
</programlisting>
-
</section>
<section id="example-user-variables">
@@ -3308,7 +3306,7 @@
<title id='title-example-user-variables'>&title-example-user-variables;</title>
<para>
- You can employ MySQL user variables to remember results without
+ You can employ MySQL user variables to remember results without
having to store them in temporary variables in the client. (See
<xref linkend="variables"/>.)
</para>
@@ -3351,59 +3349,58 @@
</indexterm>
<para>
- In MySQL, <literal>InnoDB</literal> tables support checking of
- foreign key constraints. See <xref linkend="innodb"/>. See also
+ In MySQL, <literal>InnoDB</literal> tables support checking of
+ foreign key constraints. See <xref linkend="innodb"/>. See also
<xref linkend="ansi-diff-foreign-keys"/>.
</para>
- <para>
- A foreign key constraint is not required merely to join two
- tables. For table types other than <literal>InnoDB</literal>, it
- is possible when defining a column to use a <literal>REFERENCES
- <replaceable>tbl_name</replaceable>(<replaceable>col_name</replaceable>)</literal> clause,
- which has no actual effect, and <emphasis>serves only as a
- memo or comment to you that the column which you are currently
- defining is intended to refer to a column in another
- table</emphasis>. It is extremely important to realize when
- using this syntax that:
- </para>
-
- <itemizedlist>
-
- <listitem><para>
- MySQL does not perform any sort of <literal>CHECK</literal> to
- make sure that <replaceable>col_name</replaceable> actually
- exists in <replaceable>tbl_name</replaceable> (or even that
- <replaceable>tbl_name</replaceable> itself exists).
- </para></listitem>
-
- <listitem><para>
- MySQL does not perform any sort of action on
- <replaceable>tbl_name</replaceable> such as deleting rows in
- response to actions taken on rows in the table which you are
- defining; in other words, this syntax induces no <literal>ON
- DELETE</literal> or <literal>ON UPDATE</literal> behaviour
- whatsoever. (While you can write an <literal>ON
- DELETE</literal> or <literal>ON UPDATE</literal> clause as
- part of the <literal>REFERENCES</literal> clause, it is also
- ignored.)
- </para></listitem>
-
- <listitem><para>
- This syntax creates a <emphasis>column</emphasis>; it does
- <emphasis role="bold">not</emphasis> create any sort of index
- or key.
- </para></listitem>
-
- <listitem><para>
- This syntax will cause an error if used in trying to define an
- <literal>InnoDB</literal> table.
- </para></listitem>
-
- </itemizedlist>
-
<para>
- You can use a column so created as a join column, as shown here:
+ A foreign key constraint is not required merely to join two tables.
+ For table types other than <literal>InnoDB</literal>, it is possible
+ when defining a column to use a <literal>REFERENCES
+ <replaceable>tbl_name</replaceable>(<replaceable>col_name</replaceable>)</literal>
+ clause, which has no actual effect, and <emphasis>serves only as a
+ memo or comment to you that the column which you are currently
+ defining is intended to refer to a column in another
+ table</emphasis>. It is extremely important to realize when using
+ this syntax that:
+ </para>
+
+ <itemizedlist>
+
+ <listitem><para>
+ MySQL does not perform any sort of <literal>CHECK</literal> to make
+ sure that <replaceable>col_name</replaceable> actually exists in
+ <replaceable>tbl_name</replaceable> (or even that
+ <replaceable>tbl_name</replaceable> itself exists).
+ </para></listitem>
+
+ <listitem><para>
+ MySQL does not perform any sort of action on
+ <replaceable>tbl_name</replaceable> such as deleting rows in
+ response to actions taken on rows in the table which you are
+ defining; in other words, this syntax induces no <literal>ON
+ DELETE</literal> or <literal>ON UPDATE</literal> behaviour
+ whatsoever. (While you can write an <literal>ON DELETE</literal> or
+ <literal>ON UPDATE</literal> clause as part of the
+ <literal>REFERENCES</literal> clause, it is also ignored.)
+ </para></listitem>
+
+ <listitem><para>
+ This syntax creates a <emphasis>column</emphasis>; it does
+ <emphasis role="bold">not</emphasis> create any sort of index or
+ key.
+ </para></listitem>
+
+ <listitem><para>
+ This syntax will cause an error if used in trying to define an
+ <literal>InnoDB</literal> table.
+ </para></listitem>
+
+ </itemizedlist>
+
+ <para>
+ You can use a column so created as a join column, as shown here:
</para>
<programlisting>
@@ -3476,11 +3473,11 @@
+----+-------+--------+-------+
</programlisting>
- <para>
- When used in this fashion, the <literal>REFERENCES</literal>
- clause is not displayed in the output of <literal>SHOW CREATE
- TABLE</literal> or <literal>DESCRIBE</literal>:
- </para>
+ <para>
+ When used in this fashion, the <literal>REFERENCES</literal> clause
+ is not displayed in the output of <literal>SHOW CREATE
+ TABLE</literal> or <literal>DESCRIBE</literal>:
+ </para>
<programlisting>
SHOW CREATE TABLE shirt\G
@@ -3495,12 +3492,11 @@
) ENGINE=MyISAM DEFAULT CHARSET=latin1
</programlisting>
- <para>
- The use of <literal>REFERENCES</literal> in this way as a
- comment or "reminder" in a column definition works
- with both <literal>MyISAM</literal> and
- <literal>BerkeleyDB</literal> tables.
- </para>
+ <para>
+ The use of <literal>REFERENCES</literal> in this way as a comment or
+ "reminder" in a column definition works with both
+ <literal>MyISAM</literal> and <literal>BerkeleyDB</literal> tables.
+ </para>
</section>
@@ -3547,8 +3543,8 @@
</para>
<para>
- In MySQL 5.0, you can also solve the problem efficiently by using a
- <literal>UNION</literal> that combines the output of two separate
+ In MySQL 5.0, you can also solve the problem efficiently by using a
+ <literal>UNION</literal> that combines the output of two separate
<literal>SELECT</literal> statements. See <xref linkend="union"/>.
</para>
@@ -3931,7 +3927,7 @@
TODO: This list might work better if it were reformatted as an
informal table...?
-->
-
+
<itemizedlist>
<listitem><para>
--- 1.4/refman/tutorial.xml 2005-07-12 13:34:42 -05:00
+++ 1.5/refman/tutorial.xml 2005-07-12 13:37:24 -05:00
@@ -3453,7 +3453,7 @@
involve the creation of foreign keys at all. If anything, it's an
example of a rather novel sort of comment. /JS
-->
-
+
<section id="example-foreign-keys">
<title id='title-example-foreign-keys'>&title-example-foreign-keys;</title>
@@ -3473,54 +3473,53 @@
See also <xref linkend="ansi-diff-foreign-keys"/>.
</para>
- <para>
- A foreign key constraint is not required merely to join two
- tables. For table types other than <literal>InnoDB</literal>, it
- is possible when defining a column to use a <literal>REFERENCES
- <replaceable>tbl_name</replaceable>(<replaceable>col_name</replaceable>)</literal> clause,
- which has no actual effect, and <emphasis>serves only as a
- memo or comment to you that the column which you are currently
- defining is intended to refer to a column in another
- table</emphasis>. It is extremely important to realize when
- using this syntax that:
- </para>
-
- <itemizedlist>
-
- <listitem><para>
- MySQL does not perform any sort of <literal>CHECK</literal> to
- make sure that <replaceable>col_name</replaceable> actually
- exists in <replaceable>tbl_name</replaceable> (or even that
- <replaceable>tbl_name</replaceable> itself exists).
- </para></listitem>
-
- <listitem><para>
- MySQL does not perform any sort of action on
- <replaceable>tbl_name</replaceable> such as deleting rows in
- response to actions taken on rows in the table which you are
- defining; in other words, this syntax induces no <literal>ON
- DELETE</literal> or <literal>ON UPDATE</literal> behaviour
- whatsoever. (While you can write an <literal>ON
- DELETE</literal> or <literal>ON UPDATE</literal> clause as
- part of the <literal>REFERENCES</literal> clause, it is also
- ignored.)
- </para></listitem>
-
- <listitem><para>
- This syntax creates a <emphasis>column</emphasis>; it does
- <emphasis role="bold">not</emphasis> create any sort of index
- or key.
- </para></listitem>
-
- <listitem><para>
- This syntax will cause an error if used in trying to define an
- <literal>InnoDB</literal> table.
- </para></listitem>
-
- </itemizedlist>
-
<para>
- You can use a column so created as a join column, as shown here:
+ A foreign key constraint is not required merely to join two tables.
+ For table types other than <literal>InnoDB</literal>, it is possible
+ when defining a column to use a <literal>REFERENCES
+ <replaceable>tbl_name</replaceable>(<replaceable>col_name</replaceable>)</literal>
+ clause, which has no actual effect, and <emphasis>serves only as a
+ memo or comment to you that the column which you are currently
+ defining is intended to refer to a column in another
+ table</emphasis>. It is extremely important to realize when using
+ this syntax that:
+ </para>
+
+ <itemizedlist>
+
+ <listitem><para>
+ MySQL does not perform any sort of <literal>CHECK</literal> to make
+ sure that <replaceable>col_name</replaceable> actually exists in
+ <replaceable>tbl_name</replaceable> (or even that
+ <replaceable>tbl_name</replaceable> itself exists).
+ </para></listitem>
+
+ <listitem><para>
+ MySQL does not perform any sort of action on
+ <replaceable>tbl_name</replaceable> such as deleting rows in
+ response to actions taken on rows in the table which you are
+ defining; in other words, this syntax induces no <literal>ON
+ DELETE</literal> or <literal>ON UPDATE</literal> behaviour
+ whatsoever. (While you can write an <literal>ON DELETE</literal> or
+ <literal>ON UPDATE</literal> clause as part of the
+ <literal>REFERENCES</literal> clause, it is also ignored.)
+ </para></listitem>
+
+ <listitem><para>
+ This syntax creates a <emphasis>column</emphasis>; it does
+ <emphasis role="bold">not</emphasis> create any sort of index or
+ key.
+ </para></listitem>
+
+ <listitem><para>
+ This syntax will cause an error if used in trying to define an
+ <literal>InnoDB</literal> table.
+ </para></listitem>
+
+ </itemizedlist>
+
+ <para>
+ You can use a column so created as a join column, as shown here:
</para>
<programlisting>
@@ -3593,11 +3592,11 @@
+----+-------+--------+-------+
</programlisting>
- <para>
- When used in this fashion, the <literal>REFERENCES</literal>
- clause is not displayed in the output of <literal>SHOW CREATE
- TABLE</literal> or <literal>DESCRIBE</literal>:
- </para>
+ <para>
+ When used in this fashion, the <literal>REFERENCES</literal> clause
+ is not displayed in the output of <literal>SHOW CREATE
+ TABLE</literal> or <literal>DESCRIBE</literal>:
+ </para>
<programlisting>
SHOW CREATE TABLE shirt\G
@@ -3612,12 +3611,11 @@
) ENGINE=MyISAM DEFAULT CHARSET=latin1
</programlisting>
- <para>
- The use of <literal>REFERENCES</literal> in this way as a
- comment or "reminder" in a column definition works
- with both <literal>MyISAM</literal> and
- <literal>BerkeleyDB</literal> tables.
- </para>
+ <para>
+ The use of <literal>REFERENCES</literal> in this way as a comment or
+ "reminder" in a column definition works with both
+ <literal>MyISAM</literal> and <literal>BerkeleyDB</literal> tables.
+ </para>
</section>
| Thread |
|---|
| • bk commit - mysqldoc@docsrva tree (paul:1.3000) | paul | 12 Jul |