Author: paul
Date: 2006-01-21 06:57:21 +0100 (Sat, 21 Jan 2006)
New Revision: 965
Log:
r6513@frost: paul | 2006-01-20 23:39:48 -0600
General revisions.
Modified:
trunk/
trunk/refman-4.1/functions.xml
trunk/refman-5.0/functions.xml
trunk/refman-5.1/functions.xml
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:6511
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:2396
+ b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:6513
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:2396
Modified: trunk/refman-4.1/functions.xml
===================================================================
--- trunk/refman-4.1/functions.xml 2006-01-21 03:59:36 UTC (rev 964)
+++ trunk/refman-4.1/functions.xml 2006-01-21 05:57:21 UTC (rev 965)
@@ -10905,8 +10905,9 @@
</programlisting>
<para>
- <literal>BINARY</literal> affects the entire comparison; it
- can be given before either operand with the same result.
+ In a comparison, <literal>BINARY</literal> affects the entire
+ operation; it can be given before either operand with the same
+ result.
</para>
<para>
@@ -10922,60 +10923,6 @@
<literal>BINARY</literal>, MySQL is not able to use the index
efficiently.
</para>
-
- <para>
- If you want to compare a <literal>BLOB</literal> value or
- other binary string in case-insensitive fashion, you can do so
- as follows:
- </para>
-
- <itemizedlist>
-
- <listitem>
- <para>
- Before MySQL 4.1.1, use the <literal>UPPER()</literal>
- function to convert the binary string to uppercase before
- performing the comparison:
- </para>
-
-<programlisting>
-SELECT 'A' LIKE UPPER(<replaceable>blob_col</replaceable>) FROM <replaceable>tbl_name</replaceable>;
-</programlisting>
-
- <para>
- If the comparison value is lowercase, convert the string
- value using <literal>LOWER()</literal> instead.
- </para>
- </listitem>
-
- <listitem>
- <para>
- For MySQL 4.1.1 and up, binary strings have no character
- set, and thus no concept of lettercase. To perform a
- case-insensitive comparison, use the
- <literal>CONVERT()</literal> function to convert the
- string value to a character set that is not case
- sensitive. The result is a non-binary string, so the
- <literal>LIKE</literal> operation is not case sensitive:
- </para>
-
-<programlisting>
-SELECT 'A' LIKE CONVERT(<replaceable>blob_col</replaceable> USING latin1) FROM <replaceable>tbl_name</replaceable>;
-</programlisting>
-
- <para>
- To use a different character set, substitute its name for
- <literal>latin1</literal> in the preceding statement.
- </para>
- </listitem>
-
- </itemizedlist>
-
- <para>
- <literal>CONVERT()</literal> can be used more generally for
- comparing strings that are represented in different character
- sets.
- </para>
</listitem>
<listitem>
@@ -11009,8 +10956,8 @@
<para>
The <literal>CAST()</literal> and <literal>CONVERT()</literal>
- functions can be used to take a value of one type and produce
- a value of another type.
+ functions take a value of one type and produce a value of
+ another type.
</para>
<para>
@@ -11072,11 +11019,8 @@
<literal>BINARY</literal> produces a string with the
<literal>BINARY</literal> data type. See
<xref linkend="binary-varbinary"/> for a description of how
- this affects comparisons.
- </para>
-
- <para>
- If the optional length <replaceable>N</replaceable> is given,
+ this affects comparisons. If the optional length
+ <replaceable>N</replaceable> is given,
<literal>BINARY[<replaceable>N</replaceable>]</literal> causes
the cast to use no more than <replaceable>N</replaceable>
bytes of the argument. Similarly,
@@ -11105,9 +11049,9 @@
used to convert data between different character sets. In
MySQL, transcoding names are the same as the corresponding
character set names. For example, this statement converts the
- string <literal>'abc'</literal> in the server's default
- character set to the corresponding string in the
- <literal>utf8</literal> character set:
+ string <literal>'abc'</literal> in the default character set
+ to the corresponding string in the <literal>utf8</literal>
+ character set:
</para>
<programlisting>
@@ -11120,6 +11064,63 @@
</itemizedlist>
<para>
+ If you want to compare a <literal>BLOB</literal> value or other
+ binary string in case-insensitive fashion, you can do so as
+ follows:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ Before MySQL 4.1.1, use the <literal>UPPER()</literal>
+ function to convert the binary string to uppercase before
+ performing the comparison:
+ </para>
+
+<programlisting>
+SELECT 'A' LIKE UPPER(<replaceable>blob_col</replaceable>) FROM <replaceable>tbl_name</replaceable>;
+</programlisting>
+
+ <para>
+ If the comparison value is lowercase, convert the string value
+ using <literal>LOWER()</literal> instead.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ For MySQL 4.1.1 and up, binary strings have no character set,
+ and thus no concept of lettercase. To perform a
+ case-insensitive comparison, use the
+ <literal>CONVERT()</literal> function to convert the value to
+ a non-binary string. If the character set of the result has a
+ case-insensitive collation, the <literal>LIKE</literal>
+ operation is not case sensitive:
+ </para>
+
+<programlisting>
+SELECT 'A' LIKE CONVERT(<replaceable>blob_col</replaceable> USING latin1) FROM <replaceable>tbl_name</replaceable>;
+</programlisting>
+
+ <para>
+ To use a different character set, substitute its name for
+ <literal>latin1</literal> in the preceding statement. To
+ ensure that a case-insensitive collation is used, specify a
+ <literal>COLLATE</literal> clause following the
+ <literal>CONVERT()</literal> call.
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ <literal>CONVERT()</literal> can be used more generally for
+ comparing strings that are represented in different character
+ sets.
+ </para>
+
+ <para>
The cast functions are useful when you want to create a column
with a specific type in a <literal>CREATE …
SELECT</literal> statement:
Modified: trunk/refman-5.0/functions.xml
===================================================================
--- trunk/refman-5.0/functions.xml 2006-01-21 03:59:36 UTC (rev 964)
+++ trunk/refman-5.0/functions.xml 2006-01-21 05:57:21 UTC (rev 965)
@@ -10984,8 +10984,9 @@
</programlisting>
<para>
- <literal>BINARY</literal> affects the entire comparison; it
- can be given before either operand with the same result.
+ In a comparison, <literal>BINARY</literal> affects the entire
+ operation; it can be given before either operand with the same
+ result.
</para>
<para>
@@ -10999,33 +11000,6 @@
<literal>BINARY</literal>, MySQL is not able to use the index
efficiently.
</para>
-
- <para>
- If you want to compare a <literal>BLOB</literal> value or
- other binary string in case-insensitive fashion, you can do so
- by taking advantage of the fact that binary strings have no
- character set, and thus no concept of lettercase. To perform a
- case-insensitive comparison, use the
- <literal>CONVERT()</literal> function to convert the string
- value to a character set that is not case sensitive. The
- result is a non-binary string, so the <literal>LIKE</literal>
- operation is not case sensitive:
- </para>
-
-<programlisting>
-SELECT 'A' LIKE CONVERT(<replaceable>blob_col</replaceable> USING latin1) FROM <replaceable>tbl_name</replaceable>;
-</programlisting>
-
- <para>
- To use a different character set, substitute its name for
- <literal>latin1</literal> in the preceding statement.
- </para>
-
- <para>
- <literal>CONVERT()</literal> can be used more generally for
- comparing strings that are represented in different character
- sets.
- </para>
</listitem>
<listitem>
@@ -11059,8 +11033,8 @@
<para>
The <literal>CAST()</literal> and <literal>CONVERT()</literal>
- functions can be used to take a value of one type and produce
- a value of another type.
+ functions take a value of one type and produce a value of
+ another type.
</para>
<para>
@@ -11124,16 +11098,14 @@
<literal>BINARY</literal> produces a string with the
<literal>BINARY</literal> data type. See
<xref linkend="binary-varbinary"/> for a description of how
- this affects comparisons.
- </para>
-
- <para>
- If the optional length <replaceable>N</replaceable> is given,
+ this affects comparisons. If the optional length
+ <replaceable>N</replaceable> is given,
<literal>BINARY[<replaceable>N</replaceable>]</literal> causes
the cast to use no more than <replaceable>N</replaceable>
bytes of the argument. As of MySQL 5.0.17, values shorter than
- <replaceable>N</replaceable> bytes are padded with 0x00 bytes
- to a length of <replaceable>N</replaceable>.
+ <replaceable>N</replaceable> bytes are padded with
+ <literal>0x00</literal> bytes to a length of
+ <replaceable>N</replaceable>.
</para>
<para>
@@ -11159,9 +11131,9 @@
used to convert data between different character sets. In
MySQL, transcoding names are the same as the corresponding
character set names. For example, this statement converts the
- string <literal>'abc'</literal> in the server's default
- character set to the corresponding string in the
- <literal>utf8</literal> character set:
+ string <literal>'abc'</literal> in the default character set
+ to the corresponding string in the <literal>utf8</literal>
+ character set:
</para>
<programlisting>
@@ -11174,6 +11146,35 @@
</itemizedlist>
<para>
+ Normally, you cannot compare a <literal>BLOB</literal> value or
+ other binary string in case-insensitive fashion because binary
+ strings have no character set, and thus no concept of lettercase.
+ To perform a case-insensitive comparison, use the
+ <literal>CONVERT()</literal> function to convert the value to a
+ non-binary string. If the character set of the result has a
+ case-insensitive collation, the <literal>LIKE</literal> operation
+ is not case sensitive:
+ </para>
+
+<programlisting>
+SELECT 'A' LIKE CONVERT(<replaceable>blob_col</replaceable> USING latin1) FROM <replaceable>tbl_name</replaceable>;
+</programlisting>
+
+ <para>
+ To use a different character set, substitute its name for
+ <literal>latin1</literal> in the preceding statement. To ensure
+ that a case-insensitive collation is used, specify a
+ <literal>COLLATE</literal> clause following the
+ <literal>CONVERT()</literal> call.
+ </para>
+
+ <para>
+ <literal>CONVERT()</literal> can be used more generally for
+ comparing strings that are represented in different character
+ sets.
+ </para>
+
+ <para>
The cast functions are useful when you want to create a column
with a specific type in a <literal>CREATE …
SELECT</literal> statement:
Modified: trunk/refman-5.1/functions.xml
===================================================================
--- trunk/refman-5.1/functions.xml 2006-01-21 03:59:36 UTC (rev 964)
+++ trunk/refman-5.1/functions.xml 2006-01-21 05:57:21 UTC (rev 965)
@@ -10932,8 +10932,9 @@
</programlisting>
<para>
- <literal>BINARY</literal> affects the entire comparison; it
- can be given before either operand with the same result.
+ In a comparison, <literal>BINARY</literal> affects the entire
+ operation; it can be given before either operand with the same
+ result.
</para>
<para>
@@ -10947,33 +10948,6 @@
<literal>BINARY</literal>, MySQL is not able to use the index
efficiently.
</para>
-
- <para>
- If you want to compare a <literal>BLOB</literal> value or
- other binary string in case-insensitive fashion, you can do so
- by taking advantage of the fact that binary strings have no
- character set, and thus no concept of lettercase. To perform a
- case-insensitive comparison, use the
- <literal>CONVERT()</literal> function to convert the string
- value to a character set that is not case sensitive. The
- result is a non-binary string, so the <literal>LIKE</literal>
- operation is not case sensitive:
- </para>
-
-<programlisting>
-SELECT 'A' LIKE CONVERT(<replaceable>blob_col</replaceable> USING latin1) FROM <replaceable>tbl_name</replaceable>;
-</programlisting>
-
- <para>
- To use a different character set, substitute its name for
- <literal>latin1</literal> in the preceding statement.
- </para>
-
- <para>
- <literal>CONVERT()</literal> can be used more generally for
- comparing strings that are represented in different character
- sets.
- </para>
</listitem>
<listitem>
@@ -11007,8 +10981,8 @@
<para>
The <literal>CAST()</literal> and <literal>CONVERT()</literal>
- functions can be used to take a value of one type and produce
- a value of another type.
+ functions take a value of one type and produce a value of
+ another type.
</para>
<para>
@@ -11072,16 +11046,14 @@
<literal>BINARY</literal> produces a string with the
<literal>BINARY</literal> data type. See
<xref linkend="binary-varbinary"/> for a description of how
- this affects comparisons.
- </para>
-
- <para>
- If the optional length <replaceable>N</replaceable> is given,
+ this affects comparisons. If the optional length
+ <replaceable>N</replaceable> is given,
<literal>BINARY[<replaceable>N</replaceable>]</literal> causes
the cast to use no more than <replaceable>N</replaceable>
bytes of the argument. Values shorter than
- <replaceable>N</replaceable> bytes are padded with 0x00 bytes
- to a length of <replaceable>N</replaceable>.
+ <replaceable>N</replaceable> bytes are padded with
+ <literal>0x00</literal> bytes to a length of
+ <replaceable>N</replaceable>.
</para>
<para>
@@ -11102,9 +11074,9 @@
used to convert data between different character sets. In
MySQL, transcoding names are the same as the corresponding
character set names. For example, this statement converts the
- string <literal>'abc'</literal> in the server's default
- character set to the corresponding string in the
- <literal>utf8</literal> character set:
+ string <literal>'abc'</literal> in the default character set
+ to the corresponding string in the <literal>utf8</literal>
+ character set:
</para>
<programlisting>
@@ -11117,6 +11089,35 @@
</itemizedlist>
<para>
+ Normally, you cannot compare a <literal>BLOB</literal> value or
+ other binary string in case-insensitive fashion because binary
+ strings have no character set, and thus no concept of lettercase.
+ To perform a case-insensitive comparison, use the
+ <literal>CONVERT()</literal> function to convert the value to a
+ non-binary string. If the character set of the result has a
+ case-insensitive collation, the <literal>LIKE</literal> operation
+ is not case sensitive:
+ </para>
+
+<programlisting>
+SELECT 'A' LIKE CONVERT(<replaceable>blob_col</replaceable> USING latin1) FROM <replaceable>tbl_name</replaceable>;
+</programlisting>
+
+ <para>
+ To use a different character set, substitute its name for
+ <literal>latin1</literal> in the preceding statement. To ensure
+ that a case-insensitive collation is used, specify a
+ <literal>COLLATE</literal> clause following the
+ <literal>CONVERT()</literal> call.
+ </para>
+
+ <para>
+ <literal>CONVERT()</literal> can be used more generally for
+ comparing strings that are represented in different character
+ sets.
+ </para>
+
+ <para>
The cast functions are useful when you want to create a column
with a specific type in a <literal>CREATE …
SELECT</literal> statement:
@@ -11235,9 +11236,9 @@
<para>
Note that it is possible to obtain XML-formatted output from MySQL
- in the <command>mysql</command> client by invoking it with the
- <option>--xml</option> option. See
- <xref linkend="mysql-command-options"/>.
+ in the <command>mysql</command> or <command>mysqldump</command>
+ client by invoking it with the <option>--xml</option> option. See
+ <xref linkend="mysql"/>, and <xref linkend="mysqldump"/>.
</para>
<para>
@@ -11285,7 +11286,7 @@
matching <replaceable>xpath_expr</replaceable>, and does not
return any tags that might be contained within the matching
tag, nor any of their content (see the result returned as
- <literal>val1</literal> below for an example).
+ <literal>val1</literal> in the following example).
</para>
<para>
@@ -11302,9 +11303,9 @@
valid XML. If <replaceable>xpath_expr</replaceable> is not a
valid XPath expression, then MySQL returns an error. -->
- If multiple matches are found, then the contents of all
- matching elements are returned (in the order matched) as a
- single, space-delimited string.
+ If multiple matches are found, the contents of all matching
+ elements are returned (in the order matched) as a single,
+ space-delimited string.
</para>
<remark role="help-description-end"/>
@@ -11354,10 +11355,9 @@
<replaceable>xml_target</replaceable> that is replaced matches
an XPath expression <replaceable>xpath_expr</replaceable>
supplied by the user. If no expression matching
- <replaceable>xpath_expr</replaceable> is found, then the
- function returns the original
- <replaceable>xml_target</replaceable> XML fragment. All three
- arguments must be strings.
+ <replaceable>xpath_expr</replaceable> is found, the function
+ returns the original <replaceable>xml_target</replaceable> XML
+ fragment. All three arguments must be strings.
</para>
<remark role="todo">
@@ -11408,8 +11408,8 @@
<para>
Example: <literal>/a</literal> has a match in
- <literal><a><b/></a></literal> (it matches
- the outer tag), but does not match the inner
+ <literal><a><b/></a></literal> because it
+ matches the outermost (root) tag. It does not match the inner
<replaceable>a</replaceable> element in
<literal><b><a/></b></literal> because in
this instance it is the child of another element.
@@ -11433,7 +11433,7 @@
<para>
Example: <literal>/a/b</literal> matches the
- <replaceable>b</replaceable>element in the XML fragment
+ <replaceable>b</replaceable> element in the XML fragment
<literal><a><b/></a></literal> because it is
a child of the root element <replaceable>a</replaceable>. It
does not have a match in
@@ -11462,11 +11462,11 @@
</para>
<para>
- Matches any <replaceable>tag</replaceable>.
+ Matches any instance of <replaceable>tag</replaceable>.
</para>
<para>
- Example: <literal>//a</literal> will match the
+ Example: <literal>//a</literal> matches the
<replaceable>a</replaceable> element in any of the following:
<literal><a><b><c/></b></a></literal>;
<literal><c><a><b/></a></b></literal>;
@@ -11486,15 +11486,15 @@
<listitem>
<para>
The <literal>*</literal> operator acts as a
- <quote>wildcard</quote> element. For example, the expression
- <literal>/*/b</literal> matches the
+ <quote>wildcard</quote> that matches any element. For example,
+ the expression <literal>/*/b</literal> matches the
<replaceable>b</replaceable> element in either of the XML
fragments <literal><a><b/></a></literal> or
<literal><c><b/></c></literal>. However, the
expression does not produce a match in the fragment
<literal><b><a/></b></literal> because
<replaceable>b</replaceable> must be a child of some other
- element. The wildcard may be used in any position: the
+ element. The wildcard may be used in any position: The
expression <literal>/*/b/*</literal> will match any child of a
<replaceable>b</replaceable> element that is itself not the
root element.
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r965 - in trunk: . refman-4.1 refman-5.0 refman-5.1 | paul | 21 Jan |