List:Commits« Previous MessageNext Message »
From:paul Date:January 14 2006 4:26am
Subject:svn commit - mysqldoc@docsrva: r823 - in trunk: . refman-4.1 refman-5.0 refman-5.1
View as plain text  
Author: paul
Date: 2006-01-14 05:26:26 +0100 (Sat, 14 Jan 2006)
New Revision: 823

Log:
 r6192@frost:  paul | 2006-01-13 22:25:14 -0600
 General revisions.


Modified:
   trunk/
   trunk/refman-4.1/charset.xml
   trunk/refman-4.1/database-administration.xml
   trunk/refman-4.1/functions.xml
   trunk/refman-4.1/installing.xml
   trunk/refman-4.1/introduction.xml
   trunk/refman-4.1/language-structure.xml
   trunk/refman-4.1/sql-syntax.xml
   trunk/refman-5.0/charset.xml
   trunk/refman-5.0/database-administration.xml
   trunk/refman-5.0/functions.xml
   trunk/refman-5.0/installing.xml
   trunk/refman-5.0/introduction.xml
   trunk/refman-5.0/language-structure.xml
   trunk/refman-5.0/sql-syntax.xml
   trunk/refman-5.1/charset.xml
   trunk/refman-5.1/database-administration.xml
   trunk/refman-5.1/functions.xml
   trunk/refman-5.1/installing.xml
   trunk/refman-5.1/introduction.xml
   trunk/refman-5.1/language-structure.xml
   trunk/refman-5.1/sql-syntax.xml


Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:6191
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:2175
   + b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:6192
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:2175

Modified: trunk/refman-4.1/charset.xml
===================================================================
--- trunk/refman-4.1/charset.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-4.1/charset.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -41,9 +41,15 @@
 
   <para>
     Improved support for character set handling was added to MySQL in
-    version 4.1. The features described here are as implemented in MySQL
-    4.1.1. (MySQL 4.1.0 has some but not all of these features, and some
-    of them are implemented differently.)
+    version 4.1. This support enables you to store data using a variety
+    of character sets and perform comparisons according to a variety of
+    collations. You can specify character sets at the server, database,
+    table, and column level. MySQL supports the use of character sets
+    for the <literal>MyISAM</literal>, <literal>MEMORY</literal>, and
+    (as of MySQL 4.1.2) <literal>InnoDB</literal> storage engines. The
+    <literal>ISAM</literal> storage engine does not include character
+    set support; there are no plans to change this, because
+    <literal>ISAM</literal> is deprecated.
   </para>
 
   <para>
@@ -60,13 +66,13 @@
 
     <listitem>
       <para>
-        The multiple-level default system
+        The multiple-level default system for character set assignment
       </para>
     </listitem>
 
     <listitem>
       <para>
-        New syntax in MySQL 4.1
+        Syntax for specifying character sets and collations
       </para>
     </listitem>
 
@@ -84,22 +90,31 @@
 
     <listitem>
       <para>
-        The meaning of each individual character set and collation
+        The character sets and collations that are available, with notes
       </para>
     </listitem>
 
   </itemizedlist>
 
   <para>
-    Character set support currently is included in the
-    <literal>MyISAM</literal>, <literal>MEMORY</literal>
-    (<literal>HEAP</literal>), and (as of MySQL 4.1.2)
-    <literal>InnoDB</literal> storage engines. The
-    <literal>ISAM</literal> storage engine does not include character
-    set support; there are no plans to change this, because
-    <literal>ISAM</literal> is deprecated.
+    Character set issues affect data storage, but also communication
+    between client programs and the MySQL server. If you want the client
+    program to communicate with the server using a character set
+    different from the default, you'll need to indicate which one. For
+    example, to use the <literal>utf8</literal> Unicode character set,
+    issue this statement after connecting to the server:
   </para>
 
+<programlisting>
+SET NAMES 'utf8';
+</programlisting>
+
+  <para>
+    For more information about character set-related issues in
+    client/server communication, see
+    <xref linkend="charset-connection"/>.
+  </para>
+
   <section id="charset-general">
 
     <title>&title-charset-general;</title>
@@ -159,10 +174,11 @@
       &lsquo;<literal>B</literal>&rsquo; but whole alphabets, sometimes
       multiple alphabets or eastern writing systems with thousands of
       characters, along with many special symbols and punctuation marks.
