Author: paul
Date: 2006-01-14 19:05:38 +0100 (Sat, 14 Jan 2006)
New Revision: 830
Log:
r6205@frost: paul | 2006-01-14 12:05:27 -0600
Move stuff around.
Modified:
trunk/
trunk/refman-4.1/charset.xml
trunk/refman-5.0/charset.xml
trunk/refman-5.1/charset.xml
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:6202
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:2175
+ b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:6205
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:04:17 UTC (rev 829)
+++ trunk/refman-4.1/charset.xml 2006-01-14 18:05:38 UTC (rev 830)
@@ -51,14 +51,13 @@
set support; there are no plans to change this, because
<literal>ISAM</literal> is deprecated.
</para>
-
+
<para>
<emphasis role="bold">Note</emphasis>: The
<literal>NDBCluster</literal> storage engine in MySQL 4.1 (available
beginning with MySQL 4.1.3-Max) provides limited character set and
- collation support; see
+ collation support; see
<xref linkend="mysql-cluster-limitations-in-4-1"/>.
-
</para>
<para>
@@ -407,6 +406,12 @@
obvious results.
</para>
+ <para>
+ <literal>CHARACTER SET</literal> is used in clauses that specify a
+ character set. <literal>CHARSET</literal> may be used as a synonym
+ for <literal>CHARACTER SET</literal>.
+ </para>
+
<section id="charset-server">
<title>&title-charset-server;</title>
@@ -743,6 +748,207 @@
</section>
+ <section id="charset-literal">
+
+ <title>&title-charset-literal;</title>
+
+ <para>
+ Every character string literal has a character set and a
+ collation.
+ </para>
+
+ <para>
+ A character string literal may have an optional character set
+ introducer and <literal>COLLATE</literal> clause:
+ </para>
+
+ <indexterm>
+ <primary>introducer</primary>
+ <secondary>string literal</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>string literal introducer</primary>
+ </indexterm>
+
+<programlisting>
+[_<replaceable>charset_name</replaceable>]'<replaceable>string</replaceable>'
[COLLATE <replaceable>collation_name</replaceable>]
+</programlisting>
+
+ <para>
+ Examples:
+ </para>
+
+<programlisting>
+SELECT '<replaceable>string</replaceable>';
+SELECT _latin1'<replaceable>string</replaceable>';
+SELECT _latin1'<replaceable>string</replaceable>' COLLATE latin1_danish_ci;
+</programlisting>
+
+ <para>
+ For the simple statement <literal>SELECT
+ '<replaceable>string</replaceable>'</literal>, the string has
+ the character set and collation defined by the
+ <literal>character_set_connection</literal> and
+ <literal>collation_connection</literal> system variables.
+ </para>
+
+ <para>
+ The
<literal>_<replaceable>charset_name</replaceable></literal>
+ expression is formally called an
+ <emphasis>introducer</emphasis>. It tells the parser,
<quote>the
+ string that is about to follow uses character set
+ <replaceable>X</replaceable>.</quote> Because this has confused
+ people in the past, we emphasize that an introducer does not
+ cause any conversion; it is strictly a signal that does not
+ change the string's value. An introducer is also legal before
+ standard hex literal and numeric hex literal notation
+ (<literal>x'<replaceable>literal</replaceable>'</literal>
and
+ <literal>0x<replaceable>nnnn</replaceable></literal>),
and
+ before <literal>?</literal> (parameter substitution when using
+ prepared statements within a programming language interface).
+ </para>
+
+ <para>
+ Examples:
+ </para>
+
+<programlisting>
+SELECT _latin1 x'AABBCC';
+SELECT _latin1 0xAABBCC;
+SELECT _latin1 ?;
+</programlisting>
+
+ <para>
+ MySQL determines a literal's character set and collation thus:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ If both <replaceable>_X</replaceable> and <literal>COLLATE
+ <replaceable>Y</replaceable></literal> were specified, then
+ character set <replaceable>X</replaceable> and collation
+ <replaceable>Y</replaceable> are used.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ If <replaceable>_X</replaceable> is specified but
+ <literal>COLLATE</literal> is not specified, then character
+ set <replaceable>X</replaceable> and its default collation
+ are used.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Otherwise, the character set and collation given by the
+ <literal>character_set_connection</literal> and
+ <literal>collation_connection</literal> system variables are
+ used.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ Examples:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ A string with <literal>latin1</literal> character set and
+ <literal>latin1_german1_ci</literal> collation:
+ </para>
+
+<programlisting>
+SELECT _latin1'Müller' COLLATE latin1_german1_ci;
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ A string with <literal>latin1</literal> character set and
+ its default collation (that is,
+ <literal>latin1_swedish_ci</literal>):
+ </para>
+
+<programlisting>
+SELECT _latin1'Müller';
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ A string with the connection default character set and
+ collation:
+ </para>
+
+<programlisting>
+SELECT 'Müller';
+</programlisting>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ Character set introducers and the <literal>COLLATE</literal>
+ clause are implemented according to standard SQL specifications.
+ </para>
+
+ </section>
+
+ <section id="charset-national">
+
+ <title>&title-charset-national;</title>
+
+ <para>
+ Before MySQL 4.1, <literal>NCHAR</literal> and
+ <literal>CHAR</literal> were synonymous. ANSI SQL defines
+ <literal>NCHAR</literal> or <literal>NATIONAL
CHAR</literal> as
+ a way to indicate that a <literal>CHAR</literal> column should
+ use some predefined character set. MySQL 4.1 and up uses
+ <literal>utf8</literal> as that predefined character set. For
+ example, these data type declarations are equivalent:
+ </para>
+
+<programlisting>
+CHAR(10) CHARACTER SET utf8
+NATIONAL CHARACTER(10)
+NCHAR(10)
+</programlisting>
+
+ <para>
+ As are these:
+ </para>
+
+<programlisting>
+VARCHAR(10) CHARACTER SET utf8
+NATIONAL VARCHAR(10)
+NCHAR VARCHAR(10)
+NATIONAL CHARACTER VARYING(10)
+NATIONAL CHAR VARYING(10)
+</programlisting>
+
+ <para>
+ You can use
+ <literal>N'<replaceable>literal</replaceable>'</literal>
to
+ create a string in the national character set. These two
+ statements are equivalent:
+ </para>
+
+<programlisting>
+SELECT N'some text';
+SELECT _utf8'some text';
+</programlisting>
+
+ </section>
+
<section id="charset-examples">
<title>&title-charset-examples;</title>
@@ -845,6 +1051,21 @@
</section>
+ <section id="charset-compatibility">
+
+ <title>&title-charset-compatibility;</title>
+
+ <para>
+ For MaxDB compatibility these two statements are the same:
+ </para>
+
+<programlisting>
+CREATE TABLE t1 (f1 CHAR(<replaceable>n</replaceable>) UNICODE);
+CREATE TABLE t1 (f1 CHAR(<replaceable>n</replaceable>) CHARACTER SET ucs2);
+</programlisting>
+
+ </section>
+
<section id="charset-connection">
<title>&title-charset-connection;</title>
@@ -1079,167 +1300,12 @@
<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.
+ be used as a client character set, which means that <literal>SET
+ NAMES 'ucs2'</literal> does not work.
</para>
</section>
- <section id="charset-literal">
-
- <title>&title-charset-literal;</title>
-
- <para>
- Every character string literal has a character set and a
- collation.
- </para>
-
- <para>
- A character string literal may have an optional character set
- introducer and <literal>COLLATE</literal> clause:
- </para>
-
- <indexterm>
- <primary>introducer</primary>
- <secondary>string literal</secondary>
- </indexterm>
-
- <indexterm>
- <primary>string literal introducer</primary>
- </indexterm>
-
-<programlisting>
-[_<replaceable>charset_name</replaceable>]'<replaceable>string</replaceable>'
[COLLATE <replaceable>collation_name</replaceable>]
-</programlisting>
-
- <para>
- Examples:
- </para>
-
-<programlisting>
-SELECT '<replaceable>string</replaceable>';
-SELECT _latin1'<replaceable>string</replaceable>';
-SELECT _latin1'<replaceable>string</replaceable>' COLLATE latin1_danish_ci;
-</programlisting>
-
- <para>
- For the simple statement <literal>SELECT
- '<replaceable>string</replaceable>'</literal>, the string has
- the character set and collation defined by the
- <literal>character_set_connection</literal> and
- <literal>collation_connection</literal> system variables.
- </para>
-
- <para>
- The
<literal>_<replaceable>charset_name</replaceable></literal>
- expression is formally called an
- <emphasis>introducer</emphasis>. It tells the parser,
<quote>the
- string that is about to follow uses character set
- <replaceable>X</replaceable>.</quote> Because this has confused
- people in the past, we emphasize that an introducer does not
- cause any conversion; it is strictly a signal that does not
- change the string's value. An introducer is also legal before
- standard hex literal and numeric hex literal notation
- (<literal>x'<replaceable>literal</replaceable>'</literal>
and
- <literal>0x<replaceable>nnnn</replaceable></literal>),
and
- before <literal>?</literal> (parameter substitution when using
- prepared statements within a programming language interface).
- </para>
-
- <para>
- Examples:
- </para>
-
-<programlisting>
-SELECT _latin1 x'AABBCC';
-SELECT _latin1 0xAABBCC;
-SELECT _latin1 ?;
-</programlisting>
-
- <para>
- MySQL determines a literal's character set and collation thus:
- </para>
-
- <itemizedlist>
-
- <listitem>
- <para>
- If both <replaceable>_X</replaceable> and <literal>COLLATE
- <replaceable>Y</replaceable></literal> were specified, then
- character set <replaceable>X</replaceable> and collation
- <replaceable>Y</replaceable> are used.
- </para>
- </listitem>
-
- <listitem>
- <para>
- If <replaceable>_X</replaceable> is specified but
- <literal>COLLATE</literal> is not specified, then character
- set <replaceable>X</replaceable> and its default collation
- are used.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Otherwise, the character set and collation given by the
- <literal>character_set_connection</literal> and
- <literal>collation_connection</literal> system variables are
- used.
- </para>
- </listitem>
-
- </itemizedlist>
-
- <para>
- Examples:
- </para>
-
- <itemizedlist>
-
- <listitem>
- <para>
- A string with <literal>latin1</literal> character set and
- <literal>latin1_german1_ci</literal> collation:
- </para>
-
-<programlisting>
-SELECT _latin1'Müller' COLLATE latin1_german1_ci;
-</programlisting>
- </listitem>
-
- <listitem>
- <para>
- A string with <literal>latin1</literal> character set and
- its default collation (that is,
- <literal>latin1_swedish_ci</literal>):
- </para>
-
-<programlisting>
-SELECT _latin1'Müller';
-</programlisting>
- </listitem>
-
- <listitem>
- <para>
- A string with the connection default character set and
- collation:
- </para>
-
-<programlisting>
-SELECT 'Müller';
-</programlisting>
- </listitem>
-
- </itemizedlist>
-
- <para>
- Character set introducers and the <literal>COLLATE</literal>
- clause are implemented according to standard SQL specifications.
- </para>
-
- </section>
-
<section id="charset-collate">
<title>&title-charset-collate;</title>
@@ -1570,7 +1636,7 @@
<programlisting>
mysql> <userinput>SELECT _latin1 'x' COLLATE latin2_bin;</userinput>
-ERROR 1251: COLLATION 'latin2_bin' is not valid
+ERROR 1253 (42000): COLLATION 'latin2_bin' is not valid
for CHARACTER SET 'latin1'
</programlisting>
@@ -2128,9 +2194,8 @@
</para>
<para>
- A restriction in MySQL 4.1 is that UCS-2 cannot be used as a
- client character set. That means that <literal>SET NAMES
- 'ucs2'</literal> does not work.
+ Currently, UCS-2 cannot be used as a client character set. That
+ means that <literal>SET NAMES 'ucs2'</literal> does not work.
</para>
<para>
@@ -2328,21 +2393,6 @@
</section>
- <section id="charset-compatibility">
-
- <title>&title-charset-compatibility;</title>
-
- <para>
- For MaxDB compatibility these two statements are the same:
- </para>
-
-<programlisting>
-CREATE TABLE t1 (f1 CHAR(<replaceable>n</replaceable>) UNICODE);
-CREATE TABLE t1 (f1 CHAR(<replaceable>n</replaceable>) CHARACTER SET ucs2);
-</programlisting>
-
- </section>
-
<section id="charset-config-file">
<title>&title-charset-config-file;</title>
@@ -2355,52 +2405,6 @@
</section>
- <section id="charset-national">
-
- <title>&title-charset-national;</title>
-
- <para>
- Before MySQL 4.1, <literal>NCHAR</literal> and
- <literal>CHAR</literal> were synonymous. ANSI SQL defines
- <literal>NCHAR</literal> or <literal>NATIONAL
CHAR</literal> as a
- way to indicate that a <literal>CHAR</literal> column should use
- some predefined character set. MySQL 4.1 and up uses
- <literal>utf8</literal> as that predefined character set. For
- example, these data type declarations are equivalent:
- </para>
-
-<programlisting>
-CHAR(10) CHARACTER SET utf8
-NATIONAL CHARACTER(10)
-NCHAR(10)
-</programlisting>
-
- <para>
- As are these:
- </para>
-
-<programlisting>
-VARCHAR(10) CHARACTER SET utf8
-NATIONAL VARCHAR(10)
-NCHAR VARCHAR(10)
-NATIONAL CHARACTER VARYING(10)
-NATIONAL CHAR VARYING(10)
-</programlisting>
-
- <para>
- You can use
- <literal>N'<replaceable>literal</replaceable>'</literal> to
create
- a string in the national character set. These two statements are
- equivalent:
- </para>
-
-<programlisting>
-SELECT N'some text';
-SELECT _utf8'some text';
-</programlisting>
-
- </section>
-
<section id="charset-upgrading">
<title>&title-charset-upgrading;</title>
Modified: trunk/refman-5.0/charset.xml
===================================================================
--- trunk/refman-5.0/charset.xml 2006-01-14 18:04:17 UTC (rev 829)
+++ trunk/refman-5.0/charset.xml 2006-01-14 18:05:38 UTC (rev 830)
@@ -393,6 +393,12 @@
obvious results.
</para>
+ <para>
+ <literal>CHARACTER SET</literal> is used in clauses that specify a
+ character set. <literal>CHARSET</literal> may be used as a synonym
+ for <literal>CHARACTER SET</literal>.
+ </para>
+
<section id="charset-server">
<title>&title-charset-server;</title>
@@ -729,6 +735,212 @@
</section>
+ <section id="charset-literal">
+
+ <title>&title-charset-literal;</title>
+
+ <para>
+ Every character string literal has a character set and a
+ collation.
+ </para>
+
+ <para>
+ A character string literal may have an optional character set
+ introducer and <literal>COLLATE</literal> clause:
+ </para>
+
+ <indexterm>
+ <primary>introducer</primary>
+ <secondary>string literal</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>string literal introducer</primary>
+ </indexterm>
+
+<programlisting>
+[_<replaceable>charset_name</replaceable>]'<replaceable>string</replaceable>'
[COLLATE <replaceable>collation_name</replaceable>]
+</programlisting>
+
+ <para>
+ Examples:
+ </para>
+
+<programlisting>
+SELECT '<replaceable>string</replaceable>';
+SELECT _latin1'<replaceable>string</replaceable>';
+SELECT _latin1'<replaceable>string</replaceable>' COLLATE latin1_danish_ci;
+</programlisting>
+
+ <para>
+ For the simple statement <literal>SELECT
+ '<replaceable>string</replaceable>'</literal>, the string has
+ the character set and collation defined by the
+ <literal>character_set_connection</literal> and
+ <literal>collation_connection</literal> system variables.
+ </para>
+
+ <para>
+ The
<literal>_<replaceable>charset_name</replaceable></literal>
+ expression is formally called an
+ <emphasis>introducer</emphasis>. It tells the parser,
<quote>the
+ string that is about to follow uses character set
+ <replaceable>X</replaceable>.</quote> Because this has confused
+ people in the past, we emphasize that an introducer does not
+ cause any conversion; it is strictly a signal that does not
+ change the string's value. An introducer is also legal before
+ standard hex literal and numeric hex literal notation
+ (<literal>x'<replaceable>literal</replaceable>'</literal>
and
+ <literal>0x<replaceable>nnnn</replaceable></literal>),
and
+ before <literal>?</literal> (parameter substitution when using
+ prepared statements within a programming language interface).
+ </para>
+
+ <para>
+ Examples:
+ </para>
+
+<programlisting>
+SELECT _latin1 x'AABBCC';
+SELECT _latin1 0xAABBCC;
+SELECT _latin1 ?;
+</programlisting>
+
+ <para>
+ MySQL determines a literal's character set and collation thus:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ If both <replaceable>_X</replaceable> and <literal>COLLATE
+ <replaceable>Y</replaceable></literal> were specified, then
+ character set <replaceable>X</replaceable> and collation
+ <replaceable>Y</replaceable> are used.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ If <replaceable>_X</replaceable> is specified but
+ <literal>COLLATE</literal> is not specified, then character
+ set <replaceable>X</replaceable> and its default collation
+ are used.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Otherwise, the character set and collation given by the
+ <literal>character_set_connection</literal> and
+ <literal>collation_connection</literal> system variables are
+ used.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ Examples:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ A string with <literal>latin1</literal> character set and
+ <literal>latin1_german1_ci</literal> collation:
+ </para>
+
+<programlisting>
+SELECT _latin1'Müller' COLLATE latin1_german1_ci;
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ A string with <literal>latin1</literal> character set and
+ its default collation (that is,
+ <literal>latin1_swedish_ci</literal>):
+ </para>
+
+<programlisting>
+SELECT _latin1'Müller';
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ A string with the connection default character set and
+ collation:
+ </para>
+
+<programlisting>
+SELECT 'Müller';
+</programlisting>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ Character set introducers and the <literal>COLLATE</literal>
+ clause are implemented according to standard SQL specifications.
+ </para>
+
+ </section>
+
+ <section id="charset-national">
+
+ <title>&title-charset-national;</title>
+
+ <para>
+ ANSI SQL defines <literal>NCHAR</literal> or <literal>NATIONAL
+ CHAR</literal> as a way to indicate that a
+ <literal>CHAR</literal> column should use some predefined
+ character set. MySQL ¤t-series; uses
+ <literal>utf8</literal> as this predefined character set. For
+ example, these data type declarations are equivalent:
+ </para>
+
+<programlisting>
+CHAR(10) CHARACTER SET utf8
+NATIONAL CHARACTER(10)
+NCHAR(10)
+</programlisting>
+
+ <para>
+ As are these:
+ </para>
+
+<programlisting>
+VARCHAR(10) CHARACTER SET utf8
+NATIONAL VARCHAR(10)
+NCHAR VARCHAR(10)
+NATIONAL CHARACTER VARYING(10)
+NATIONAL CHAR VARYING(10)
+</programlisting>
+
+ <para>
+ You can use
+ <literal>N'<replaceable>literal</replaceable>'</literal>
to
+ create a string in the national character set. These two
+ statements are equivalent:
+ </para>
+
+<programlisting>
+SELECT N'some text';
+SELECT _utf8'some text';
+</programlisting>
+
+ <para>
+ For information on upgrading character sets to MySQL
+ ¤t-series; from versions prior to 4.1, see the
+ <citetitle>&title-refman-4-1;</citetitle>.
+ </para>
+
+ </section>
+
<section id="charset-examples">
<title>&title-charset-examples;</title>
@@ -831,6 +1043,21 @@
</section>
+ <section id="charset-compatibility">
+
+ <title>&title-charset-compatibility;</title>
+
+ <para>
+ For MaxDB compatibility these two statements are the same:
+ </para>
+
+<programlisting>
+CREATE TABLE t1 (f1 CHAR(<replaceable>n</replaceable>) UNICODE);
+CREATE TABLE t1 (f1 CHAR(<replaceable>n</replaceable>) CHARACTER SET ucs2);
+</programlisting>
+
+ </section>
+
<section id="charset-connection">
<title>&title-charset-connection;</title>
@@ -1065,167 +1292,12 @@
<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.
+ be used as a client character set, which means that <literal>SET
+ NAMES 'ucs2'</literal> does not work.
</para>
</section>
- <section id="charset-literal">
-
- <title>&title-charset-literal;</title>
-
- <para>
- Every character string literal has a character set and a
- collation.
- </para>
-
- <para>
- A character string literal may have an optional character set
- introducer and <literal>COLLATE</literal> clause:
- </para>
-
- <indexterm>
- <primary>introducer</primary>
- <secondary>string literal</secondary>
- </indexterm>
-
- <indexterm>
- <primary>string literal introducer</primary>
- </indexterm>
-
-<programlisting>
-[_<replaceable>charset_name</replaceable>]'<replaceable>string</replaceable>'
[COLLATE <replaceable>collation_name</replaceable>]
-</programlisting>
-
- <para>
- Examples:
- </para>
-
-<programlisting>
-SELECT '<replaceable>string</replaceable>';
-SELECT _latin1'<replaceable>string</replaceable>';
-SELECT _latin1'<replaceable>string</replaceable>' COLLATE latin1_danish_ci;
-</programlisting>
-
- <para>
- For the simple statement <literal>SELECT
- '<replaceable>string</replaceable>'</literal>, the string has
- the character set and collation defined by the
- <literal>character_set_connection</literal> and
- <literal>collation_connection</literal> system variables.
- </para>
-
- <para>
- The
<literal>_<replaceable>charset_name</replaceable></literal>
- expression is formally called an
- <emphasis>introducer</emphasis>. It tells the parser,
<quote>the
- string that is about to follow uses character set
- <replaceable>X</replaceable>.</quote> Because this has confused
- people in the past, we emphasize that an introducer does not
- cause any conversion; it is strictly a signal that does not
- change the string's value. An introducer is also legal before
- standard hex literal and numeric hex literal notation
- (<literal>x'<replaceable>literal</replaceable>'</literal>
and
- <literal>0x<replaceable>nnnn</replaceable></literal>),
and
- before <literal>?</literal> (parameter substitution when using
- prepared statements within a programming language interface).
- </para>
-
- <para>
- Examples:
- </para>
-
-<programlisting>
-SELECT _latin1 x'AABBCC';
-SELECT _latin1 0xAABBCC;
-SELECT _latin1 ?;
-</programlisting>
-
- <para>
- MySQL determines a literal's character set and collation thus:
- </para>
-
- <itemizedlist>
-
- <listitem>
- <para>
- If both <replaceable>_X</replaceable> and <literal>COLLATE
- <replaceable>Y</replaceable></literal> were specified, then
- character set <replaceable>X</replaceable> and collation
- <replaceable>Y</replaceable> are used.
- </para>
- </listitem>
-
- <listitem>
- <para>
- If <replaceable>_X</replaceable> is specified but
- <literal>COLLATE</literal> is not specified, then character
- set <replaceable>X</replaceable> and its default collation
- are used.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Otherwise, the character set and collation given by the
- <literal>character_set_connection</literal> and
- <literal>collation_connection</literal> system variables are
- used.
- </para>
- </listitem>
-
- </itemizedlist>
-
- <para>
- Examples:
- </para>
-
- <itemizedlist>
-
- <listitem>
- <para>
- A string with <literal>latin1</literal> character set and
- <literal>latin1_german1_ci</literal> collation:
- </para>
-
-<programlisting>
-SELECT _latin1'Müller' COLLATE latin1_german1_ci;
-</programlisting>
- </listitem>
-
- <listitem>
- <para>
- A string with <literal>latin1</literal> character set and
- its default collation (that is,
- <literal>latin1_swedish_ci</literal>):
- </para>
-
-<programlisting>
-SELECT _latin1'Müller';
-</programlisting>
- </listitem>
-
- <listitem>
- <para>
- A string with the connection default character set and
- collation:
- </para>
-
-<programlisting>
-SELECT 'Müller';
-</programlisting>
- </listitem>
-
- </itemizedlist>
-
- <para>
- Character set introducers and the <literal>COLLATE</literal>
- clause are implemented according to standard SQL specifications.
- </para>
-
- </section>
-
<section id="charset-collate">
<title>&title-charset-collate;</title>
@@ -1556,7 +1628,7 @@
<programlisting>
mysql> <userinput>SELECT _latin1 'x' COLLATE latin2_bin;</userinput>
-ERROR 1251: COLLATION 'latin2_bin' is not valid
+ERROR 1253 (42000): COLLATION 'latin2_bin' is not valid
for CHARACTER SET 'latin1'
</programlisting>
@@ -2032,9 +2104,8 @@
</para>
<para>
- Currently, UCS-2 cannot yet be used as a client character set,
- which means that <literal>SET NAMES 'ucs2'</literal> does not
- work.
+ Currently, UCS-2 cannot be used as a client character set, which
+ means that <literal>SET NAMES 'ucs2'</literal> does not work.
</para>
<para>
@@ -2237,21 +2308,6 @@
</section>
- <section id="charset-compatibility">
-
- <title>&title-charset-compatibility;</title>
-
- <para>
- For MaxDB compatibility these two statements are the same:
- </para>
-
-<programlisting>
-CREATE TABLE t1 (f1 CHAR(<replaceable>n</replaceable>) UNICODE);
-CREATE TABLE t1 (f1 CHAR(<replaceable>n</replaceable>) CHARACTER SET ucs2);
-</programlisting>
-
- </section>
-
<section id="charset-config-file">
<title>&title-charset-config-file;</title>
@@ -2263,57 +2319,6 @@
</section>
- <section id="charset-national">
-
- <title>&title-charset-national;</title>
-
- <para>
- ANSI SQL defines <literal>NCHAR</literal> or <literal>NATIONAL
- CHAR</literal> as a way to indicate that a
<literal>CHAR</literal>
- column should use some predefined character set. MySQL
- ¤t-series; uses <literal>utf8</literal> as this predefined
- character set. For example, these data type declarations are
- equivalent:
- </para>
-
-<programlisting>
-CHAR(10) CHARACTER SET utf8
-NATIONAL CHARACTER(10)
-NCHAR(10)
-</programlisting>
-
- <para>
- As are these:
- </para>
-
-<programlisting>
-VARCHAR(10) CHARACTER SET utf8
-NATIONAL VARCHAR(10)
-NCHAR VARCHAR(10)
-NATIONAL CHARACTER VARYING(10)
-NATIONAL CHAR VARYING(10)
-</programlisting>
-
- <para>
- You can use
- <literal>N'<replaceable>literal</replaceable>'</literal> to
create
- a string in the national character set. These two statements are
- equivalent:
- </para>
-
-<programlisting>
-SELECT N'some text';
-SELECT _utf8'some text';
-</programlisting>
-
- <para>
- For information on upgrading character sets to MySQL
- ¤t-series; from versions prior to 4.1, see the
- <citetitle>&title-refman-4-1;</citetitle>.
- </para>
-
- </section>
-
<section id="charset-charsets">
<title>&title-charset-charsets;</title>
Modified: trunk/refman-5.1/charset.xml
===================================================================
--- trunk/refman-5.1/charset.xml 2006-01-14 18:04:17 UTC (rev 829)
+++ trunk/refman-5.1/charset.xml 2006-01-14 18:05:38 UTC (rev 830)
@@ -393,6 +393,12 @@
obvious results.
</para>
+ <para>
+ <literal>CHARACTER SET</literal> is used in clauses that specify a
+ character set. <literal>CHARSET</literal> may be used as a synonym
+ for <literal>CHARACTER SET</literal>.
+ </para>
+
<section id="charset-server">
<title>&title-charset-server;</title>
@@ -729,6 +735,212 @@
</section>
+ <section id="charset-literal">
+
+ <title>&title-charset-literal;</title>
+
+ <para>
+ Every character string literal has a character set and a
+ collation.
+ </para>
+
+ <para>
+ A character string literal may have an optional character set
+ introducer and <literal>COLLATE</literal> clause:
+ </para>
+
+ <indexterm>
+ <primary>introducer</primary>
+ <secondary>string literal</secondary>
+ </indexterm>
+
+ <indexterm>
+ <primary>string literal introducer</primary>
+ </indexterm>
+
+<programlisting>
+[_<replaceable>charset_name</replaceable>]'<replaceable>string</replaceable>'
[COLLATE <replaceable>collation_name</replaceable>]
+</programlisting>
+
+ <para>
+ Examples:
+ </para>
+
+<programlisting>
+SELECT '<replaceable>string</replaceable>';
+SELECT _latin1'<replaceable>string</replaceable>';
+SELECT _latin1'<replaceable>string</replaceable>' COLLATE latin1_danish_ci;
+</programlisting>
+
+ <para>
+ For the simple statement <literal>SELECT
+ '<replaceable>string</replaceable>'</literal>, the string has
+ the character set and collation defined by the
+ <literal>character_set_connection</literal> and
+ <literal>collation_connection</literal> system variables.
+ </para>
+
+ <para>
+ The
<literal>_<replaceable>charset_name</replaceable></literal>
+ expression is formally called an
+ <emphasis>introducer</emphasis>. It tells the parser,
<quote>the
+ string that is about to follow uses character set
+ <replaceable>X</replaceable>.</quote> Because this has confused
+ people in the past, we emphasize that an introducer does not
+ cause any conversion; it is strictly a signal that does not
+ change the string's value. An introducer is also legal before
+ standard hex literal and numeric hex literal notation
+ (<literal>x'<replaceable>literal</replaceable>'</literal>
and
+ <literal>0x<replaceable>nnnn</replaceable></literal>),
and
+ before <literal>?</literal> (parameter substitution when using
+ prepared statements within a programming language interface).
+ </para>
+
+ <para>
+ Examples:
+ </para>
+
+<programlisting>
+SELECT _latin1 x'AABBCC';
+SELECT _latin1 0xAABBCC;
+SELECT _latin1 ?;
+</programlisting>
+
+ <para>
+ MySQL determines a literal's character set and collation thus:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ If both <replaceable>_X</replaceable> and <literal>COLLATE
+ <replaceable>Y</replaceable></literal> were specified, then
+ character set <replaceable>X</replaceable> and collation
+ <replaceable>Y</replaceable> are used.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ If <replaceable>_X</replaceable> is specified but
+ <literal>COLLATE</literal> is not specified, then character
+ set <replaceable>X</replaceable> and its default collation
+ are used.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Otherwise, the character set and collation given by the
+ <literal>character_set_connection</literal> and
+ <literal>collation_connection</literal> system variables are
+ used.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ Examples:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ A string with <literal>latin1</literal> character set and
+ <literal>latin1_german1_ci</literal> collation:
+ </para>
+
+<programlisting>
+SELECT _latin1'Müller' COLLATE latin1_german1_ci;
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ A string with <literal>latin1</literal> character set and
+ its default collation (that is,
+ <literal>latin1_swedish_ci</literal>):
+ </para>
+
+<programlisting>
+SELECT _latin1'Müller';
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <para>
+ A string with the connection default character set and
+ collation:
+ </para>
+
+<programlisting>
+SELECT 'Müller';
+</programlisting>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ Character set introducers and the <literal>COLLATE</literal>
+ clause are implemented according to standard SQL specifications.
+ </para>
+
+ </section>
+
+ <section id="charset-national">
+
+ <title>&title-charset-national;</title>
+
+ <para>
+ ANSI SQL defines <literal>NCHAR</literal> or <literal>NATIONAL
+ CHAR</literal> as a way to indicate that a
+ <literal>CHAR</literal> column should use some predefined
+ character set. MySQL ¤t-series; uses
+ <literal>utf8</literal> as this predefined character set. For
+ example, these data type declarations are equivalent:
+ </para>
+
+<programlisting>
+CHAR(10) CHARACTER SET utf8
+NATIONAL CHARACTER(10)
+NCHAR(10)
+</programlisting>
+
+ <para>
+ As are these:
+ </para>
+
+<programlisting>
+VARCHAR(10) CHARACTER SET utf8
+NATIONAL VARCHAR(10)
+NCHAR VARCHAR(10)
+NATIONAL CHARACTER VARYING(10)
+NATIONAL CHAR VARYING(10)
+</programlisting>
+
+ <para>
+ You can use
+ <literal>N'<replaceable>literal</replaceable>'</literal>
to
+ create a string in the national character set. These two
+ statements are equivalent:
+ </para>
+
+<programlisting>
+SELECT N'some text';
+SELECT _utf8'some text';
+</programlisting>
+
+ <para>
+ For information on upgrading character sets to MySQL
+ ¤t-series; from versions prior to 4.1, see the
+ <citetitle>&title-refman-4-1;</citetitle>.
+ </para>
+
+ </section>
+
<section id="charset-examples">
<title>&title-charset-examples;</title>
@@ -831,6 +1043,21 @@
</section>
+ <section id="charset-compatibility">
+
+ <title>&title-charset-compatibility;</title>
+
+ <para>
+ For MaxDB compatibility these two statements are the same:
+ </para>
+
+<programlisting>
+CREATE TABLE t1 (f1 CHAR(<replaceable>n</replaceable>) UNICODE);
+CREATE TABLE t1 (f1 CHAR(<replaceable>n</replaceable>) CHARACTER SET ucs2);
+</programlisting>
+
+ </section>
+
<section id="charset-connection">
<title>&title-charset-connection;</title>
@@ -1065,167 +1292,12 @@
<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.
+ be used as a client character set, which means that <literal>SET
+ NAMES 'ucs2'</literal> does not work.
</para>
</section>
- <section id="charset-literal">
-
- <title>&title-charset-literal;</title>
-
- <para>
- Every character string literal has a character set and a
- collation.
- </para>
-
- <para>
- A character string literal may have an optional character set
- introducer and <literal>COLLATE</literal> clause:
- </para>
-
- <indexterm>
- <primary>introducer</primary>
- <secondary>string literal</secondary>
- </indexterm>
-
- <indexterm>
- <primary>string literal introducer</primary>
- </indexterm>
-
-<programlisting>
-[_<replaceable>charset_name</replaceable>]'<replaceable>string</replaceable>'
[COLLATE <replaceable>collation_name</replaceable>]
-</programlisting>
-
- <para>
- Examples:
- </para>
-
-<programlisting>
-SELECT '<replaceable>string</replaceable>';
-SELECT _latin1'<replaceable>string</replaceable>';
-SELECT _latin1'<replaceable>string</replaceable>' COLLATE latin1_danish_ci;
-</programlisting>
-
- <para>
- For the simple statement <literal>SELECT
- '<replaceable>string</replaceable>'</literal>, the string has
- the character set and collation defined by the
- <literal>character_set_connection</literal> and
- <literal>collation_connection</literal> system variables.
- </para>
-
- <para>
- The
<literal>_<replaceable>charset_name</replaceable></literal>
- expression is formally called an
- <emphasis>introducer</emphasis>. It tells the parser,
<quote>the
- string that is about to follow uses character set
- <replaceable>X</replaceable>.</quote> Because this has confused
- people in the past, we emphasize that an introducer does not
- cause any conversion; it is strictly a signal that does not
- change the string's value. An introducer is also legal before
- standard hex literal and numeric hex literal notation
- (<literal>x'<replaceable>literal</replaceable>'</literal>
and
- <literal>0x<replaceable>nnnn</replaceable></literal>),
and
- before <literal>?</literal> (parameter substitution when using
- prepared statements within a programming language interface).
- </para>
-
- <para>
- Examples:
- </para>
-
-<programlisting>
-SELECT _latin1 x'AABBCC';
-SELECT _latin1 0xAABBCC;
-SELECT _latin1 ?;
-</programlisting>
-
- <para>
- MySQL determines a literal's character set and collation thus:
- </para>
-
- <itemizedlist>
-
- <listitem>
- <para>
- If both <replaceable>_X</replaceable> and <literal>COLLATE
- <replaceable>Y</replaceable></literal> were specified, then
- character set <replaceable>X</replaceable> and collation
- <replaceable>Y</replaceable> are used.
- </para>
- </listitem>
-
- <listitem>
- <para>
- If <replaceable>_X</replaceable> is specified but
- <literal>COLLATE</literal> is not specified, then character
- set <replaceable>X</replaceable> and its default collation
- are used.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Otherwise, the character set and collation given by the
- <literal>character_set_connection</literal> and
- <literal>collation_connection</literal> system variables are
- used.
- </para>
- </listitem>
-
- </itemizedlist>
-
- <para>
- Examples:
- </para>
-
- <itemizedlist>
-
- <listitem>
- <para>
- A string with <literal>latin1</literal> character set and
- <literal>latin1_german1_ci</literal> collation:
- </para>
-
-<programlisting>
-SELECT _latin1'Müller' COLLATE latin1_german1_ci;
-</programlisting>
- </listitem>
-
- <listitem>
- <para>
- A string with <literal>latin1</literal> character set and
- its default collation (that is,
- <literal>latin1_swedish_ci</literal>):
- </para>
-
-<programlisting>
-SELECT _latin1'Müller';
-</programlisting>
- </listitem>
-
- <listitem>
- <para>
- A string with the connection default character set and
- collation:
- </para>
-
-<programlisting>
-SELECT 'Müller';
-</programlisting>
- </listitem>
-
- </itemizedlist>
-
- <para>
- Character set introducers and the <literal>COLLATE</literal>
- clause are implemented according to standard SQL specifications.
- </para>
-
- </section>
-
<section id="charset-collate">
<title>&title-charset-collate;</title>
@@ -1555,7 +1627,7 @@
<programlisting>
mysql> <userinput>SELECT _latin1 'x' COLLATE latin2_bin;</userinput>
-ERROR 1251: COLLATION 'latin2_bin' is not valid
+ERROR 1253 (42000): COLLATION 'latin2_bin' is not valid
for CHARACTER SET 'latin1'
</programlisting>
@@ -2031,9 +2103,8 @@
</para>
<para>
- Currently, UCS-2 cannot yet be used as a client character set,
- which means that <literal>SET NAMES 'ucs2'</literal> does not
- work.
+ Currently, UCS-2 cannot be used as a client character set, which
+ means that <literal>SET NAMES 'ucs2'</literal> does not work.
</para>
<para>
@@ -2236,21 +2307,6 @@
</section>
- <section id="charset-compatibility">
-
- <title>&title-charset-compatibility;</title>
-
- <para>
- For MaxDB compatibility these two statements are the same:
- </para>
-
-<programlisting>
-CREATE TABLE t1 (f1 CHAR(<replaceable>n</replaceable>) UNICODE);
-CREATE TABLE t1 (f1 CHAR(<replaceable>n</replaceable>) CHARACTER SET ucs2);
-</programlisting>
-
- </section>
-
<section id="charset-config-file">
<title>&title-charset-config-file;</title>
@@ -2262,57 +2318,6 @@
</section>
- <section id="charset-national">
-
- <title>&title-charset-national;</title>
-
- <para>
- ANSI SQL defines <literal>NCHAR</literal> or <literal>NATIONAL
- CHAR</literal> as a way to indicate that a
<literal>CHAR</literal>
- column should use some predefined character set. MySQL
- ¤t-series; uses <literal>utf8</literal> as this predefined
- character set. For example, these data type declarations are
- equivalent:
- </para>
-
-<programlisting>
-CHAR(10) CHARACTER SET utf8
-NATIONAL CHARACTER(10)
-NCHAR(10)
-</programlisting>
-
- <para>
- As are these:
- </para>
-
-<programlisting>
-VARCHAR(10) CHARACTER SET utf8
-NATIONAL VARCHAR(10)
-NCHAR VARCHAR(10)
-NATIONAL CHARACTER VARYING(10)
-NATIONAL CHAR VARYING(10)
-</programlisting>
-
- <para>
- You can use
- <literal>N'<replaceable>literal</replaceable>'</literal> to
create
- a string in the national character set. These two statements are
- equivalent:
- </para>
-
-<programlisting>
-SELECT N'some text';
-SELECT _utf8'some text';
-</programlisting>
-
- <para>
- For information on upgrading character sets to MySQL
- ¤t-series; from versions prior to 4.1, see the
- <citetitle>&title-refman-4-1;</citetitle>.
- </para>
-
- </section>
-
<section id="charset-charsets">
<title>&title-charset-charsets;</title>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r830 - in trunk: . refman-4.1 refman-5.0 refman-5.1 | paul | 14 Jan |