Author: paul
Date: 2006-01-15 05:55:52 +0100 (Sun, 15 Jan 2006)
New Revision: 831
Log:
r6207@frost: paul | 2006-01-14 18:36:26 -0600
Some restructuring.
Modified:
trunk/
trunk/refman-4.1/charset.xml
trunk/refman-4.1/renamed-nodes.txt
trunk/refman-5.0/charset.xml
trunk/refman-5.0/renamed-nodes.txt
trunk/refman-5.1/charset.xml
trunk/refman-5.1/renamed-nodes.txt
trunk/refman-common/titles.en.ent
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:6205
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:2175
+ b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:6207
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 18:05:38 UTC (rev 830)
+++ trunk/refman-4.1/charset.xml 2006-01-15 04:55:52 UTC (rev 831)
@@ -394,9 +394,9 @@
</section>
- <section id="charset-defaults">
+ <section id="charset-syntax">
- <title>&title-charset-defaults;</title>
+ <title>&title-charset-syntax;</title>
<para>
There are default settings for character sets and collations at
@@ -1066,151 +1066,152 @@
</section>
- <section id="charset-connection">
+ </section>
- <title>&title-charset-connection;</title>
+ <section id="charset-connection">
- <indexterm>
- <primary><literal>SET</literal></primary>
- <secondary><literal>CHARACTER SET</literal></secondary>
- </indexterm>
+ <title>&title-charset-connection;</title>
- <indexterm>
- <primary><literal>SET</literal></primary>
- <secondary><literal>NAMES</literal></secondary>
- </indexterm>
+ <indexterm>
+ <primary><literal>SET</literal></primary>
+ <secondary><literal>CHARACTER SET</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
- mentioned in earlier sections:
- </para>
+ <indexterm>
+ <primary><literal>SET</literal></primary>
+ <secondary><literal>NAMES</literal></secondary>
+ </indexterm>
- <itemizedlist>
+ <para>
+ Several character set and collation system variables relate to a
+ client's interaction with the server. Some of these have been
+ mentioned in earlier sections:
+ </para>
- <listitem>
- <para>
- 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>
+ <itemizedlist>
- <listitem>
- <para>
- 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> system variables.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ 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>
- </itemizedlist>
+ <listitem>
+ <para>
+ 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> system variables.
+ </para>
+ </listitem>
- <para>
- 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>
+ </itemizedlist>
- <para>
- Consider what a <quote>connection</quote> is: It's what you make
- when you connect to the server. The client sends SQL statements,
- such as queries, over the connection to the server. The server
- sends responses, such as result sets, over the connection back
- to the client. This leads to several questions about character
- set and collation handling for client connections, each of which
- can be answered in terms of system variables:
- </para>
+ <para>
+ 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>
- <itemizedlist>
+ <para>
+ Consider what a <quote>connection</quote> is: It's what you make
+ when you connect to the server. The client sends SQL statements,
+ such as queries, over the connection to the server. The server
+ sends responses, such as result sets, over the connection back to
+ the client. This leads to several questions about character set
+ and collation handling for client connections, each of which can
+ be answered in terms of system variables:
+ </para>
- <listitem>
- <para>
- What character set is the statement in when it leaves the
- client?
- </para>
+ <itemizedlist>
- <para>
- The server takes the <literal>character_set_client</literal>
- system variable to be the character set in which statements
- are sent by the client.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ What character set is the statement in when it leaves the
+ client?
+ </para>
- <listitem>
- <para>
- What character set should the server translate a statement
- to after receiving it?
- </para>
+ <para>
+ The server takes the <literal>character_set_client</literal>
+ system variable to be the character set in which statements
+ are sent by the client.
+ </para>
+ </listitem>
- <para>
- 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, <literal>collation_connection</literal>
- does not matter because columns have their own collation,
- which has a higher collation precedence.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ What character set should the server translate a statement to
+ after receiving it?
+ </para>
- <listitem>
- <para>
- What character set should the server translate to before
- shipping result sets or error messages back to the client?
- </para>
+ <para>
+ 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, <literal>collation_connection</literal>
+ does not matter because columns have their own collation,
+ which has a higher collation precedence.
+ </para>
+ </listitem>
- <para>
- 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.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ What character set should the server translate to before
+ shipping result sets or error messages back to the client?
+ </para>
- </itemizedlist>
+ <para>
+ 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.
+ </para>
+ </listitem>
- <para>
- You can fine-tune the settings for these variables, or you can
- depend on the defaults (in which case, you can skip the rest of
- this section).
- </para>
+ </itemizedlist>
- <para>
- There are two statements that affect the connection character
- sets:
- </para>
+ <para>
+ You can fine-tune the settings for these variables, or you can
+ depend on the defaults (in which case, you can skip the rest of
+ this section).
+ </para>
+ <para>
+ There are two statements that affect the connection character
+ sets:
+ </para>
+
<programlisting>
SET NAMES '<replaceable>charset_name</replaceable>'
SET CHARACTER SET <replaceable>charset_name</replaceable>
</programlisting>
- <para>
- <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>
+ <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>
- A <literal>SET NAMES '<replaceable>x</replaceable>'</literal>
- statement is equivalent to these three statements:
- </para>
+ <para>
+ A <literal>SET NAMES '<replaceable>x</replaceable>'</literal>
+ statement is equivalent to these three statements:
+ </para>
<programlisting>
mysql> <userinput>SET character_set_client = <replaceable>x</replaceable>;</userinput>
@@ -1218,20 +1219,20 @@
mysql> <userinput>SET character_set_connection = <replaceable>x</replaceable>;</userinput>
</programlisting>
- <para>
- Setting <literal>character_set_connection</literal> to
- <replaceable>x</replaceable> also sets
- <literal>collation_connection</literal> to the default collation
- for <replaceable>x</replaceable>.
- </para>
+ <para>
+ Setting <literal>character_set_connection</literal> to
+ <replaceable>x</replaceable> also sets
+ <literal>collation_connection</literal> to the default collation
+ for <replaceable>x</replaceable>.
+ </para>
- <para>
- <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>
+ <para>
+ <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>
mysql> <userinput>SET character_set_client = <replaceable>x</replaceable>;</userinput>
@@ -1239,73 +1240,82 @@
mysql> <userinput>SET collation_connection = @@collation_database;</userinput>
</programlisting>
- <para>
- Setting <literal>collation_connection</literal> also sets
- <literal>character_set_connection</literal> to the character set
- associated with the collation.
- </para>
+ <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 uses the name to
- set the <literal>character_set_client</literal>,
- <literal>character_set_results</literal>, and
- <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>
+ When a client connects, it sends to the server the name of the
+ 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> system variables. In
+ effect, the server performs a <literal>SET NAMES</literal>
+ operation using the character set name.
+ </para>
- <para>
- With the <command>mysql</command> client, it is not necessary to
- execute <literal>SET NAMES</literal> every time you start up if
- you want to use a character set different from the default. You
- can add the <option>--default-character-set</option> option
- 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 invoke
- <command>mysql</command>:
- </para>
+ <para>
+ With the <command>mysql</command> client, it is not necessary to
+ execute <literal>SET NAMES</literal> every time you start up if
+ you want to use a character set different from the default. You
+ can add the <option>--default-character-set</option> option
+ 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 invoke
+ <command>mysql</command>:
+ </para>
<programlisting>
[mysql]
default-character-set=koi8r
</programlisting>
- <para>
- Example: Suppose that <literal>column1</literal> is defined as
- <literal>CHAR(5) CHARACTER SET latin2</literal>. If you do not
- say <literal>SET NAMES</literal> or <literal>SET CHARACTER
- SET</literal>, then for <literal>SELECT column1 FROM
- t</literal>, the server sends back all the values for
- <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> 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>
+ Example: Suppose that <literal>column1</literal> is defined as
+ <literal>CHAR(5) CHARACTER SET latin2</literal>. If you do not say
+ <literal>SET NAMES</literal> or <literal>SET CHARACTER
+ SET</literal>, then for <literal>SELECT column1 FROM t</literal>,
+ the server sends back all the values for
+ <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> 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 of
- result sets, set <literal>character_set_results</literal> to
- <literal>NULL</literal>:
- </para>
+ <para>
+ 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>
<programlisting>
mysql> <userinput>SET character_set_results = NULL;</userinput>
</programlisting>
- <para>
- <emphasis role="bold">Note</emphasis>: Currently, UCS-2 cannot
- be used as a client character set, which means that <literal>SET
- NAMES 'ucs2'</literal> does not work.
- </para>
+ <para>
+ <emphasis role="bold">Note</emphasis>: Currently, UCS-2 cannot be
+ used as a client character set, which means that <literal>SET
+ NAMES 'ucs2'</literal> does not work.
+ </para>
- </section>
+ </section>
+ <section id="charset-collations">
+
+ <title>&title-charset-collations;</title>
+
+ <para>
+ The following sections various aspects of character set
+ collations.
+ </para>
+
<section id="charset-collate">
<title>&title-charset-collate;</title>
@@ -2393,18 +2403,6 @@
</section>
- <section id="charset-config-file">
-
- <title>&title-charset-config-file;</title>
-
- <para>
- In MySQL 4.1, character set configuration is stored in XML files,
- one file per character set. In previous versions, this information
- was stored in <filename>.conf</filename> files.
- </para>
-
- </section>
-
<section id="charset-upgrading">
<title>&title-charset-upgrading;</title>
Modified: trunk/refman-4.1/renamed-nodes.txt
===================================================================
--- trunk/refman-4.1/renamed-nodes.txt 2006-01-14 18:05:38 UTC (rev 830)
+++ trunk/refman-4.1/renamed-nodes.txt 2006-01-15 04:55:52 UTC (rev 831)
@@ -97,3 +97,5 @@
mysqlcc client-utility-programs
innodb-start innodb-parameters
charset-cast charset-convert
+charset-defaults charset-syntax
+charset-config-file adding-character-set
Modified: trunk/refman-5.0/charset.xml
===================================================================
--- trunk/refman-5.0/charset.xml 2006-01-14 18:05:38 UTC (rev 830)
+++ trunk/refman-5.0/charset.xml 2006-01-15 04:55:52 UTC (rev 831)
@@ -381,9 +381,9 @@
</section>
- <section id="charset-defaults">
+ <section id="charset-syntax">
- <title>&title-charset-defaults;</title>
+ <title>&title-charset-syntax;</title>
<para>
There are default settings for character sets and collations at
@@ -1058,151 +1058,152 @@
</section>
- <section id="charset-connection">
+ </section>
- <title>&title-charset-connection;</title>
+ <section id="charset-connection">
- <indexterm>
- <primary><literal>SET</literal></primary>
- <secondary><literal>CHARACTER SET</literal></secondary>
- </indexterm>
+ <title>&title-charset-connection;</title>
- <indexterm>
- <primary><literal>SET</literal></primary>
- <secondary><literal>NAMES</literal></secondary>
- </indexterm>
+ <indexterm>
+ <primary><literal>SET</literal></primary>
+ <secondary><literal>CHARACTER SET</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
- mentioned in earlier sections:
- </para>
+ <indexterm>
+ <primary><literal>SET</literal></primary>
+ <secondary><literal>NAMES</literal></secondary>
+ </indexterm>
- <itemizedlist>
+ <para>
+ Several character set and collation system variables relate to a
+ client's interaction with the server. Some of these have been
+ mentioned in earlier sections:
+ </para>
- <listitem>
- <para>
- 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>
+ <itemizedlist>
- <listitem>
- <para>
- 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> system variables.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ 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>
- </itemizedlist>
+ <listitem>
+ <para>
+ 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> system variables.
+ </para>
+ </listitem>
- <para>
- 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>
+ </itemizedlist>
- <para>
- Consider what a <quote>connection</quote> is: It's what you make
- when you connect to the server. The client sends SQL statements,
- such as queries, over the connection to the server. The server
- sends responses, such as result sets, over the connection back
- to the client. This leads to several questions about character
- set and collation handling for client connections, each of which
- can be answered in terms of system variables:
- </para>
+ <para>
+ 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>
- <itemizedlist>
+ <para>
+ Consider what a <quote>connection</quote> is: It's what you make
+ when you connect to the server. The client sends SQL statements,
+ such as queries, over the connection to the server. The server
+ sends responses, such as result sets, over the connection back to
+ the client. This leads to several questions about character set
+ and collation handling for client connections, each of which can
+ be answered in terms of system variables:
+ </para>
- <listitem>
- <para>
- What character set is the statement in when it leaves the
- client?
- </para>
+ <itemizedlist>
- <para>
- The server takes the <literal>character_set_client</literal>
- system variable to be the character set in which statements
- are sent by the client.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ What character set is the statement in when it leaves the
+ client?
+ </para>
- <listitem>
- <para>
- What character set should the server translate a statement
- to after receiving it?
- </para>
+ <para>
+ The server takes the <literal>character_set_client</literal>
+ system variable to be the character set in which statements
+ are sent by the client.
+ </para>
+ </listitem>
- <para>
- 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, <literal>collation_connection</literal>
- does not matter because columns have their own collation,
- which has a higher collation precedence.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ What character set should the server translate a statement to
+ after receiving it?
+ </para>
- <listitem>
- <para>
- What character set should the server translate to before
- shipping result sets or error messages back to the client?
- </para>
+ <para>
+ 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, <literal>collation_connection</literal>
+ does not matter because columns have their own collation,
+ which has a higher collation precedence.
+ </para>
+ </listitem>
- <para>
- 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.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ What character set should the server translate to before
+ shipping result sets or error messages back to the client?
+ </para>
- </itemizedlist>
+ <para>
+ 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.
+ </para>
+ </listitem>
- <para>
- You can fine-tune the settings for these variables, or you can
- depend on the defaults (in which case, you can skip the rest of
- this section).
- </para>
+ </itemizedlist>
- <para>
- There are two statements that affect the connection character
- sets:
- </para>
+ <para>
+ You can fine-tune the settings for these variables, or you can
+ depend on the defaults (in which case, you can skip the rest of
+ this section).
+ </para>
+ <para>
+ There are two statements that affect the connection character
+ sets:
+ </para>
+
<programlisting>
SET NAMES '<replaceable>charset_name</replaceable>'
SET CHARACTER SET <replaceable>charset_name</replaceable>
</programlisting>
- <para>
- <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>
+ <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>
- A <literal>SET NAMES '<replaceable>x</replaceable>'</literal>
- statement is equivalent to these three statements:
- </para>
+ <para>
+ A <literal>SET NAMES '<replaceable>x</replaceable>'</literal>
+ statement is equivalent to these three statements:
+ </para>
<programlisting>
mysql> <userinput>SET character_set_client = <replaceable>x</replaceable>;</userinput>
@@ -1210,20 +1211,20 @@
mysql> <userinput>SET character_set_connection = <replaceable>x</replaceable>;</userinput>
</programlisting>
- <para>
- Setting <literal>character_set_connection</literal> to
- <replaceable>x</replaceable> also sets
- <literal>collation_connection</literal> to the default collation
- for <replaceable>x</replaceable>.
- </para>
+ <para>
+ Setting <literal>character_set_connection</literal> to
+ <replaceable>x</replaceable> also sets
+ <literal>collation_connection</literal> to the default collation
+ for <replaceable>x</replaceable>.
+ </para>
- <para>
- <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>
+ <para>
+ <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>
mysql> <userinput>SET character_set_client = <replaceable>x</replaceable>;</userinput>
@@ -1231,73 +1232,82 @@
mysql> <userinput>SET collation_connection = @@collation_database;</userinput>
</programlisting>
- <para>
- Setting <literal>collation_connection</literal> also sets
- <literal>character_set_connection</literal> to the character set
- associated with the collation.
- </para>
+ <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 uses the name to
- set the <literal>character_set_client</literal>,
- <literal>character_set_results</literal>, and
- <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>
+ When a client connects, it sends to the server the name of the
+ 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> system variables. In
+ effect, the server performs a <literal>SET NAMES</literal>
+ operation using the character set name.
+ </para>
- <para>
- With the <command>mysql</command> client, it is not necessary to
- execute <literal>SET NAMES</literal> every time you start up if
- you want to use a character set different from the default. You
- can add the <option>--default-character-set</option> option
- 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 invoke
- <command>mysql</command>:
- </para>
+ <para>
+ With the <command>mysql</command> client, it is not necessary to
+ execute <literal>SET NAMES</literal> every time you start up if
+ you want to use a character set different from the default. You
+ can add the <option>--default-character-set</option> option
+ 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 invoke
+ <command>mysql</command>:
+ </para>
<programlisting>
[mysql]
default-character-set=koi8r
</programlisting>
- <para>
- Example: Suppose that <literal>column1</literal> is defined as
- <literal>CHAR(5) CHARACTER SET latin2</literal>. If you do not
- say <literal>SET NAMES</literal> or <literal>SET CHARACTER
- SET</literal>, then for <literal>SELECT column1 FROM
- t</literal>, the server sends back all the values for
- <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> 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>
+ Example: Suppose that <literal>column1</literal> is defined as
+ <literal>CHAR(5) CHARACTER SET latin2</literal>. If you do not say
+ <literal>SET NAMES</literal> or <literal>SET CHARACTER
+ SET</literal>, then for <literal>SELECT column1 FROM t</literal>,
+ the server sends back all the values for
+ <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> 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 of
- result sets, set <literal>character_set_results</literal> to
- <literal>NULL</literal>:
- </para>
+ <para>
+ 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>
<programlisting>
mysql> <userinput>SET character_set_results = NULL;</userinput>
</programlisting>
- <para>
- <emphasis role="bold">Note</emphasis>: Currently, UCS-2 cannot
- be used as a client character set, which means that <literal>SET
- NAMES 'ucs2'</literal> does not work.
- </para>
+ <para>
+ <emphasis role="bold">Note</emphasis>: Currently, UCS-2 cannot be
+ used as a client character set, which means that <literal>SET
+ NAMES 'ucs2'</literal> does not work.
+ </para>
- </section>
+ </section>
+ <section id="charset-collations">
+
+ <title>&title-charset-collations;</title>
+
+ <para>
+ The following sections various aspects of character set
+ collations.
+ </para>
+
<section id="charset-collate">
<title>&title-charset-collate;</title>
@@ -2308,17 +2318,6 @@
</section>
- <section id="charset-config-file">
-
- <title>&title-charset-config-file;</title>
-
- <para>
- Character set configuration is stored in XML files, one file per
- character set.
- </para>
-
- </section>
-
<section id="charset-charsets">
<title>&title-charset-charsets;</title>
Modified: trunk/refman-5.0/renamed-nodes.txt
===================================================================
--- trunk/refman-5.0/renamed-nodes.txt 2006-01-14 18:05:38 UTC (rev 830)
+++ trunk/refman-5.0/renamed-nodes.txt 2006-01-15 04:55:52 UTC (rev 831)
@@ -394,3 +394,5 @@
innodb-start innodb-parameters
federated-install federated-storage-engine
charset-cast charset-convert
+charset-defaults charset-syntax
+charset-config-file adding-character-set
Modified: trunk/refman-5.1/charset.xml
===================================================================
--- trunk/refman-5.1/charset.xml 2006-01-14 18:05:38 UTC (rev 830)
+++ trunk/refman-5.1/charset.xml 2006-01-15 04:55:52 UTC (rev 831)
@@ -381,9 +381,9 @@
</section>
- <section id="charset-defaults">
+ <section id="charset-syntax">
- <title>&title-charset-defaults;</title>
+ <title>&title-charset-syntax;</title>
<para>
There are default settings for character sets and collations at
@@ -1058,151 +1058,152 @@
</section>
- <section id="charset-connection">
+ </section>
- <title>&title-charset-connection;</title>
+ <section id="charset-connection">
- <indexterm>
- <primary><literal>SET</literal></primary>
- <secondary><literal>CHARACTER SET</literal></secondary>
- </indexterm>
+ <title>&title-charset-connection;</title>
- <indexterm>
- <primary><literal>SET</literal></primary>
- <secondary><literal>NAMES</literal></secondary>
- </indexterm>
+ <indexterm>
+ <primary><literal>SET</literal></primary>
+ <secondary><literal>CHARACTER SET</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
- mentioned in earlier sections:
- </para>
+ <indexterm>
+ <primary><literal>SET</literal></primary>
+ <secondary><literal>NAMES</literal></secondary>
+ </indexterm>
- <itemizedlist>
+ <para>
+ Several character set and collation system variables relate to a
+ client's interaction with the server. Some of these have been
+ mentioned in earlier sections:
+ </para>
- <listitem>
- <para>
- 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>
+ <itemizedlist>
- <listitem>
- <para>
- 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> system variables.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ 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>
- </itemizedlist>
+ <listitem>
+ <para>
+ 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> system variables.
+ </para>
+ </listitem>
- <para>
- 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>
+ </itemizedlist>
- <para>
- Consider what a <quote>connection</quote> is: It's what you make
- when you connect to the server. The client sends SQL statements,
- such as queries, over the connection to the server. The server
- sends responses, such as result sets, over the connection back
- to the client. This leads to several questions about character
- set and collation handling for client connections, each of which
- can be answered in terms of system variables:
- </para>
+ <para>
+ 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>
- <itemizedlist>
+ <para>
+ Consider what a <quote>connection</quote> is: It's what you make
+ when you connect to the server. The client sends SQL statements,
+ such as queries, over the connection to the server. The server
+ sends responses, such as result sets, over the connection back to
+ the client. This leads to several questions about character set
+ and collation handling for client connections, each of which can
+ be answered in terms of system variables:
+ </para>
- <listitem>
- <para>
- What character set is the statement in when it leaves the
- client?
- </para>
+ <itemizedlist>
- <para>
- The server takes the <literal>character_set_client</literal>
- system variable to be the character set in which statements
- are sent by the client.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ What character set is the statement in when it leaves the
+ client?
+ </para>
- <listitem>
- <para>
- What character set should the server translate a statement
- to after receiving it?
- </para>
+ <para>
+ The server takes the <literal>character_set_client</literal>
+ system variable to be the character set in which statements
+ are sent by the client.
+ </para>
+ </listitem>
- <para>
- 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, <literal>collation_connection</literal>
- does not matter because columns have their own collation,
- which has a higher collation precedence.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ What character set should the server translate a statement to
+ after receiving it?
+ </para>
- <listitem>
- <para>
- What character set should the server translate to before
- shipping result sets or error messages back to the client?
- </para>
+ <para>
+ 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, <literal>collation_connection</literal>
+ does not matter because columns have their own collation,
+ which has a higher collation precedence.
+ </para>
+ </listitem>
- <para>
- 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.
- </para>
- </listitem>
+ <listitem>
+ <para>
+ What character set should the server translate to before
+ shipping result sets or error messages back to the client?
+ </para>
- </itemizedlist>
+ <para>
+ 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.
+ </para>
+ </listitem>
- <para>
- You can fine-tune the settings for these variables, or you can
- depend on the defaults (in which case, you can skip the rest of
- this section).
- </para>
+ </itemizedlist>
- <para>
- There are two statements that affect the connection character
- sets:
- </para>
+ <para>
+ You can fine-tune the settings for these variables, or you can
+ depend on the defaults (in which case, you can skip the rest of
+ this section).
+ </para>
+ <para>
+ There are two statements that affect the connection character
+ sets:
+ </para>
+
<programlisting>
SET NAMES '<replaceable>charset_name</replaceable>'
SET CHARACTER SET <replaceable>charset_name</replaceable>
</programlisting>
- <para>
- <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>
+ <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>
- A <literal>SET NAMES '<replaceable>x</replaceable>'</literal>
- statement is equivalent to these three statements:
- </para>
+ <para>
+ A <literal>SET NAMES '<replaceable>x</replaceable>'</literal>
+ statement is equivalent to these three statements:
+ </para>
<programlisting>
mysql> <userinput>SET character_set_client = <replaceable>x</replaceable>;</userinput>
@@ -1210,20 +1211,20 @@
mysql> <userinput>SET character_set_connection = <replaceable>x</replaceable>;</userinput>
</programlisting>
- <para>
- Setting <literal>character_set_connection</literal> to
- <replaceable>x</replaceable> also sets
- <literal>collation_connection</literal> to the default collation
- for <replaceable>x</replaceable>.
- </para>
+ <para>
+ Setting <literal>character_set_connection</literal> to
+ <replaceable>x</replaceable> also sets
+ <literal>collation_connection</literal> to the default collation
+ for <replaceable>x</replaceable>.
+ </para>
- <para>
- <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>
+ <para>
+ <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>
mysql> <userinput>SET character_set_client = <replaceable>x</replaceable>;</userinput>
@@ -1231,73 +1232,82 @@
mysql> <userinput>SET collation_connection = @@collation_database;</userinput>
</programlisting>
- <para>
- Setting <literal>collation_connection</literal> also sets
- <literal>character_set_connection</literal> to the character set
- associated with the collation.
- </para>
+ <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 uses the name to
- set the <literal>character_set_client</literal>,
- <literal>character_set_results</literal>, and
- <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>
+ When a client connects, it sends to the server the name of the
+ 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> system variables. In
+ effect, the server performs a <literal>SET NAMES</literal>
+ operation using the character set name.
+ </para>
- <para>
- With the <command>mysql</command> client, it is not necessary to
- execute <literal>SET NAMES</literal> every time you start up if
- you want to use a character set different from the default. You
- can add the <option>--default-character-set</option> option
- 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 invoke
- <command>mysql</command>:
- </para>
+ <para>
+ With the <command>mysql</command> client, it is not necessary to
+ execute <literal>SET NAMES</literal> every time you start up if
+ you want to use a character set different from the default. You
+ can add the <option>--default-character-set</option> option
+ 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 invoke
+ <command>mysql</command>:
+ </para>
<programlisting>
[mysql]
default-character-set=koi8r
</programlisting>
- <para>
- Example: Suppose that <literal>column1</literal> is defined as
- <literal>CHAR(5) CHARACTER SET latin2</literal>. If you do not
- say <literal>SET NAMES</literal> or <literal>SET CHARACTER
- SET</literal>, then for <literal>SELECT column1 FROM
- t</literal>, the server sends back all the values for
- <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> 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>
+ Example: Suppose that <literal>column1</literal> is defined as
+ <literal>CHAR(5) CHARACTER SET latin2</literal>. If you do not say
+ <literal>SET NAMES</literal> or <literal>SET CHARACTER
+ SET</literal>, then for <literal>SELECT column1 FROM t</literal>,
+ the server sends back all the values for
+ <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> 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 of
- result sets, set <literal>character_set_results</literal> to
- <literal>NULL</literal>:
- </para>
+ <para>
+ 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>
<programlisting>
mysql> <userinput>SET character_set_results = NULL;</userinput>
</programlisting>
- <para>
- <emphasis role="bold">Note</emphasis>: Currently, UCS-2 cannot
- be used as a client character set, which means that <literal>SET
- NAMES 'ucs2'</literal> does not work.
- </para>
+ <para>
+ <emphasis role="bold">Note</emphasis>: Currently, UCS-2 cannot be
+ used as a client character set, which means that <literal>SET
+ NAMES 'ucs2'</literal> does not work.
+ </para>
- </section>
+ </section>
+ <section id="charset-collations">
+
+ <title>&title-charset-collations;</title>
+
+ <para>
+ The following sections various aspects of character set
+ collations.
+ </para>
+
<section id="charset-collate">
<title>&title-charset-collate;</title>
@@ -2307,17 +2317,6 @@
</section>
- <section id="charset-config-file">
-
- <title>&title-charset-config-file;</title>
-
- <para>
- Character set configuration is stored in XML files, one file per
- character set.
- </para>
-
- </section>
-
<section id="charset-charsets">
<title>&title-charset-charsets;</title>
Modified: trunk/refman-5.1/renamed-nodes.txt
===================================================================
--- trunk/refman-5.1/renamed-nodes.txt 2006-01-14 18:05:38 UTC (rev 830)
+++ trunk/refman-5.1/renamed-nodes.txt 2006-01-15 04:55:52 UTC (rev 831)
@@ -98,3 +98,5 @@
innodb-start innodb-parameters
federated-install federated-storage-engine
charset-cast charset-convert
+charset-defaults charset-syntax
+charset-config-file adding-character-set
Modified: trunk/refman-common/titles.en.ent
===================================================================
--- trunk/refman-common/titles.en.ent 2006-01-14 18:05:38 UTC (rev 830)
+++ trunk/refman-common/titles.en.ent 2006-01-15 04:55:52 UTC (rev 831)
@@ -136,15 +136,14 @@
<!ENTITY title-charset-collate-tricky "Some Special Cases Where the Collation Determination Is Tricky">
<!ENTITY title-charset-collation-charset "Collations Must Be for the Right Character Set">
<!ENTITY title-charset-collation-effect "An Example of the Effect of Collation">
+<!ENTITY title-charset-collations "Collation Issues">
<!ENTITY title-charset-column "Column Character Set and Collation">
<!ENTITY title-charset-compatibility "Compatibility with Other DBMSs">
-<!ENTITY title-charset-config-file "New Character Set Configuration File Format">
<!ENTITY title-charset-connection "Connection Character Sets and Collations">
<!ENTITY title-charset-conversion "Converting 4.0 Character Columns to 4.1 Format">
<!ENTITY title-charset-convert "<literal>CONVERT()</literal> and <literal>CAST()</literal>">
<!ENTITY title-charset-cyrillic-sets "Cyrillic Character Sets">
<!ENTITY title-charset-database "Database Character Set and Collation">
-<!ENTITY title-charset-defaults "Determining the Default Character Set and Collation">
<!ENTITY title-charset-examples "Examples of Character Set and Collation Assignment">
<!ENTITY title-charset-general "Character Sets and Collations in General">
<!ENTITY title-charset-literal "Character String Literal Character Set and Collation">
@@ -157,6 +156,7 @@
<!ENTITY title-charset-se-me-sets "South European and Middle East Character Sets">
<!ENTITY title-charset-server "Server Character Set and Collation">
<!ENTITY title-charset-show "<literal>SHOW</literal> Statements">
+<!ENTITY title-charset-syntax "Specifying Character Sets and Collations">
<!ENTITY title-charset-table "Table Character Set and Collation">
<!ENTITY title-charset-unicode "Unicode Support">
<!ENTITY title-charset-unicode-sets "Unicode Character Sets">
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r831 - in trunk: . refman-4.1 refman-5.0 refman-5.1 refman-common | paul | 15 Jan |