-      Also in real life, most collations have many rules: not just case
-      insensitivity but also accent insensitivity (an
-      <quote>accent</quote> is a mark attached to a character as in
-      German &lsquo;<literal>Ö</literal>&rsquo;) and multiple-character
+      Also in real life, most collations have many rules, not just for
+      whether to distinguish lettercase, but also for whether to
+      distinguish accents (an <quote>accent</quote> is a mark attached
+      to a character as in German
+      &lt;squo;<literal>Ö</literal>&rsquo;), and for multiple-character
       mappings (such as the rule that
       &lsquo;<literal>Ö</literal>&rsquo; =
       &lsquo;<literal>OE</literal>&rsquo; in one of the two German
@@ -205,10 +221,11 @@
 
     <para>
       In these respects, not only is MySQL 4.1 far more flexible than
-      MySQL 4.0, it also is far ahead of other DBMSs. However, to use
-      the new features effectively, you need to learn what character
-      sets and collations are available, how to change their defaults,
-      and what the various string operators do with them.
+      MySQL 4.0, it also is far ahead of most other database management
+      systems. However, to use these features effectively, you need to
+      know what character sets and collations are available, how to
+      change the defaults, and how they affect the behavior of string
+      operators and functions.
     </para>
 
   </section>
@@ -220,7 +237,8 @@
     <para>
       The MySQL server can support multiple character sets. To list the
       available character sets, use the <literal>SHOW CHARACTER
-      SET</literal> statement:
+      SET</literal> statement. A partial listing follows. For more
+      complete information, see <xref linkend="charset-charsets"/>.
     </para>
 
 <programlisting>
@@ -242,26 +260,24 @@
 | hebrew   | ISO 8859-8 Hebrew           | hebrew_general_ci   |      1 |
 | tis620   | TIS620 Thai                 | tis620_thai_ci      |      1 |
 | euckr    | EUC-KR Korean               | euckr_korean_ci     |      2 |
+| koi8u    | KOI8-U Ukrainian            | koi8u_general_ci    |      1 |
+| gb2312   | GB2312 Simplified Chinese   | gb2312_chinese_ci   |      2 |
+| greek    | ISO 8859-7 Greek            | greek_general_ci    |      1 |
+| cp1250   | Windows Central European    | cp1250_general_ci   |      1 |
+| gbk      | GBK Simplified Chinese      | gbk_chinese_ci      |      2 |
+| latin5   | ISO 8859-9 Turkish          | latin5_turkish_ci   |      1 |
 ...
 </programlisting>
 
     <para>
-      (For a complete listing, see <xref linkend="charset-charsets"/>.)
-    </para>
-
-    <para>
       Any given character set always has at least one collation. It may
-      have several collations.
+      have several collations. To list the collations for a character
+      set, use the <literal>SHOW COLLATION</literal> statement. For
+      example, to see the collations for the <literal>latin1</literal>
+      (cp1252 West European) character set, use this statement to find
+      those collation names that begin with <literal>latin1</literal>:
     </para>
 
-    <para>
-      To list the collations for a character set, use the <literal>SHOW
-      COLLATION</literal> statement. For example, to see the collations
-      for the <literal>latin1</literal> (<quote>cp1252 West
-      European</quote>) character set, use this statement to find those
-      collation names that begin with <literal>latin1</literal>:
-    </para>
-
     <remark role="note">
       Please do not cut this list.
     </remark>
@@ -349,7 +365,9 @@
           Each character set has one collation that is the
           <emphasis>default collation</emphasis>. For example, the
           default collation for <literal>latin1</literal> is
-          <literal>latin1_swedish_ci</literal>.
+          <literal>latin1_swedish_ci</literal>. The output for
+          <literal>SHOW CHARACTER SET</literal> indicates which
+          collation is the default for each displayed character set.
         </para>
       </listitem>
 
@@ -385,38 +403,15 @@
       <title>&title-charset-server;</title>
 
       <para>
-        The MySQL Server has a server character set and a server
-        collation, neither of which may be null.
+        MySQL Server has a server character set and a server collation.
+        These can be set at server startup and changed at runtime.
       </para>
 
       <para>
-        MySQL determines the server character set and server collation
-        as follows:
-      </para>
-
-      <itemizedlist>
-
-        <listitem>
-          <para>
-            According to the option settings in effect when the server
-            starts
-          </para>
-        </listitem>
-
-        <listitem>
-          <para>
-            According to the values set at runtime
-          </para>
-        </listitem>
-
-      </itemizedlist>
-
-      <para>
-        At the server level, the decision is simple. The server
-        character set and collation depend initially on the options that
-        you use when you start <command>mysqld</command>. You can use
-        <option>--default-character-set</option> for the character set,
-        and along with it you can add
+        Initially, the server character set and collation depend on the
+        options that you use when you start <command>mysqld</command>.
+        You can use <option>--default-character-set</option> for the
+        character set. Along with it you can add
         <option>--default-collation</option> for the collation. If you
         don't specify a character set, that is the same as saying
         <option>--default-character-set=latin1</option>. If you specify
@@ -464,9 +459,9 @@
       </para>
 
       <para>
-        The current server character set and collation are available as
-        the values of the <literal>character_set_server</literal> and
-        <literal>collation_server</literal> system variables. These
+        The current server character set and collation can be determined
+        from the values of the <literal>character_set_server</literal>
+        and <literal>collation_server</literal> system variables. These
         variables can be changed at runtime.
       </para>
 
@@ -478,10 +473,9 @@
 
       <para>
         Every database has a database character set and a database
-        collation, which may not be null. The <literal>CREATE
-        DATABASE</literal> and <literal>ALTER DATABASE</literal>
-        statements have optional clauses for specifying the database
-        character set and collation:
+        collation. The <literal>CREATE DATABASE</literal> and
+        <literal>ALTER DATABASE</literal> statements have optional
+        clauses for specifying the database character set and collation:
       </para>
 
 <programlisting>
@@ -495,17 +489,28 @@
 </programlisting>
 
       <para>
+        The keyword <literal>SCHEMA</literal> can be used instead of
+        <literal>DATABASE</literal>.
+      </para>
+
+      <para>
+        The <literal>CHARACTER SET</literal> and
+        <literal>COLLATE</literal> clauses make it possible to create
+        databases with different character sets and collations on the
+        same MySQL server.
+      </para>
+
+      <para>
         Example:
       </para>
 
 <programlisting>
-CREATE DATABASE <replaceable>db_name</replaceable>
-    DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
+CREATE DATABASE <replaceable>db_name</replaceable> CHARACTER SET latin1 COLLATE latin1_swedish_ci;
 </programlisting>
 
       <para>
         MySQL chooses the database character set and database collation
-        thus:
+        in the following manner:
       </para>
 
       <itemizedlist>
@@ -548,15 +553,6 @@
       </itemizedlist>
 
       <para>
-        MySQL's <literal>CREATE DATABASE ... DEFAULT CHARACTER SET
-        ...</literal> syntax is analogous to the standard SQL
-        <literal>CREATE SCHEMA ... CHARACTER SET ...</literal> syntax.
-        Because of this, it is possible to create databases with
-        different character sets and collations on the same MySQL
-        server.
-      </para>
-
-      <para>
         The database character set and collation are used as default
         values if the table character set and collation are not
         specified in <literal>CREATE TABLE</literal> statements. They
@@ -564,13 +560,13 @@
       </para>
 
       <para>
-        The character set and collation for the default database are
-        available as the values of the
+        The character set and collation for the default database can be
+        determined from the values of the
         <literal>character_set_database</literal> and
         <literal>collation_database</literal> system variables. The
         server sets these variables whenever the default database
         changes. If there is no default database, the variables have the
-        same value as the corresponding server-level variables,
+        same value as the corresponding server-level system variables,
         <literal>character_set_server</literal> and
         <literal>collation_server</literal>.
       </para>
@@ -582,10 +578,10 @@
       <title>&title-charset-table;</title>
 
       <para>
-        Every table has a table character set and a table collation,
-        which may not be null. The <literal>CREATE TABLE</literal> and
-        <literal>ALTER TABLE</literal> statements have optional clauses
-        for specifying the table character set and collation:
+        Every table has a table character set and a table collation. The
+        <literal>CREATE TABLE</literal> and <literal>ALTER
+        TABLE</literal> statements have optional clauses for specifying
+        the table character set and collation:
       </para>
 
 <programlisting>
@@ -601,8 +597,7 @@
       </para>
 
 <programlisting>
-CREATE TABLE t1 ( ... )
-    DEFAULT CHARACTER SET latin1 COLLATE latin1_danish_ci;
+CREATE TABLE t1 ( ... ) CHARACTER SET latin1 COLLATE latin1_danish_ci;
 </programlisting>
 
       <para>
@@ -667,9 +662,8 @@
         Every <quote>character</quote> column (that is, a column of type
         <literal>CHAR</literal>, <literal>VARCHAR</literal>, or
         <literal>TEXT</literal>) has a column character set and a column
-        collation, which may not be null. Column definition syntax has
-        optional clauses for specifying the column character set and
-        collation:
+        collation. Column definition syntax has optional clauses for
+        specifying the column character set and collation:
       </para>
 
 <programlisting>
@@ -807,11 +801,11 @@
 
       <para>
         We have a column with a default character set and a default
-        collation. In this circumstance, MySQL looks up to the table
-        level for inspiration in determining the column character set
-        and collation. So, the character set for column
-        <literal>c1</literal> is <literal>latin1</literal> and its
-        collation is <literal>latin1_danish_ci</literal>.
+        collation. In this circumstance, MySQL checks the table level to
+        determine the column character set and collation. Consequently,
+        the character set for column <literal>c1</literal> is
+        <literal>latin1</literal> and its collation is
+        <literal>latin1_danish_ci</literal>.
       </para>
 
       <para>
@@ -832,12 +826,12 @@
       <para>
         We create a column without specifying its character set and
         collation. We're also not specifying a character set and a
-        collation at the table level. In this circumstance, MySQL looks
-        up to the database level for inspiration. (The database's
-        settings become the table's settings, and thereafter become the
-        column's setting.) So, the character set for column
-        <literal>c1</literal> is <literal>latin2</literal> and its
-        collation is <literal>latin2_czech_ci</literal>.
+        collation at the table level. In this circumstance, MySQL checks
+        the database level to determine the table settings, which
+        thereafter become the column settings.) Consequently, the
+        character set for column <literal>c1</literal> is
+        <literal>latin2</literal> and its collation is
+        <literal>latin2_czech_ci</literal>.
       </para>
 
     </section>
@@ -846,6 +840,16 @@
 
       <title>&title-charset-connection;</title>
 
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>CHARACTER SET</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>NAMES</literal></secondary>
+      </indexterm>
+
       <para>
         Several character set and collation system variables relate to a
         client's interaction with the server. Some of these have been
@@ -856,28 +860,29 @@
 
         <listitem>
           <para>
-            The server character set and collation are available as the
-            values of the <literal>character_set_server</literal> and
-            <literal>collation_server</literal> variables.
+            The server character set and collation can be determined
+            from the values of the
+            <literal>character_set_server</literal> and
+            <literal>collation_server</literal> system variables.
           </para>
         </listitem>
 
         <listitem>
           <para>
-            The character set and collation of the default database are
-            available as the values of the
+            The character set and collation of the default database can
+            be determined from the values of the
             <literal>character_set_database</literal> and
-            <literal>collation_database</literal> variables.
+            <literal>collation_database</literal> system variables.
           </para>
         </listitem>
 
       </itemizedlist>
 
       <para>
-        Additional character set and collation variables are involved in
-        handling traffic for the connection between a client and the
-        server. Every client has connection-related character set and
-        collation variables.
+        Additional character set and collation system variables are
+        involved in handling traffic for the connection between a client
+        and the server. Every client has connection-related character
+        set and collation system variables.
       </para>
 
       <para>
@@ -894,35 +899,37 @@
 
         <listitem>
           <para>
-            What character set is the query in when it leaves the
+            What character set is the statement in when it leaves the
             client?
           </para>
 
           <para>
             The server takes the <literal>character_set_client</literal>
-            variable to be the character set in which queries are sent
-            by the client.
+            system variable to be the character set in which statements
+            are sent by the client.
           </para>
         </listitem>
 
         <listitem>
           <para>
-            What character set should the server translate a query to
-            after receiving it?
+            What character set should the server translate a statement
+            to after receiving it?
           </para>
 
           <para>
-            For this, <literal>character_set_connection</literal> and
-            <literal>collation_connection</literal> are used by the
-            server. It converts queries sent by the client from
+            For this, the server uses the
+            <literal>character_set_connection</literal> and
+            <literal>collation_connection</literal> system variables. It
+            converts statements sent by the client from
             <literal>character_set_client</literal> to
             <literal>character_set_connection</literal> (except for
             string literals that have an introducer such as
             <literal>_latin1</literal> or <literal>_utf8</literal>).
             <literal>collation_connection</literal> is important for
             comparisons of literal strings. For comparisons of strings
-            with column values, it does not matter because columns have
-            a higher collation precedence.
+            with column values, <literal>collation_connection</literal>
+            does not matter because columns have their own collation,
+            which has a higher collation precedence.
           </para>
         </listitem>
 
@@ -933,7 +940,7 @@
           </para>
 
           <para>
-            The <literal>character_set_results</literal> variable
+            The <literal>character_set_results</literal> system variable
             indicates the character set in which the server returns
             query results to the client. This includes result data such
             as column values, and result metadata such as column names.
@@ -944,8 +951,8 @@
 
       <para>
         You can fine-tune the settings for these variables, or you can
-        depend on the defaults (in which case, you can skip this
-        section).
+        depend on the defaults (in which case, you can skip the rest of
+        this section).
       </para>
 
       <para>
@@ -959,14 +966,15 @@
 </programlisting>
 
       <para>
-        <literal>SET NAMES</literal> indicates what is in the SQL
-        statements that the client sends. Thus, <literal>SET NAMES
-        'cp1251'</literal> tells the server <quote>future incoming
-        messages from this client are in character set
-        <literal>cp1251</literal>.</quote> It also specifies the
-        character set for results that the server sends back to the
-        client. (For example, it indicates what character set column
-        values are if you use a <literal>SELECT</literal> statement.)
+        <literal>SET NAMES</literal> indicates what character set the
+        client will use to send SQL statements to the server. Thus,
+        <literal>SET NAMES 'cp1251'</literal> tells the server
+        <quote>future incoming messages from this client are in
+        character set <literal>cp1251</literal>.</quote> It also
+        specifies the character set that the server should use for
+        sending results back to the client. (For example, it indicates
+        what character set to use for column values if you use a
+        <literal>SELECT</literal> statement.)
       </para>
 
       <para>
@@ -982,16 +990,17 @@
 
       <para>
         Setting <literal>character_set_connection</literal> to
-        <literal>x</literal> also sets
+        <replaceable>x</replaceable> also sets
         <literal>collation_connection</literal> to the default collation
-        for <literal>x</literal>.
+        for <replaceable>x</replaceable>.
       </para>
 
       <para>
-        <literal>SET CHARACTER SET</literal> is similar but sets the
-        connection character set and collation to be those of the
-        default database. A <literal>SET CHARACTER SET x</literal>
-        statement is equivalent to these three statements:
+        <literal>SET CHARACTER SET</literal> is similar to <literal>SET
+        NAMES</literal> but sets the connection character set and
+        collation to be those of the default database. A <literal>SET
+        CHARACTER SET <replaceable>x</replaceable></literal> statement
+        is equivalent to these three statements:
       </para>
 
 <programlisting>
@@ -1001,13 +1010,19 @@
 </programlisting>
 
       <para>
+        Setting <literal>collation_connection</literal> also sets
+        <literal>character_set_connection</literal> to the character set
+        associated with the collation.
+      </para>
+
+      <para>
         When a client connects, it sends to the server the name of the
-        character set that it wants to use. The server sets the
-        <literal>character_set_client</literal>,
+        character set that it wants to use. The server uses the name to
+        set the <literal>character_set_client</literal>,
         <literal>character_set_results</literal>, and
-        <literal>character_set_connection</literal> variables to that
-        character set. (In effect, the server performs a <literal>SET
-        NAMES</literal> operation using the character set.)
+        <literal>character_set_connection</literal> system variables. In
+        effect, the server performs a <literal>SET NAMES</literal>
+        operation using the character set name.
       </para>
 
       <para>
@@ -1018,7 +1033,7 @@
         setting to your <command>mysql</command> statement line, or in
         your option file. For example, the following option file setting
         changes the three character set variables set to
-        <literal>koi8r</literal> each time you run
+        <literal>koi8r</literal> each time you invoke
         <command>mysql</command>:
       </para>
 
@@ -1036,15 +1051,16 @@
         <literal>column1</literal> using the character set that the
         client specified when it connected. On the other hand, if you
         say <literal>SET NAMES 'latin1'</literal> or <literal>SET
-        CHARACTER SET latin1</literal>, then just before sending results
-        back, the server converts the <literal>latin2</literal> values
-        to <literal>latin1</literal>. Conversion may be lossy if there
-        are characters that are not in both character sets.
+        CHARACTER SET latin1</literal> before issuing the
+        <literal>SELECT</literal> statement, the server converts the
+        <literal>latin2</literal> values to <literal>latin1</literal>
+        just before sending results back. Conversion may be lossy if
+        there are characters that are not in both character sets.
       </para>
 
       <para>
-        If you do not want the server to perform any conversion, set
-        <literal>character_set_results</literal> to
+        If you do not want the server to perform any conversion of
+        result sets, set <literal>character_set_results</literal> to
         <literal>NULL</literal>:
       </para>
 
@@ -1052,6 +1068,12 @@
 mysql&gt; <userinput>SET character_set_results = NULL;</userinput>
 </programlisting>
 
+      <para>
+        <emphasis role="bold">Note</emphasis>: Currently, UCS-2 cannot
+        yet be used as a client character set, which means that
+        <literal>SET NAMES 'ucs2'</literal> does not work.
+      </para>
+
     </section>
 
     <section id="charset-literal">
@@ -1060,7 +1082,7 @@
 
       <para>
         Every character string literal has a character set and a
-        collation, which may not be null.
+        collation.
       </para>
 
       <para>

Modified: trunk/refman-4.1/database-administration.xml
===================================================================
--- trunk/refman-4.1/database-administration.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-4.1/database-administration.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -19911,9 +19911,10 @@
       </indexterm>
 
       <para>
-        By default, MySQL uses the cp1252 (Latin1) character set with
-        sorting according to Swedish/Finnish rules. These defaults are
-        suitable for the United States and most of western Europe.
+        By default, MySQL uses the <literal>latin1</literal> (cp1252
+        West European) character set with sorting according to
+        Swedish/Finnish rules. These defaults are suitable for the
+        United States and most of Western Europe.
       </para>
 
       <para>

Modified: trunk/refman-4.1/functions.xml
===================================================================
--- trunk/refman-4.1/functions.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-4.1/functions.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -275,7 +275,8 @@
 
       <para>
         By default, string comparisons are not case sensitive and use
-        the current character set (cp1252 Latin1 by default, which also
+        the current character set. The default is
+        <literal>latin1</literal> (cp1252 West European), which also
         works well for English).
       </para>
 
@@ -2819,7 +2820,8 @@
         <para>
           Returns the string <replaceable>str</replaceable> with all
           characters changed to lowercase according to the current
-          character set mapping (the default is cp1252 Latin1).
+          character set mapping. The default is
+          <literal>latin1</literal> (cp1252 West European).
         </para>
 
         <remark role="help-description-end"/>
@@ -3850,7 +3852,8 @@
         <para>
           Returns the string <replaceable>str</replaceable> with all
           characters changed to uppercase according to the current
-          character set mapping (the default is cp1252 Latin1).
+          character set mapping. The default is
+          <literal>latin1</literal> (cp1252 West European).
         </para>
 
         <remark role="help-description-end"/>
@@ -4273,10 +4276,10 @@
 
           <para>
             <literal>REGEXP</literal> and <literal>RLIKE</literal> use
-            the current character set (cp1252 Latin1 by default) when
-            deciding the type of a character.
-            <emphasis role="bold">Warning</emphasis>: These operators
-            are not multi-byte safe.
+            the current character set when deciding the type of a
+            character. The default is <literal>latin1</literal> (cp1252
+            West European). <emphasis role="bold">Warning</emphasis>:
+            These operators are not multi-byte safe.
           </para>
         </listitem>
 

Modified: trunk/refman-4.1/installing.xml
===================================================================
--- trunk/refman-4.1/installing.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-4.1/installing.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -8012,9 +8012,9 @@
               <secondary>--with-collation</secondary>
             </indexterm>
 
-            By default, MySQL uses the <literal>latin1</literal>
-            (cp1252) character set. To change the default set, use the
-            <option>--with-charset</option> option:
+            By default, MySQL uses the <literal>latin1</literal> (cp1252
+            West European) character set. To change the default set, use
+            the <option>--with-charset</option> option:
           </para>
 
 <programlisting>
@@ -11533,7 +11533,7 @@
                 optionally create an account allowing for connections
                 from any host only if the user selects the
                 <guilabel>Enable root access from remote
-                  machines</guilabel> option during installation.
+                machines</guilabel> option during installation.
               </para>
             </listitem>
 

Modified: trunk/refman-4.1/introduction.xml
===================================================================
--- trunk/refman-4.1/introduction.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-4.1/introduction.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -1776,13 +1776,13 @@
             <listitem>
               <para>
                 String comparisons are case-insensitive by default, with
-                sort ordering determined by the current character set
-                (cp1252 Latin1 by default). If you don't like this, you
-                should declare your columns with the
-                <literal>BINARY</literal> attribute or use the
-                <literal>BINARY</literal> cast, which causes comparisons
-                to be done using the underlying character code values
-                rather then a lexical ordering.
+                sort ordering determined by the current character set,
+                which is <literal>latin1</literal> (cp1252 West
+                European) by default. If you don't like this, you should
+                declare your columns with the <literal>BINARY</literal>
+                attribute or use the <literal>BINARY</literal> cast,
+                which causes comparisons to be done using the underlying
+                character code values rather then a lexical ordering.
               </para>
 
               <indexterm>

Modified: trunk/refman-4.1/language-structure.xml
===================================================================
--- trunk/refman-4.1/language-structure.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-4.1/language-structure.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -1295,11 +1295,11 @@
       &lsquo;<literal>.</literal>&rsquo;,
       &lsquo;<literal>_</literal>&rsquo;, and
       &lsquo;<literal>$</literal>&rsquo;. The default character set is
-      cp1252 (Latin1). This may be changed with the
-      <option>--default-character-set</option> option to
-      <command>mysqld</command>. See <xref linkend="character-sets"/>.
-      User variable names are not case sensitive beginning with MySQL
-      5.0. Before that, they are case sensitive.
+      <literal>latin1</literal> (cp1252 West European). This may be
+      changed with the <option>--default-character-set</option> option
+      to <command>mysqld</command>. See
+      <xref linkend="character-sets"/>. User variable names are case
+      sensitive prior to MySQL 5.0.
     </para>
 
     <para>

Modified: trunk/refman-4.1/sql-syntax.xml
===================================================================
--- trunk/refman-4.1/sql-syntax.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-4.1/sql-syntax.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -12208,6 +12208,116 @@
         <primary>SET OPTION</primary>
       </indexterm>
 
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>AUTOCOMMIT</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>BIG_TABLES</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>CHARACTER SET</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>FOREIGN_KEY_CHECKS</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>IDENTITY</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>INSERT_ID</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>LAST_INSERT_ID</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>NAMES</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>ONE_SHOT</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_AUTO_IS_NULL</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_BIG_SELECTS</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_BUFFER_SELECT</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_LOG_BIN</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_LOG_OFF</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_LOG_UPDATE</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_NOTES</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_QUOTE_SHOW_CREATE</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_SAFE_UPDATES</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_SELECT_LIMIT</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_WARNINGS</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>TIMESTAMP</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>UNIQUE_CHECKS</literal></secondary>
+      </indexterm>
+
       <remark role="help-category" condition="Data Manipulation"/>
 
       <remark role="help-topic" condition="SET"/>
@@ -12486,7 +12596,8 @@
             and <literal>character_set_results</literal> are set to the
             given character set, and
             <literal>character_set_connection</literal> to the value of
-            <literal>character_set_database</literal>.
+            <literal>character_set_database</literal>. See
+            <xref linkend="charset-connection"/>.
           </para>
 
           <para>
@@ -12584,7 +12695,8 @@
             <literal>character_set_connection</literal> to
             <literal>charset_name</literal> also sets
             <literal>collation_connection</literal> to the default
-            collation for <literal>charset_name</literal>.
+            collation for <literal>charset_name</literal>. See
+            <xref linkend="charset-connection"/>.
           </para>
 
           <para>

Modified: trunk/refman-5.0/charset.xml
===================================================================
--- trunk/refman-5.0/charset.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-5.0/charset.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -40,6 +40,16 @@
   </remark>
 
   <para>
+    MySQL includes character set support that enables you to store data
+    using a variety of character sets and perform comparisons according
+    to a variety of collations. You can specify character sets at the
+    server, database, table, and column level. MySQL supports the use of
+    character sets for the <literal>MyISAM</literal>,
+    <literal>MEMORY</literal>, and <literal>InnoDB</literal> storage
+    engines.
+  </para>
+
+  <para>
     This chapter discusses the following topics:
   </para>
 
@@ -53,13 +63,13 @@
 
     <listitem>
       <para>
-        The multiple-level default system
+        The multiple-level default system for character set assignment
       </para>
     </listitem>
 
     <listitem>
       <para>
-        Character set syntax
+        Syntax for specifying character sets and collations
       </para>
     </listitem>
 
@@ -77,18 +87,31 @@
 
     <listitem>
       <para>
-        The meaning of each individual character set and collation
+        The character sets and collations that are available, with notes
       </para>
     </listitem>
 
   </itemizedlist>
 
   <para>
-    Character set support in MySQL &current-series; is included in the
-    <literal>MyISAM</literal>, <literal>MEMORY</literal>, and
-    <literal>InnoDB</literal> storage engines.
+    Character set issues affect data storage, but also communication
+    between client programs and the MySQL server. If you want the client
+    program to communicate with the server using a character set
+    different from the default, you'll need to indicate which one. For
+    example, to use the <literal>utf8</literal> Unicode character set,
+    issue this statement after connecting to the server:
   </para>
 
+<programlisting>
+SET NAMES 'utf8';
+</programlisting>
+
+  <para>
+    For more information about character set-related issues in
+    client/server communication, see
+    <xref linkend="charset-connection"/>.
+  </para>
+
   <section id="charset-general">
 
     <title>&title-charset-general;</title>
@@ -148,18 +171,18 @@
       &lsquo;<literal>B</literal>&rsquo; but whole alphabets, sometimes
       multiple alphabets or eastern writing systems with thousands of
       characters, along with many special symbols and punctuation marks.
-      Also in real life, most collations have many rules: not just case
-      insensitivity but also accent insensitivity (an
-      <quote>accent</quote> is a mark attached to a character as in
-      German &lsquo;<literal>Ö</literal>&rsquo;) and multiple-character
-      mappings (such as the rule that
+      Also in real life, most collations have many rules, not just for
+      whether to distinguish lettercase, but also for whether to
+      distinguish accents (an <quote>accent</quote> is a mark attached
+      to a character as in German &lsquo;<literal>Ö</literal>&rsquo;),
+      and for multiple-character mappings (such as the rule that
       &lsquo;<literal>Ö</literal>&rsquo; =
       &lsquo;<literal>OE</literal>&rsquo; in one of the two German
       collations).
     </para>
 
     <para>
-      MySQL &current-series; can do these things for you:
+      MySQL can do these things for you:
     </para>
 
     <itemizedlist>
@@ -193,12 +216,11 @@
     </itemizedlist>
 
     <para>
-      In these respects, not only is MySQL &current-series; far more
-      flexible than versions of MySQL prior to 4.1, it also is far ahead
-      of most other database management systems. However, to use these
-      features effectively, you need to know what character sets and
-      collations are available, how to change the defaults, and how they
-      affect the behavior of string operators and functions.
+      In these respects, MySQL is far ahead of most other database
+      management systems. However, to use these features effectively,
+      you need to know what character sets and collations are available,
+      how to change the defaults, and how they affect the behavior of
+      string operators and functions.
     </para>
 
   </section>
@@ -210,7 +232,8 @@
     <para>
       The MySQL server can support multiple character sets. To list the
       available character sets, use the <literal>SHOW CHARACTER
-      SET</literal> statement:
+      SET</literal> statement. A partial listing follows. For more
+      complete information, see <xref linkend="charset-charsets"/>.
     </para>
 
 <programlisting>
@@ -242,22 +265,14 @@
 </programlisting>
 
     <para>
-      (For a complete listing, see <xref linkend="charset-charsets"/>.)
-    </para>
-
-    <para>
       Any given character set always has at least one collation. It may
-      have several collations.
+      have several collations. To list the collations for a character
+      set, use the <literal>SHOW COLLATION</literal> statement. For
+      example, to see the collations for the <literal>latin1</literal>
+      (cp1252 West European) character set, use this statement to find
+      those collation names that begin with <literal>latin1</literal>:
     </para>
 
-    <para>
-      To list the collations for a character set, use the <literal>SHOW
-      COLLATION</literal> statement. For example, to see the collations
-      for the <literal>latin1</literal> (<quote>ISO-8859-1 West
-      European</quote>) character set, use this statement to find those
-      collation names that begin with <literal>latin1</literal>:
-    </para>
-
     <remark role="note">
       Please do not cut this list.
     </remark>
@@ -345,7 +360,9 @@
           Each character set has one collation that is the
           <emphasis>default collation</emphasis>. For example, the
           default collation for <literal>latin1</literal> is
-          <literal>latin1_swedish_ci</literal>.
+          <literal>latin1_swedish_ci</literal>. The output for
+          <literal>SHOW CHARACTER SET</literal> indicates which
+          collation is the default for each displayed character set.
         </para>
       </listitem>
 
@@ -381,38 +398,15 @@
       <title>&title-charset-server;</title>
 
       <para>
-        The MySQL Server has a server character set and a server
-        collation, neither of which may be null.
+        MySQL Server has a server character set and a server collation.
+        These can be set at server startup and changed at runtime.
       </para>
 
       <para>
-        MySQL determines the server character set and server collation
-        as follows:
-      </para>
-
-      <itemizedlist>
-
-        <listitem>
-          <para>
-            According to the option settings in effect when the server
-            starts
-          </para>
-        </listitem>
-
-        <listitem>
-          <para>
-            According to the values set at runtime
-          </para>
-        </listitem>
-
-      </itemizedlist>
-
-      <para>
-        At the server level, the decision is simple. The server
-        character set and collation depend initially on the options that
-        you use when you start <command>mysqld</command>. You can use
-        <option>--default-character-set</option> for the character set,
-        and along with it you can add
+        Initially, the server character set and collation depend on the
+        options that you use when you start <command>mysqld</command>.
+        You can use <option>--default-character-set</option> for the
+        character set. Along with it you can add
         <option>--default-collation</option> for the collation. If you
         don't specify a character set, that is the same as saying
         <option>--default-character-set=latin1</option>. If you specify
@@ -460,9 +454,9 @@
       </para>
 
       <para>
-        The current server character set and collation are available as
-        the values of the <literal>character_set_server</literal> and
-        <literal>collation_server</literal> system variables. These
+        The current server character set and collation can be determined
+        from the values of the <literal>character_set_server</literal>
+        and <literal>collation_server</literal> system variables. These
         variables can be changed at runtime.
       </para>
 
@@ -474,10 +468,9 @@
 
       <para>
         Every database has a database character set and a database
-        collation, which may not be null. The <literal>CREATE
-        DATABASE</literal> and <literal>ALTER DATABASE</literal>
-        statements have optional clauses for specifying the database
-        character set and collation:
+        collation. The <literal>CREATE DATABASE</literal> and
+        <literal>ALTER DATABASE</literal> statements have optional
+        clauses for specifying the database character set and collation:
       </para>
 
 <programlisting>
@@ -491,17 +484,28 @@
 </programlisting>
 
       <para>
+        The keyword <literal>SCHEMA</literal> can be used instead of
+        <literal>DATABASE</literal>.
+      </para>
+
+      <para>
+        The <literal>CHARACTER SET</literal> and
+        <literal>COLLATE</literal> clauses make it possible to create
+        databases with different character sets and collations on the
+        same MySQL server.
+      </para>
+
+      <para>
         Example:
       </para>
 
 <programlisting>
-CREATE DATABASE <replaceable>db_name</replaceable>
-    DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
+CREATE DATABASE <replaceable>db_name</replaceable> CHARACTER SET latin1 COLLATE latin1_swedish_ci;
 </programlisting>
 
       <para>
         MySQL chooses the database character set and database collation
-        thus:
+        in the following manner:
       </para>
 
       <itemizedlist>
@@ -544,15 +548,6 @@
       </itemizedlist>
 
       <para>
-        MySQL's <literal>CREATE DATABASE ... DEFAULT CHARACTER SET
-        ...</literal> syntax is analogous to the standard SQL
-        <literal>CREATE SCHEMA ... CHARACTER SET ...</literal> syntax.
-        Because of this, it is possible to create databases with
-        different character sets and collations on the same MySQL
-        server.
-      </para>
-
-      <para>
         The database character set and collation are used as default
         values if the table character set and collation are not
         specified in <literal>CREATE TABLE</literal> statements. They
@@ -560,13 +555,13 @@
       </para>
 
       <para>
-        The character set and collation for the default database are
-        available as the values of the
+        The character set and collation for the default database can be
+        determined from the values of the
         <literal>character_set_database</literal> and
         <literal>collation_database</literal> system variables. The
         server sets these variables whenever the default database
         changes. If there is no default database, the variables have the
-        same value as the corresponding server-level variables,
+        same value as the corresponding server-level system variables,
         <literal>character_set_server</literal> and
         <literal>collation_server</literal>.
       </para>
@@ -578,10 +573,10 @@
       <title>&title-charset-table;</title>
 
       <para>
-        Every table has a table character set and a table collation,
-        which may not be null. The <literal>CREATE TABLE</literal> and
-        <literal>ALTER TABLE</literal> statements have optional clauses
-        for specifying the table character set and collation:
+        Every table has a table character set and a table collation. The
+        <literal>CREATE TABLE</literal> and <literal>ALTER
+        TABLE</literal> statements have optional clauses for specifying
+        the table character set and collation:
       </para>
 
 <programlisting>
@@ -597,8 +592,7 @@
       </para>
 
 <programlisting>
-CREATE TABLE t1 ( ... )
-    DEFAULT CHARACTER SET latin1 COLLATE latin1_danish_ci;
+CREATE TABLE t1 ( ... ) CHARACTER SET latin1 COLLATE latin1_danish_ci;
 </programlisting>
 
       <para>
@@ -663,9 +657,8 @@
         Every <quote>character</quote> column (that is, a column of type
         <literal>CHAR</literal>, <literal>VARCHAR</literal>, or
         <literal>TEXT</literal>) has a column character set and a column
-        collation, which may not be null. Column definition syntax has
-        optional clauses for specifying the column character set and
-        collation:
+        collation. Column definition syntax has optional clauses for
+        specifying the column character set and collation:
       </para>
 
 <programlisting>
@@ -803,11 +796,11 @@
 
       <para>
         We have a column with a default character set and a default
-        collation. In this circumstance, MySQL looks up to the table
-        level for inspiration in determining the column character set
-        and collation. So, the character set for column
-        <literal>c1</literal> is <literal>latin1</literal> and its
-        collation is <literal>latin1_danish_ci</literal>.
+        collation. In this circumstance, MySQL checks the table level to
+        determine the column character set and collation. Consequently,
+        the character set for column <literal>c1</literal> is
+        <literal>latin1</literal> and its collation is
+        <literal>latin1_danish_ci</literal>.
       </para>
 
       <para>
@@ -828,12 +821,12 @@
       <para>
         We create a column without specifying its character set and
         collation. We're also not specifying a character set and a
-        collation at the table level. In this circumstance, MySQL looks
-        up to the database level for inspiration. (The database's
-        settings become the table's settings, and thereafter become the
-        column's setting.) So, the character set for column
-        <literal>c1</literal> is <literal>latin2</literal> and its
-        collation is <literal>latin2_czech_ci</literal>.
+        collation at the table level. In this circumstance, MySQL checks
+        the database level to determine the table settings, which
+        thereafter become the column settings.) Consequently, the
+        character set for column <literal>c1</literal> is
+        <literal>latin2</literal> and its collation is
+        <literal>latin2_czech_ci</literal>.
       </para>
 
     </section>
@@ -842,6 +835,16 @@
 
       <title>&title-charset-connection;</title>
 
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>CHARACTER SET</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>NAMES</literal></secondary>
+      </indexterm>
+
       <para>
         Several character set and collation system variables relate to a
         client's interaction with the server. Some of these have been
@@ -852,28 +855,29 @@
 
         <listitem>
           <para>
-            The server character set and collation are available as the
-            values of the <literal>character_set_server</literal> and
-            <literal>collation_server</literal> variables.
+            The server character set and collation can be determined
+            from the values of the
+            <literal>character_set_server</literal> and
+            <literal>collation_server</literal> system variables.
           </para>
         </listitem>
 
         <listitem>
           <para>
-            The character set and collation of the default database are
-            available as the values of the
+            The character set and collation of the default database can
+            be determined from the values of the
             <literal>character_set_database</literal> and
-            <literal>collation_database</literal> variables.
+            <literal>collation_database</literal> system variables.
           </para>
         </listitem>
 
       </itemizedlist>
 
       <para>
-        Additional character set and collation variables are involved in
-        handling traffic for the connection between a client and the
-        server. Every client has connection-related character set and
-        collation variables.
+        Additional character set and collation system variables are
+        involved in handling traffic for the connection between a client
+        and the server. Every client has connection-related character
+        set and collation system variables.
       </para>
 
       <para>
@@ -890,35 +894,37 @@
 
         <listitem>
           <para>
-            What character set is the query in when it leaves the
+            What character set is the statement in when it leaves the
             client?
           </para>
 
           <para>
             The server takes the <literal>character_set_client</literal>
-            variable to be the character set in which queries are sent
-            by the client.
+            system variable to be the character set in which statements
+            are sent by the client.
           </para>
         </listitem>
 
         <listitem>
           <para>
-            What character set should the server translate a query to
-            after receiving it?
+            What character set should the server translate a statement
+            to after receiving it?
           </para>
 
           <para>
-            For this, <literal>character_set_connection</literal> and
-            <literal>collation_connection</literal> are used by the
-            server. It converts queries sent by the client from
+            For this, the server uses the
+            <literal>character_set_connection</literal> and
+            <literal>collation_connection</literal> system variables. It
+            converts statements sent by the client from
             <literal>character_set_client</literal> to
             <literal>character_set_connection</literal> (except for
             string literals that have an introducer such as
             <literal>_latin1</literal> or <literal>_utf8</literal>).
             <literal>collation_connection</literal> is important for
             comparisons of literal strings. For comparisons of strings
-            with column values, it does not matter because columns have
-            a higher collation precedence.
+            with column values, <literal>collation_connection</literal>
+            does not matter because columns have their own collation,
+            which has a higher collation precedence.
           </para>
         </listitem>
 
@@ -929,7 +935,7 @@
           </para>
 
           <para>
-            The <literal>character_set_results</literal> variable
+            The <literal>character_set_results</literal> system variable
             indicates the character set in which the server returns
             query results to the client. This includes result data such
             as column values, and result metadata such as column names.
@@ -940,8 +946,8 @@
 
       <para>
         You can fine-tune the settings for these variables, or you can
-        depend on the defaults (in which case, you can skip this
-        section).
+        depend on the defaults (in which case, you can skip the rest of
+        this section).
       </para>
 
       <para>
@@ -955,14 +961,15 @@
 </programlisting>
 
       <para>
-        <literal>SET NAMES</literal> indicates what is in the SQL
-        statements that the client sends. Thus, <literal>SET NAMES
-        'cp1251'</literal> tells the server <quote>future incoming
-        messages from this client are in character set
-        <literal>cp1251</literal>.</quote> It also specifies the
-        character set for results that the server sends back to the
-        client. (For example, it indicates what character set column
-        values are if you use a <literal>SELECT</literal> statement.)
+        <literal>SET NAMES</literal> indicates what character set the
+        client will use to send SQL statements to the server. Thus,
+        <literal>SET NAMES 'cp1251'</literal> tells the server
+        <quote>future incoming messages from this client are in
+        character set <literal>cp1251</literal>.</quote> It also
+        specifies the character set that the server should use for
+        sending results back to the client. (For example, it indicates
+        what character set to use for column values if you use a
+        <literal>SELECT</literal> statement.)
       </para>
 
       <para>
@@ -978,16 +985,17 @@
 
       <para>
         Setting <literal>character_set_connection</literal> to
-        <literal>x</literal> also sets
+        <replaceable>x</replaceable> also sets
         <literal>collation_connection</literal> to the default collation
-        for <literal>x</literal>.
+        for <replaceable>x</replaceable>.
       </para>
 
       <para>
-        <literal>SET CHARACTER SET</literal> is similar but sets the
-        connection character set and collation to be those of the
-        default database. A <literal>SET CHARACTER SET x</literal>
-        statement is equivalent to these three statements:
+        <literal>SET CHARACTER SET</literal> is similar to <literal>SET
+        NAMES</literal> but sets the connection character set and
+        collation to be those of the default database. A <literal>SET
+        CHARACTER SET <replaceable>x</replaceable></literal> statement
+        is equivalent to these three statements:
       </para>
 
 <programlisting>
@@ -997,13 +1005,19 @@
 </programlisting>
 
       <para>
+        Setting <literal>collation_connection</literal> also sets
+        <literal>character_set_connection</literal> to the character set
+        associated with the collation.
+      </para>
+
+      <para>
         When a client connects, it sends to the server the name of the
-        character set that it wants to use. The server sets the
-        <literal>character_set_client</literal>,
+        character set that it wants to use. The server uses the name to
+        set the <literal>character_set_client</literal>,
         <literal>character_set_results</literal>, and
-        <literal>character_set_connection</literal> variables to that
-        character set. (In effect, the server performs a <literal>SET
-        NAMES</literal> operation using the character set.)
+        <literal>character_set_connection</literal> system variables. In
+        effect, the server performs a <literal>SET NAMES</literal>
+        operation using the character set name.
       </para>
 
       <para>
@@ -1014,7 +1028,7 @@
         setting to your <command>mysql</command> statement line, or in
         your option file. For example, the following option file setting
         changes the three character set variables set to
-        <literal>koi8r</literal> each time you run
+        <literal>koi8r</literal> each time you invoke
         <command>mysql</command>:
       </para>
 
@@ -1032,15 +1046,16 @@
         <literal>column1</literal> using the character set that the
         client specified when it connected. On the other hand, if you
         say <literal>SET NAMES 'latin1'</literal> or <literal>SET
-        CHARACTER SET latin1</literal>, then just before sending results
-        back, the server converts the <literal>latin2</literal> values
-        to <literal>latin1</literal>. Conversion may be lossy if there
-        are characters that are not in both character sets.
+        CHARACTER SET latin1</literal> before issuing the
+        <literal>SELECT</literal> statement, the server converts the
+        <literal>latin2</literal> values to <literal>latin1</literal>
+        just before sending results back. Conversion may be lossy if
+        there are characters that are not in both character sets.
       </para>
 
       <para>
-        If you do not want the server to perform any conversion, set
-        <literal>character_set_results</literal> to
+        If you do not want the server to perform any conversion of
+        result sets, set <literal>character_set_results</literal> to
         <literal>NULL</literal>:
       </para>
 
@@ -1048,6 +1063,12 @@
 mysql&gt; <userinput>SET character_set_results = NULL;</userinput>
 </programlisting>
 
+      <para>
+        <emphasis role="bold">Note</emphasis>: Currently, UCS-2 cannot
+        yet be used as a client character set, which means that
+        <literal>SET NAMES 'ucs2'</literal> does not work.
+      </para>
+
     </section>
 
     <section id="charset-literal">
@@ -1056,7 +1077,7 @@
 
       <para>
         Every character string literal has a character set and a
-        collation, which may not be null.
+        collation.
       </para>
 
       <para>

Modified: trunk/refman-5.0/database-administration.xml
===================================================================
--- trunk/refman-5.0/database-administration.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-5.0/database-administration.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -22105,9 +22105,10 @@
       </indexterm>
 
       <para>
-        By default, MySQL uses the cp1252 (Latin1) character set with
-        sorting according to Swedish/Finnish rules. These defaults are
-        suitable for the United States and most of Western Europe.
+        By default, MySQL uses the <literal>latin1</literal> (cp1252
+        West European) character set with sorting according to
+        Swedish/Finnish rules. These defaults are suitable for the
+        United States and most of Western Europe.
       </para>
 
       <para>

Modified: trunk/refman-5.0/functions.xml
===================================================================
--- trunk/refman-5.0/functions.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-5.0/functions.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -285,7 +285,8 @@
 
       <para>
         By default, string comparisons are not case sensitive and use
-        the current character set (cp1252 Latin1 by default, which also
+        the current character set. The default is
+        <literal>latin1</literal> (cp1252 West European), which also
         works well for English).
       </para>
 
@@ -2870,7 +2871,8 @@
         <para>
           Returns the string <replaceable>str</replaceable> with all
           characters changed to lowercase according to the current
-          character set mapping (the default is cp1252 Latin1).
+          character set mapping. The default is
+          <literal>latin1</literal> (cp1252 West European).
         </para>
 
         <remark role="help-description-end"/>
@@ -3886,7 +3888,8 @@
         <para>
           Returns the string <replaceable>str</replaceable> with all
           characters changed to uppercase according to the current
-          character set mapping (the default is cp1252 Latin1).
+          character set mapping. The default is
+          <literal>latin1</literal> (cp1252 West European).
         </para>
 
         <remark role="help-description-end"/>
@@ -4315,10 +4318,10 @@
 
           <para>
             <literal>REGEXP</literal> and <literal>RLIKE</literal> use
-            the current character set (cp1252 Latin1 by default) when
-            deciding the type of a character.
-            <emphasis role="bold">Warning</emphasis>: These operators
-            are not multi-byte safe.
+            the current character set when deciding the type of a
+            character. The default is <literal>latin1</literal> (cp1252
+            West European). <emphasis role="bold">Warning</emphasis>:
+            These operators are not multi-byte safe.
           </para>
         </listitem>
 

Modified: trunk/refman-5.0/installing.xml
===================================================================
--- trunk/refman-5.0/installing.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-5.0/installing.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -7968,9 +7968,9 @@
               <secondary>--with-collation</secondary>
             </indexterm>
 
-            By default, MySQL uses the <literal>latin1</literal>
-            (cp1252) character set. To change the default set, use the
-            <option>--with-charset</option> option:
+            By default, MySQL uses the <literal>latin1</literal> (cp1252
+            West European) character set. To change the default set, use
+            the <option>--with-charset</option> option:
           </para>
 
 <programlisting>
@@ -11403,11 +11403,11 @@
               <para>
                 On Windows, one <literal>root</literal> account is
                 created; this account allows connecting from the local
-                host only. The Windows installer will
-                optionally create an account allowing for connections
-                from any host only if the user selects the
-                <guilabel>Enable root access from remote
-                  machines</guilabel> option during installation.
+                host only. The Windows installer will optionally create
+                an account allowing for connections from any host only
+                if the user selects the <guilabel>Enable root access
+                from remote machines</guilabel> option during
+                installation.
               </para>
             </listitem>
 

Modified: trunk/refman-5.0/introduction.xml
===================================================================
--- trunk/refman-5.0/introduction.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-5.0/introduction.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -1385,13 +1385,13 @@
             <listitem>
               <para>
                 String comparisons are case-insensitive by default, with
-                sort ordering determined by the current character set
-                (cp1252 Latin1 by default). If you don't like this, you
-                should declare your columns with the
-                <literal>BINARY</literal> attribute or use the
-                <literal>BINARY</literal> cast, which causes comparisons
-                to be done using the underlying character code values
-                rather then a lexical ordering.
+                sort ordering determined by the current character set,
+                which is <literal>latin1</literal> (cp1252 West
+                European) by default. If you don't like this, you should
+                declare your columns with the <literal>BINARY</literal>
+                attribute or use the <literal>BINARY</literal> cast,
+                which causes comparisons to be done using the underlying
+                character code values rather then a lexical ordering.
               </para>
 
               <indexterm>

Modified: trunk/refman-5.0/language-structure.xml
===================================================================
--- trunk/refman-5.0/language-structure.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-5.0/language-structure.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -1279,10 +1279,11 @@
       &lsquo;<literal>.</literal>&rsquo;,
       &lsquo;<literal>_</literal>&rsquo;, and
       &lsquo;<literal>$</literal>&rsquo;. The default character set is
-      cp1252 (Latin1). This may be changed with the
-      <option>--default-character-set</option> option to
-      <command>mysqld</command>. See <xref linkend="character-sets"/>.
-      User variable names are not case sensitive.
+      <literal>latin1</literal> (cp1252 West European). This may be
+      changed with the <option>--default-character-set</option> option
+      to <command>mysqld</command>. See
+      <xref linkend="character-sets"/>. User variable names are not case
+      sensitive.
     </para>
 
     <para>

Modified: trunk/refman-5.0/sql-syntax.xml
===================================================================
--- trunk/refman-5.0/sql-syntax.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-5.0/sql-syntax.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -13442,6 +13442,116 @@
         <primary>SET OPTION</primary>
       </indexterm>
 
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>AUTOCOMMIT</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>BIG_TABLES</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>CHARACTER SET</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>FOREIGN_KEY_CHECKS</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>IDENTITY</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>INSERT_ID</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>LAST_INSERT_ID</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>NAMES</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>ONE_SHOT</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_AUTO_IS_NULL</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_BIG_SELECTS</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_BUFFER_SELECT</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_LOG_BIN</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_LOG_OFF</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_LOG_UPDATE</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_NOTES</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_QUOTE_SHOW_CREATE</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_SAFE_UPDATES</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_SELECT_LIMIT</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_WARNINGS</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>TIMESTAMP</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>UNIQUE_CHECKS</literal></secondary>
+      </indexterm>
+
       <remark role="help-category" condition="Data Manipulation"/>
 
       <remark role="help-topic" condition="SET"/>
@@ -13716,7 +13826,8 @@
             <literal>character_set_results</literal> are set to the
             given character set, and
             <literal>character_set_connection</literal> to the value of
-            <literal>character_set_database</literal>.
+            <literal>character_set_database</literal>. See
+            <xref linkend="charset-connection"/>.
           </para>
 
           <para>
@@ -13852,7 +13963,8 @@
             <literal>character_set_connection</literal> to
             <literal>charset_name</literal> also sets
             <literal>collation_connection</literal> to the default
-            collation for <literal>charset_name</literal>.
+            collation for <literal>charset_name</literal>. See
+            <xref linkend="charset-connection"/>.
           </para>
 
           <para>

Modified: trunk/refman-5.1/charset.xml
===================================================================
--- trunk/refman-5.1/charset.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-5.1/charset.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -40,6 +40,16 @@
   </remark>
 
   <para>
+    MySQL includes character set support that enables you to store data
+    using a variety of character sets and perform comparisons according
+    to a variety of collations. You can specify character sets at the
+    server, database, table, and column level. MySQL supports the use of
+    character sets for the <literal>MyISAM</literal>,
+    <literal>MEMORY</literal>, and <literal>InnoDB</literal> storage
+    engines.
+  </para>
+
+  <para>
     This chapter discusses the following topics:
   </para>
 
@@ -53,13 +63,13 @@
 
     <listitem>
       <para>
-        The multiple-level default system
+        The multiple-level default system for character set assignment
       </para>
     </listitem>
 
     <listitem>
       <para>
-        Character set syntax
+        Syntax for specifying character sets and collations
       </para>
     </listitem>
 
@@ -77,18 +87,31 @@
 
     <listitem>
       <para>
-        The meaning of each individual character set and collation
+        The character sets and collations that are available, with notes
       </para>
     </listitem>
 
   </itemizedlist>
 
   <para>
-    Character set support in MySQL &current-series; is included in the
-    <literal>MyISAM</literal>, <literal>MEMORY</literal>, and
-    <literal>InnoDB</literal> storage engines.
+    Character set issues affect data storage, but also communication
+    between client programs and the MySQL server. If you want the client
+    program to communicate with the server using a character set
+    different from the default, you'll need to indicate which one. For
+    example, to use the <literal>utf8</literal> Unicode character set,
+    issue this statement after connecting to the server:
   </para>
 
+<programlisting>
+SET NAMES 'utf8';
+</programlisting>
+
+  <para>
+    For more information about character set-related issues in
+    client/server communication, see
+    <xref linkend="charset-connection"/>.
+  </para>
+
   <section id="charset-general">
 
     <title>&title-charset-general;</title>
@@ -148,18 +171,18 @@
       &lsquo;<literal>B</literal>&rsquo; but whole alphabets, sometimes
       multiple alphabets or eastern writing systems with thousands of
       characters, along with many special symbols and punctuation marks.
-      Also in real life, most collations have many rules: not just case
-      insensitivity but also accent insensitivity (an
-      <quote>accent</quote> is a mark attached to a character as in
-      German &lsquo;<literal>Ö</literal>&rsquo;) and multiple-character
-      mappings (such as the rule that
+      Also in real life, most collations have many rules, not just for
+      whether to distinguish lettercase, but also for whether to
+      distinguish accents (an <quote>accent</quote> is a mark attached
+      to a character as in German &lsquo;<literal>Ö</literal>&rsquo;),
+      and for multiple-character mappings (such as the rule that
       &lsquo;<literal>Ö</literal>&rsquo; =
       &lsquo;<literal>OE</literal>&rsquo; in one of the two German
       collations).
     </para>
 
     <para>
-      MySQL &current-series; can do these things for you:
+      MySQL can do these things for you:
     </para>
 
     <itemizedlist>
@@ -193,12 +216,11 @@
     </itemizedlist>
 
     <para>
-      In these respects, not only is MySQL &current-series; far more
-      flexible than versions of MySQL prior to 4.1, it also is far ahead
-      of most other database management systems. However, to use these
-      features effectively, you need to know what character sets and
-      collations are available, how to change the defaults, and how they
-      affect the behavior of string operators and functions.
+      In these respects, MySQL is far ahead of most other database
+      management systems. However, to use these features effectively,
+      you need to know what character sets and collations are available,
+      how to change the defaults, and how they affect the behavior of
+      string operators and functions.
     </para>
 
   </section>
@@ -210,7 +232,8 @@
     <para>
       The MySQL server can support multiple character sets. To list the
       available character sets, use the <literal>SHOW CHARACTER
-      SET</literal> statement:
+      SET</literal> statement. A partial listing follows. For more
+      complete information, see <xref linkend="charset-charsets"/>.
     </para>
 
 <programlisting>
@@ -242,22 +265,14 @@
 </programlisting>
 
     <para>
-      (For a complete listing, see <xref linkend="charset-charsets"/>.)
-    </para>
-
-    <para>
       Any given character set always has at least one collation. It may
-      have several collations.
+      have several collations. To list the collations for a character
+      set, use the <literal>SHOW COLLATION</literal> statement. For
+      example, to see the collations for the <literal>latin1</literal>
+      (cp1252 West European) character set, use this statement to find
+      those collation names that begin with <literal>latin1</literal>:
     </para>
 
-    <para>
-      To list the collations for a character set, use the <literal>SHOW
-      COLLATION</literal> statement. For example, to see the collations
-      for the <literal>latin1</literal> (<quote>ISO-8859-1 West
-      European</quote>) character set, use this statement to find those
-      collation names that begin with <literal>latin1</literal>:
-    </para>
-
     <remark role="note">
       Please do not cut this list.
     </remark>
@@ -345,7 +360,9 @@
           Each character set has one collation that is the
           <emphasis>default collation</emphasis>. For example, the
           default collation for <literal>latin1</literal> is
-          <literal>latin1_swedish_ci</literal>.
+          <literal>latin1_swedish_ci</literal>. The output for
+          <literal>SHOW CHARACTER SET</literal> indicates which
+          collation is the default for each displayed character set.
         </para>
       </listitem>
 
@@ -381,38 +398,15 @@
       <title>&title-charset-server;</title>
 
       <para>
-        The MySQL Server has a server character set and a server
-        collation, neither of which may be null.
+        MySQL Server has a server character set and a server collation.
+        These can be set at server startup and changed at runtime.
       </para>
 
       <para>
-        MySQL determines the server character set and server collation
-        as follows:
-      </para>
-
-      <itemizedlist>
-
-        <listitem>
-          <para>
-            According to the option settings in effect when the server
-            starts
-          </para>
-        </listitem>
-
-        <listitem>
-          <para>
-            According to the values set at runtime
-          </para>
-        </listitem>
-
-      </itemizedlist>
-
-      <para>
-        At the server level, the decision is simple. The server
-        character set and collation depend initially on the options that
-        you use when you start <command>mysqld</command>. You can use
-        <option>--default-character-set</option> for the character set,
-        and along with it you can add
+        Initially, the server character set and collation depend on the
+        options that you use when you start <command>mysqld</command>.
+        You can use <option>--default-character-set</option> for the
+        character set. Along with it you can add
         <option>--default-collation</option> for the collation. If you
         don't specify a character set, that is the same as saying
         <option>--default-character-set=latin1</option>. If you specify
@@ -460,9 +454,9 @@
       </para>
 
       <para>
-        The current server character set and collation are available as
-        the values of the <literal>character_set_server</literal> and
-        <literal>collation_server</literal> system variables. These
+        The current server character set and collation can be determined
+        from the values of the <literal>character_set_server</literal>
+        and <literal>collation_server</literal> system variables. These
         variables can be changed at runtime.
       </para>
 
@@ -474,10 +468,9 @@
 
       <para>
         Every database has a database character set and a database
-        collation, which may not be null. The <literal>CREATE
-        DATABASE</literal> and <literal>ALTER DATABASE</literal>
-        statements have optional clauses for specifying the database
-        character set and collation:
+        collation. The <literal>CREATE DATABASE</literal> and
+        <literal>ALTER DATABASE</literal> statements have optional
+        clauses for specifying the database character set and collation:
       </para>
 
 <programlisting>
@@ -491,17 +484,28 @@
 </programlisting>
 
       <para>
+        The keyword <literal>SCHEMA</literal> can be used instead of
+        <literal>DATABASE</literal>.
+      </para>
+
+      <para>
+        The <literal>CHARACTER SET</literal> and
+        <literal>COLLATE</literal> clauses make it possible to create
+        databases with different character sets and collations on the
+        same MySQL server.
+      </para>
+
+      <para>
         Example:
       </para>
 
 <programlisting>
-CREATE DATABASE <replaceable>db_name</replaceable>
-    DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
+CREATE DATABASE <replaceable>db_name</replaceable> CHARACTER SET latin1 COLLATE latin1_swedish_ci;
 </programlisting>
 
       <para>
         MySQL chooses the database character set and database collation
-        thus:
+        in the following manner:
       </para>
 
       <itemizedlist>
@@ -544,15 +548,6 @@
       </itemizedlist>
 
       <para>
-        MySQL's <literal>CREATE DATABASE ... DEFAULT CHARACTER SET
-        ...</literal> syntax is analogous to the standard SQL
-        <literal>CREATE SCHEMA ... CHARACTER SET ...</literal> syntax.
-        Because of this, it is possible to create databases with
-        different character sets and collations on the same MySQL
-        server.
-      </para>
-
-      <para>
         The database character set and collation are used as default
         values if the table character set and collation are not
         specified in <literal>CREATE TABLE</literal> statements. They
@@ -560,13 +555,13 @@
       </para>
 
       <para>
-        The character set and collation for the default database are
-        available as the values of the
+        The character set and collation for the default database can be
+        determined from the values of the
         <literal>character_set_database</literal> and
         <literal>collation_database</literal> system variables. The
         server sets these variables whenever the default database
         changes. If there is no default database, the variables have the
-        same value as the corresponding server-level variables,
+        same value as the corresponding server-level system variables,
         <literal>character_set_server</literal> and
         <literal>collation_server</literal>.
       </para>
@@ -578,10 +573,10 @@
       <title>&title-charset-table;</title>
 
       <para>
-        Every table has a table character set and a table collation,
-        which may not be null. The <literal>CREATE TABLE</literal> and
-        <literal>ALTER TABLE</literal> statements have optional clauses
-        for specifying the table character set and collation:
+        Every table has a table character set and a table collation. The
+        <literal>CREATE TABLE</literal> and <literal>ALTER
+        TABLE</literal> statements have optional clauses for specifying
+        the table character set and collation:
       </para>
 
 <programlisting>
@@ -597,8 +592,7 @@
       </para>
 
 <programlisting>
-CREATE TABLE t1 ( ... )
-    DEFAULT CHARACTER SET latin1 COLLATE latin1_danish_ci;
+CREATE TABLE t1 ( ... ) CHARACTER SET latin1 COLLATE latin1_danish_ci;
 </programlisting>
 
       <para>
@@ -663,9 +657,8 @@
         Every <quote>character</quote> column (that is, a column of type
         <literal>CHAR</literal>, <literal>VARCHAR</literal>, or
         <literal>TEXT</literal>) has a column character set and a column
-        collation, which may not be null. Column definition syntax has
-        optional clauses for specifying the column character set and
-        collation:
+        collation. Column definition syntax has optional clauses for
+        specifying the column character set and collation:
       </para>
 
 <programlisting>
@@ -803,11 +796,11 @@
 
       <para>
         We have a column with a default character set and a default
-        collation. In this circumstance, MySQL looks up to the table
-        level for inspiration in determining the column character set
-        and collation. So, the character set for column
-        <literal>c1</literal> is <literal>latin1</literal> and its
-        collation is <literal>latin1_danish_ci</literal>.
+        collation. In this circumstance, MySQL checks the table level to
+        determine the column character set and collation. Consequently,
+        the character set for column <literal>c1</literal> is
+        <literal>latin1</literal> and its collation is
+        <literal>latin1_danish_ci</literal>.
       </para>
 
       <para>
@@ -828,12 +821,12 @@
       <para>
         We create a column without specifying its character set and
         collation. We're also not specifying a character set and a
-        collation at the table level. In this circumstance, MySQL looks
-        up to the database level for inspiration. (The database's
-        settings become the table's settings, and thereafter become the
-        column's setting.) So, the character set for column
-        <literal>c1</literal> is <literal>latin2</literal> and its
-        collation is <literal>latin2_czech_ci</literal>.
+        collation at the table level. In this circumstance, MySQL checks
+        the database level to determine the table settings, which
+        thereafter become the column settings.) Consequently, the
+        character set for column <literal>c1</literal> is
+        <literal>latin2</literal> and its collation is
+        <literal>latin2_czech_ci</literal>.
       </para>
 
     </section>
@@ -842,6 +835,16 @@
 
       <title>&title-charset-connection;</title>
 
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>CHARACTER SET</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>NAMES</literal></secondary>
+      </indexterm>
+
       <para>
         Several character set and collation system variables relate to a
         client's interaction with the server. Some of these have been
@@ -852,28 +855,29 @@
 
         <listitem>
           <para>
-            The server character set and collation are available as the
-            values of the <literal>character_set_server</literal> and
-            <literal>collation_server</literal> variables.
+            The server character set and collation can be determined
+            from the values of the
+            <literal>character_set_server</literal> and
+            <literal>collation_server</literal> system variables.
           </para>
         </listitem>
 
         <listitem>
           <para>
-            The character set and collation of the default database are
-            available as the values of the
+            The character set and collation of the default database can
+            be determined from the values of the
             <literal>character_set_database</literal> and
-            <literal>collation_database</literal> variables.
+            <literal>collation_database</literal> system variables.
           </para>
         </listitem>
 
       </itemizedlist>
 
       <para>
-        Additional character set and collation variables are involved in
-        handling traffic for the connection between a client and the
-        server. Every client has connection-related character set and
-        collation variables.
+        Additional character set and collation system variables are
+        involved in handling traffic for the connection between a client
+        and the server. Every client has connection-related character
+        set and collation system variables.
       </para>
 
       <para>
@@ -890,35 +894,37 @@
 
         <listitem>
           <para>
-            What character set is the query in when it leaves the
+            What character set is the statement in when it leaves the
             client?
           </para>
 
           <para>
             The server takes the <literal>character_set_client</literal>
-            variable to be the character set in which queries are sent
-            by the client.
+            system variable to be the character set in which statements
+            are sent by the client.
           </para>
         </listitem>
 
         <listitem>
           <para>
-            What character set should the server translate a query to
-            after receiving it?
+            What character set should the server translate a statement
+            to after receiving it?
           </para>
 
           <para>
-            For this, <literal>character_set_connection</literal> and
-            <literal>collation_connection</literal> are used by the
-            server. It converts queries sent by the client from
+            For this, the server uses the
+            <literal>character_set_connection</literal> and
+            <literal>collation_connection</literal> system variables. It
+            converts statements sent by the client from
             <literal>character_set_client</literal> to
             <literal>character_set_connection</literal> (except for
             string literals that have an introducer such as
             <literal>_latin1</literal> or <literal>_utf8</literal>).
             <literal>collation_connection</literal> is important for
             comparisons of literal strings. For comparisons of strings
-            with column values, it does not matter because columns have
-            a higher collation precedence.
+            with column values, <literal>collation_connection</literal>
+            does not matter because columns have their own collation,
+            which has a higher collation precedence.
           </para>
         </listitem>
 
@@ -929,7 +935,7 @@
           </para>
 
           <para>
-            The <literal>character_set_results</literal> variable
+            The <literal>character_set_results</literal> system variable
             indicates the character set in which the server returns
             query results to the client. This includes result data such
             as column values, and result metadata such as column names.
@@ -940,8 +946,8 @@
 
       <para>
         You can fine-tune the settings for these variables, or you can
-        depend on the defaults (in which case, you can skip this
-        section).
+        depend on the defaults (in which case, you can skip the rest of
+        this section).
       </para>
 
       <para>
@@ -955,14 +961,15 @@
 </programlisting>
 
       <para>
-        <literal>SET NAMES</literal> indicates what is in the SQL
-        statements that the client sends. Thus, <literal>SET NAMES
-        'cp1251'</literal> tells the server <quote>future incoming
-        messages from this client are in character set
-        <literal>cp1251</literal>.</quote> It also specifies the
-        character set for results that the server sends back to the
-        client. (For example, it indicates what character set column
-        values are if you use a <literal>SELECT</literal> statement.)
+        <literal>SET NAMES</literal> indicates what character set the
+        client will use to send SQL statements to the server. Thus,
+        <literal>SET NAMES 'cp1251'</literal> tells the server
+        <quote>future incoming messages from this client are in
+        character set <literal>cp1251</literal>.</quote> It also
+        specifies the character set that the server should use for
+        sending results back to the client. (For example, it indicates
+        what character set to use for column values if you use a
+        <literal>SELECT</literal> statement.)
       </para>
 
       <para>
@@ -978,16 +985,17 @@
 
       <para>
         Setting <literal>character_set_connection</literal> to
-        <literal>x</literal> also sets
+        <replaceable>x</replaceable> also sets
         <literal>collation_connection</literal> to the default collation
-        for <literal>x</literal>.
+        for <replaceable>x</replaceable>.
       </para>
 
       <para>
-        <literal>SET CHARACTER SET</literal> is similar but sets the
-        connection character set and collation to be those of the
-        default database. A <literal>SET CHARACTER SET x</literal>
-        statement is equivalent to these three statements:
+        <literal>SET CHARACTER SET</literal> is similar to <literal>SET
+        NAMES</literal> but sets the connection character set and
+        collation to be those of the default database. A <literal>SET
+        CHARACTER SET <replaceable>x</replaceable></literal> statement
+        is equivalent to these three statements:
       </para>
 
 <programlisting>
@@ -997,13 +1005,19 @@
 </programlisting>
 
       <para>
+        Setting <literal>collation_connection</literal> also sets
+        <literal>character_set_connection</literal> to the character set
+        associated with the collation.
+      </para>
+
+      <para>
         When a client connects, it sends to the server the name of the
-        character set that it wants to use. The server sets the
-        <literal>character_set_client</literal>,
+        character set that it wants to use. The server uses the name to
+        set the <literal>character_set_client</literal>,
         <literal>character_set_results</literal>, and
-        <literal>character_set_connection</literal> variables to that
-        character set. (In effect, the server performs a <literal>SET
-        NAMES</literal> operation using the character set.)
+        <literal>character_set_connection</literal> system variables. In
+        effect, the server performs a <literal>SET NAMES</literal>
+        operation using the character set name.
       </para>
 
       <para>
@@ -1014,7 +1028,7 @@
         setting to your <command>mysql</command> statement line, or in
         your option file. For example, the following option file setting
         changes the three character set variables set to
-        <literal>koi8r</literal> each time you run
+        <literal>koi8r</literal> each time you invoke
         <command>mysql</command>:
       </para>
 
@@ -1032,15 +1046,16 @@
         <literal>column1</literal> using the character set that the
         client specified when it connected. On the other hand, if you
         say <literal>SET NAMES 'latin1'</literal> or <literal>SET
-        CHARACTER SET latin1</literal>, then just before sending results
-        back, the server converts the <literal>latin2</literal> values
-        to <literal>latin1</literal>. Conversion may be lossy if there
-        are characters that are not in both character sets.
+        CHARACTER SET latin1</literal> before issuing the
+        <literal>SELECT</literal> statement, the server converts the
+        <literal>latin2</literal> values to <literal>latin1</literal>
+        just before sending results back. Conversion may be lossy if
+        there are characters that are not in both character sets.
       </para>
 
       <para>
-        If you do not want the server to perform any conversion, set
-        <literal>character_set_results</literal> to
+        If you do not want the server to perform any conversion of
+        result sets, set <literal>character_set_results</literal> to
         <literal>NULL</literal>:
       </para>
 
@@ -1048,6 +1063,12 @@
 mysql&gt; <userinput>SET character_set_results = NULL;</userinput>
 </programlisting>
 
+      <para>
+        <emphasis role="bold">Note</emphasis>: Currently, UCS-2 cannot
+        yet be used as a client character set, which means that
+        <literal>SET NAMES 'ucs2'</literal> does not work.
+      </para>
+
     </section>
 
     <section id="charset-literal">
@@ -1056,7 +1077,7 @@
 
       <para>
         Every character string literal has a character set and a
-        collation, which may not be null.
+        collation.
       </para>
 
       <para>

Modified: trunk/refman-5.1/database-administration.xml
===================================================================
--- trunk/refman-5.1/database-administration.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-5.1/database-administration.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -22046,9 +22046,10 @@
       </indexterm>
 
       <para>
-        By default, MySQL uses the cp1252 (Latin1) character set with
-        sorting according to Swedish/Finnish rules. These defaults are
-        suitable for the United States and most of Western Europe.
+        By default, MySQL uses the <literal>latin1</literal> (cp1252
+        West European) character set with sorting according to
+        Swedish/Finnish rules. These defaults are suitable for the
+        United States and most of Western Europe.
       </para>
 
       <para>

Modified: trunk/refman-5.1/functions.xml
===================================================================
--- trunk/refman-5.1/functions.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-5.1/functions.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -284,7 +284,8 @@
 
       <para>
         By default, string comparisons are not case sensitive and use
-        the current character set (cp1252 Latin1 by default, which also
+        the current character set. The default is
+        <literal>latin1</literal> (cp1252 West European), which also
         works well for English).
       </para>
 
@@ -2842,7 +2843,8 @@
         <para>
           Returns the string <replaceable>str</replaceable> with all
           characters changed to lowercase according to the current
-          character set mapping (the default is cp1252 Latin1).
+          character set mapping. The default is
+          <literal>latin1</literal> (cp1252 West European).
         </para>
 
         <remark role="help-description-end"/>
@@ -3858,7 +3860,8 @@
         <para>
           Returns the string <replaceable>str</replaceable> with all
           characters changed to uppercase according to the current
-          character set mapping (the default is cp1252 Latin1).
+          character set mapping. The default is
+          <literal>latin1</literal> (cp1252 West European).
         </para>
 
         <remark role="help-description-end"/>
@@ -4287,10 +4290,10 @@
 
           <para>
             <literal>REGEXP</literal> and <literal>RLIKE</literal> use
-            the current character set (cp1252 Latin1 by default) when
-            deciding the type of a character.
-            <emphasis role="bold">Warning</emphasis>: These operators
-            are not multi-byte safe.
+            the current character set when deciding the type of a
+            character. The default is <literal>latin1</literal> (cp1252
+            West European). <emphasis role="bold">Warning</emphasis>:
+            These operators are not multi-byte safe.
           </para>
         </listitem>
 

Modified: trunk/refman-5.1/installing.xml
===================================================================
--- trunk/refman-5.1/installing.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-5.1/installing.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -7961,9 +7961,9 @@
               <secondary>--with-collation</secondary>
             </indexterm>
 
-            By default, MySQL uses the <literal>latin1</literal>
-            (cp1252) character set. To change the default set, use the
-            <option>--with-charset</option> option:
+            By default, MySQL uses the <literal>latin1</literal> (cp1252
+            West European) character set. To change the default set, use
+            the <option>--with-charset</option> option:
           </para>
 
 <programlisting>

Modified: trunk/refman-5.1/introduction.xml
===================================================================
--- trunk/refman-5.1/introduction.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-5.1/introduction.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -1144,13 +1144,13 @@
             <listitem>
               <para>
                 String comparisons are case-insensitive by default, with
-                sort ordering determined by the current character set
-                (cp1252 Latin1 by default). If you don't like this, you
-                should declare your columns with the
-                <literal>BINARY</literal> attribute or use the
-                <literal>BINARY</literal> cast, which causes comparisons
-                to be done using the underlying character code values
-                rather then a lexical ordering.
+                sort ordering determined by the current character set,
+                which is <literal>latin1</literal> (cp1252 West
+                European) by default. If you don't like this, you should
+                declare your columns with the <literal>BINARY</literal>
+                attribute or use the <literal>BINARY</literal> cast,
+                which causes comparisons to be done using the underlying
+                character code values rather then a lexical ordering.
               </para>
 
               <indexterm>

Modified: trunk/refman-5.1/language-structure.xml
===================================================================
--- trunk/refman-5.1/language-structure.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-5.1/language-structure.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -1279,10 +1279,11 @@
       &lsquo;<literal>.</literal>&rsquo;,
       &lsquo;<literal>_</literal>&rsquo;, and
       &lsquo;<literal>$</literal>&rsquo;. The default character set is
-      cp1252 (Latin1). This may be changed with the
-      <option>--default-character-set</option> option to
-      <command>mysqld</command>. See <xref linkend="character-sets"/>.
-      User variable names are not case sensitive.
+      <literal>latin1</literal> (cp1252 West European). This may be
+      changed with the <option>--default-character-set</option> option
+      to <command>mysqld</command>. See
+      <xref linkend="character-sets"/>. User variable names are not case
+      sensitive.
     </para>
 
     <para>

Modified: trunk/refman-5.1/sql-syntax.xml
===================================================================
--- trunk/refman-5.1/sql-syntax.xml	2006-01-14 04:26:08 UTC (rev 822)
+++ trunk/refman-5.1/sql-syntax.xml	2006-01-14 04:26:26 UTC (rev 823)
@@ -13923,6 +13923,116 @@
         <primary>SET OPTION</primary>
       </indexterm>
 
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>AUTOCOMMIT</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>BIG_TABLES</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>CHARACTER SET</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>FOREIGN_KEY_CHECKS</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>IDENTITY</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>INSERT_ID</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>LAST_INSERT_ID</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>NAMES</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>ONE_SHOT</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_AUTO_IS_NULL</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_BIG_SELECTS</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_BUFFER_SELECT</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_LOG_BIN</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_LOG_OFF</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_LOG_UPDATE</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_NOTES</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_QUOTE_SHOW_CREATE</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_SAFE_UPDATES</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_SELECT_LIMIT</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>SQL_WARNINGS</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>TIMESTAMP</literal></secondary>
+      </indexterm>
+
+      <indexterm>
+        <primary><literal>SET</literal></primary>
+        <secondary><literal>UNIQUE_CHECKS</literal></secondary>
+      </indexterm>
+
       <remark role="help-category" condition="Data Manipulation"/>
 
       <remark role="help-topic" condition="SET"/>
@@ -14204,7 +14314,8 @@
             <literal>character_set_results</literal> are set to the
             given character set, and
             <literal>character_set_connection</literal> to the value of
-            <literal>character_set_database</literal>.
+            <literal>character_set_database</literal>. See
+            <xref linkend="charset-connection"/>.
           </para>
 
           <para>
@@ -14340,7 +14451,8 @@
             <literal>character_set_connection</literal> to
             <literal>charset_name</literal> also sets
             <literal>collation_connection</literal> to the default
-            collation for <literal>charset_name</literal>.
+            collation for <literal>charset_name</literal>. See
+            <xref linkend="charset-connection"/>.
           </para>
 
           <para>

Thread
svn commit - mysqldoc@docsrva: r823 - in trunk: . refman-4.1 refman-5.0 refman-5.1paul14 Jan