Author: paul
Date: 2006-01-21 04:09:42 +0100 (Sat, 21 Jan 2006)
New Revision: 961
Log:
r6505@frost: paul | 2006-01-20 19:05:57 -0600
Move compression functions to encryption/compression functions section.
Modified:
trunk/
trunk/refman-4.1/functions.xml
trunk/refman-5.0/functions.xml
trunk/refman-5.1/functions.xml
trunk/refman-common/titles.en.ent
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:6504
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:2396
+ b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:6505
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:09:29 UTC (rev 960)
+++ trunk/refman-4.1/functions.xml 2006-01-21 03:09:42 UTC (rev 961)
@@ -2095,81 +2095,6 @@
</listitem>
<listitem>
- <remark role="help-topic" condition="COMPRESS"/>
-
- <remark role="help-syntax-begin"/>
-
- <para>
- <indexterm type="function">
- <primary>COMPRESS()</primary>
- </indexterm>
-
- <literal>COMPRESS(<replaceable>string_to_compress</replaceable>)</literal>
- </para>
-
- <remark role="help-syntax-end"/>
-
- <remark role="help-description-begin"/>
-
- <para>
- Compresses a string and returns the result as a binary string.
- This function requires MySQL to have been compiled with a
- compression library such as <literal>zlib</literal>.
- Otherwise, the return value is always <literal>NULL</literal>.
- The compressed string can be uncompressed with
- <literal>UNCOMPRESS()</literal>.
- </para>
-
- <remark role="help-description-end"/>
-
- <remark role="help-example"/>
-
-<programlisting>
-mysql> <userinput>SELECT LENGTH(COMPRESS(REPEAT('a',1000)));</userinput>
- -> 21
-mysql> <userinput>SELECT LENGTH(COMPRESS(''));</userinput>
- -> 0
-mysql> <userinput>SELECT LENGTH(COMPRESS('a'));</userinput>
- -> 13
-mysql> <userinput>SELECT LENGTH(COMPRESS(REPEAT('a',16)));</userinput>
- -> 15
-</programlisting>
-
- <para>
- The compressed string contents are stored the following way:
- </para>
-
- <itemizedlist>
-
- <listitem>
- <para>
- Empty strings are stored as empty strings.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Non-empty strings are stored as a four-byte length of the
- uncompressed string (low byte first), followed by the
- compressed string. If the string ends with space, an extra
- ‘<literal>.</literal>’ character is added to
- avoid problems with endspace trimming should the result be
- stored in a <literal>CHAR</literal> or
- <literal>VARCHAR</literal> column. (Use of
- <literal>CHAR</literal> or <literal>VARCHAR</literal> to
- store compressed strings is not recommended. It is better
- to use a <literal>BLOB</literal> column instead.)
- </para>
- </listitem>
-
- </itemizedlist>
-
- <para>
- <literal>COMPRESS()</literal> was added in MySQL 4.1.1.
- </para>
- </listitem>
-
- <listitem>
<remark role="help-topic" condition="CONCAT"/>
<remark role="help-syntax-begin"/>
@@ -3789,85 +3714,6 @@
</listitem>
<listitem>
- <remark role="help-topic" condition="UNCOMPRESS"/>
-
- <remark role="help-syntax-begin"/>
-
- <para>
- <indexterm type="function">
- <primary>UNCOMPRESS()</primary>
- </indexterm>
-
- <literal>UNCOMPRESS(<replaceable>string_to_uncompress</replaceable>)</literal>
- </para>
-
- <remark role="help-syntax-end"/>
-
- <remark role="help-description-begin"/>
-
- <para>
- Uncompresses a string compressed by the
- <literal>COMPRESS()</literal> function. If the argument is not
- a compressed value, the result is <literal>NULL</literal>.
- This function requires MySQL to have been compiled with a
- compression library such as <literal>zlib</literal>.
- Otherwise, the return value is always <literal>NULL</literal>.
- </para>
-
- <remark role="help-description-end"/>
-
- <remark role="help-example"/>
-
-<programlisting>
-mysql> <userinput>SELECT UNCOMPRESS(COMPRESS('any string'));</userinput>
- -> 'any string'
-mysql> <userinput>SELECT UNCOMPRESS('any string');</userinput>
- -> NULL
-</programlisting>
-
- <para>
- <literal>UNCOMPRESS()</literal> was added in MySQL 4.1.1.
- </para>
- </listitem>
-
- <listitem>
- <remark role="help-topic" condition="UNCOMPRESSED_LENGTH"/>
-
- <remark role="help-syntax-begin"/>
-
- <para>
- <indexterm type="function">
- <primary>UNCOMPRESSED_LENGTH()</primary>
- </indexterm>
-
- <literal>UNCOMPRESSED_LENGTH(<replaceable>compressed_string</replaceable>)</literal>
- </para>
-
- <remark role="help-syntax-end"/>
-
- <remark role="help-description-begin"/>
-
- <para>
- Returns the length that the compressed string had before being
- compressed.
- </para>
-
- <remark role="help-description-end"/>
-
- <remark role="help-example"/>
-
-<programlisting>
-mysql> <userinput>SELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT('a',30)));</userinput>
- -> 30
-</programlisting>
-
- <para>
- <literal>UNCOMPRESSED_LENGTH()</literal> was added in MySQL
- 4.1.1.
- </para>
- </listitem>
-
- <listitem>
<remark role="help-topic" condition="UNHEX"/>
<remark role="help-syntax-begin"/>
@@ -11836,6 +11682,81 @@
</listitem>
<listitem>
+ <remark role="help-topic" condition="COMPRESS"/>
+
+ <remark role="help-syntax-begin"/>
+
+ <para>
+ <indexterm type="function">
+ <primary>COMPRESS()</primary>
+ </indexterm>
+
+ <literal>COMPRESS(<replaceable>string_to_compress</replaceable>)</literal>
+ </para>
+
+ <remark role="help-syntax-end"/>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ Compresses a string and returns the result as a binary
+ string. This function requires MySQL to have been compiled
+ with a compression library such as <literal>zlib</literal>.
+ Otherwise, the return value is always
+ <literal>NULL</literal>. The compressed string can be
+ uncompressed with <literal>UNCOMPRESS()</literal>.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>SELECT LENGTH(COMPRESS(REPEAT('a',1000)));</userinput>
+ -> 21
+mysql> <userinput>SELECT LENGTH(COMPRESS(''));</userinput>
+ -> 0
+mysql> <userinput>SELECT LENGTH(COMPRESS('a'));</userinput>
+ -> 13
+mysql> <userinput>SELECT LENGTH(COMPRESS(REPEAT('a',16)));</userinput>
+ -> 15
+</programlisting>
+
+ <para>
+ The compressed string contents are stored the following way:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ Empty strings are stored as empty strings.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Non-empty strings are stored as a four-byte length of
+ the uncompressed string (low byte first), followed by
+ the compressed string. If the string ends with space, an
+ extra ‘<literal>.</literal>’ character is
+ added to avoid problems with endspace trimming should
+ the result be stored in a <literal>CHAR</literal> or
+ <literal>VARCHAR</literal> column. (Use of
+ <literal>CHAR</literal> or <literal>VARCHAR</literal> to
+ store compressed strings is not recommended. It is
+ better to use a <literal>BLOB</literal> column instead.)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+
+ <para>
+ <literal>COMPRESS()</literal> was added in MySQL 4.1.1.
+ </para>
+ </listitem>
+
+ <listitem>
<remark role="help-topic" condition="DECODE"/>
<remark role="help-syntax-begin"/>
@@ -12343,6 +12264,86 @@
</para>
</listitem>
+ <listitem>
+ <remark role="help-topic" condition="UNCOMPRESS"/>
+
+ <remark role="help-syntax-begin"/>
+
+ <para>
+ <indexterm type="function">
+ <primary>UNCOMPRESS()</primary>
+ </indexterm>
+
+ <literal>UNCOMPRESS(<replaceable>string_to_uncompress</replaceable>)</literal>
+ </para>
+
+ <remark role="help-syntax-end"/>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ Uncompresses a string compressed by the
+ <literal>COMPRESS()</literal> function. If the argument is
+ not a compressed value, the result is
+ <literal>NULL</literal>. This function requires MySQL to
+ have been compiled with a compression library such as
+ <literal>zlib</literal>. Otherwise, the return value is
+ always <literal>NULL</literal>.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>SELECT UNCOMPRESS(COMPRESS('any string'));</userinput>
+ -> 'any string'
+mysql> <userinput>SELECT UNCOMPRESS('any string');</userinput>
+ -> NULL
+</programlisting>
+
+ <para>
+ <literal>UNCOMPRESS()</literal> was added in MySQL 4.1.1.
+ </para>
+ </listitem>
+
+ <listitem>
+ <remark role="help-topic" condition="UNCOMPRESSED_LENGTH"/>
+
+ <remark role="help-syntax-begin"/>
+
+ <para>
+ <indexterm type="function">
+ <primary>UNCOMPRESSED_LENGTH()</primary>
+ </indexterm>
+
+ <literal>UNCOMPRESSED_LENGTH(<replaceable>compressed_string</replaceable>)</literal>
+ </para>
+
+ <remark role="help-syntax-end"/>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ Returns the length that the compressed string had before
+ being compressed.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>SELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT('a',30)));</userinput>
+ -> 30
+</programlisting>
+
+ <para>
+ <literal>UNCOMPRESSED_LENGTH()</literal> was added in MySQL
+ 4.1.1.
+ </para>
+ </listitem>
+
</itemizedlist>
</section>
Modified: trunk/refman-5.0/functions.xml
===================================================================
--- trunk/refman-5.0/functions.xml 2006-01-21 03:09:29 UTC (rev 960)
+++ trunk/refman-5.0/functions.xml 2006-01-21 03:09:42 UTC (rev 961)
@@ -2189,77 +2189,6 @@
</listitem>
<listitem>
- <remark role="help-topic" condition="COMPRESS"/>
-
- <remark role="help-syntax-begin"/>
-
- <para>
- <indexterm type="function">
- <primary>COMPRESS()</primary>
- </indexterm>
-
- <literal>COMPRESS(<replaceable>string_to_compress</replaceable>)</literal>
- </para>
-
- <remark role="help-syntax-end"/>
-
- <remark role="help-description-begin"/>
-
- <para>
- Compresses a string and returns the result as a binary string.
- This function requires MySQL to have been compiled with a
- compression library such as <literal>zlib</literal>.
- Otherwise, the return value is always <literal>NULL</literal>.
- The compressed string can be uncompressed with
- <literal>UNCOMPRESS()</literal>.
- </para>
-
- <remark role="help-description-end"/>
-
- <remark role="help-example"/>
-
-<programlisting>
-mysql> <userinput>SELECT LENGTH(COMPRESS(REPEAT('a',1000)));</userinput>
- -> 21
-mysql> <userinput>SELECT LENGTH(COMPRESS(''));</userinput>
- -> 0
-mysql> <userinput>SELECT LENGTH(COMPRESS('a'));</userinput>
- -> 13
-mysql> <userinput>SELECT LENGTH(COMPRESS(REPEAT('a',16)));</userinput>
- -> 15
-</programlisting>
-
- <para>
- The compressed string contents are stored the following way:
- </para>
-
- <itemizedlist>
-
- <listitem>
- <para>
- Empty strings are stored as empty strings.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Non-empty strings are stored as a four-byte length of the
- uncompressed string (low byte first), followed by the
- compressed string. If the string ends with space, an extra
- ‘<literal>.</literal>’ character is added to
- avoid problems with endspace trimming should the result be
- stored in a <literal>CHAR</literal> or
- <literal>VARCHAR</literal> column. (Use of
- <literal>CHAR</literal> or <literal>VARCHAR</literal> to
- store compressed strings is not recommended. It is better
- to use a <literal>BLOB</literal> column instead.)
- </para>
- </listitem>
-
- </itemizedlist>
- </listitem>
-
- <listitem>
<remark role="help-topic" condition="CONCAT"/>
<remark role="help-syntax-begin"/>
@@ -3865,76 +3794,6 @@
</listitem>
<listitem>
- <remark role="help-topic" condition="UNCOMPRESS"/>
-
- <remark role="help-syntax-begin"/>
-
- <para>
- <indexterm type="function">
- <primary>UNCOMPRESS()</primary>
- </indexterm>
-
- <literal>UNCOMPRESS(<replaceable>string_to_uncompress</replaceable>)</literal>
- </para>
-
- <remark role="help-syntax-end"/>
-
- <remark role="help-description-begin"/>
-
- <para>
- Uncompresses a string compressed by the
- <literal>COMPRESS()</literal> function. If the argument is not
- a compressed value, the result is <literal>NULL</literal>.
- This function requires MySQL to have been compiled with a
- compression library such as <literal>zlib</literal>.
- Otherwise, the return value is always <literal>NULL</literal>.
- </para>
-
- <remark role="help-description-end"/>
-
- <remark role="help-example"/>
-
-<programlisting>
-mysql> <userinput>SELECT UNCOMPRESS(COMPRESS('any string'));</userinput>
- -> 'any string'
-mysql> <userinput>SELECT UNCOMPRESS('any string');</userinput>
- -> NULL
-</programlisting>
- </listitem>
-
- <listitem>
- <remark role="help-topic" condition="UNCOMPRESSED_LENGTH"/>
-
- <remark role="help-syntax-begin"/>
-
- <para>
- <indexterm type="function">
- <primary>UNCOMPRESSED_LENGTH()</primary>
- </indexterm>
-
- <literal>UNCOMPRESSED_LENGTH(<replaceable>compressed_string</replaceable>)</literal>
- </para>
-
- <remark role="help-syntax-end"/>
-
- <remark role="help-description-begin"/>
-
- <para>
- Returns the length that the compressed string had before being
- compressed.
- </para>
-
- <remark role="help-description-end"/>
-
- <remark role="help-example"/>
-
-<programlisting>
-mysql> <userinput>SELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT('a',30)));</userinput>
- -> 30
-</programlisting>
- </listitem>
-
- <listitem>
<remark role="help-topic" condition="UNHEX"/>
<remark role="help-syntax-begin"/>
@@ -11833,6 +11692,77 @@
</listitem>
<listitem>
+ <remark role="help-topic" condition="COMPRESS"/>
+
+ <remark role="help-syntax-begin"/>
+
+ <para>
+ <indexterm type="function">
+ <primary>COMPRESS()</primary>
+ </indexterm>
+
+ <literal>COMPRESS(<replaceable>string_to_compress</replaceable>)</literal>
+ </para>
+
+ <remark role="help-syntax-end"/>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ Compresses a string and returns the result as a binary
+ string. This function requires MySQL to have been compiled
+ with a compression library such as <literal>zlib</literal>.
+ Otherwise, the return value is always
+ <literal>NULL</literal>. The compressed string can be
+ uncompressed with <literal>UNCOMPRESS()</literal>.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>SELECT LENGTH(COMPRESS(REPEAT('a',1000)));</userinput>
+ -> 21
+mysql> <userinput>SELECT LENGTH(COMPRESS(''));</userinput>
+ -> 0
+mysql> <userinput>SELECT LENGTH(COMPRESS('a'));</userinput>
+ -> 13
+mysql> <userinput>SELECT LENGTH(COMPRESS(REPEAT('a',16)));</userinput>
+ -> 15
+</programlisting>
+
+ <para>
+ The compressed string contents are stored the following way:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ Empty strings are stored as empty strings.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Non-empty strings are stored as a four-byte length of
+ the uncompressed string (low byte first), followed by
+ the compressed string. If the string ends with space, an
+ extra ‘<literal>.</literal>’ character is
+ added to avoid problems with endspace trimming should
+ the result be stored in a <literal>CHAR</literal> or
+ <literal>VARCHAR</literal> column. (Use of
+ <literal>CHAR</literal> or <literal>VARCHAR</literal> to
+ store compressed strings is not recommended. It is
+ better to use a <literal>BLOB</literal> column instead.)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
<remark role="help-topic" condition="DECODE"/>
<remark role="help-syntax-begin"/>
@@ -12327,6 +12257,77 @@
</para>
</listitem>
+ <listitem>
+ <remark role="help-topic" condition="UNCOMPRESS"/>
+
+ <remark role="help-syntax-begin"/>
+
+ <para>
+ <indexterm type="function">
+ <primary>UNCOMPRESS()</primary>
+ </indexterm>
+
+ <literal>UNCOMPRESS(<replaceable>string_to_uncompress</replaceable>)</literal>
+ </para>
+
+ <remark role="help-syntax-end"/>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ Uncompresses a string compressed by the
+ <literal>COMPRESS()</literal> function. If the argument is
+ not a compressed value, the result is
+ <literal>NULL</literal>. This function requires MySQL to
+ have been compiled with a compression library such as
+ <literal>zlib</literal>. Otherwise, the return value is
+ always <literal>NULL</literal>.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>SELECT UNCOMPRESS(COMPRESS('any string'));</userinput>
+ -> 'any string'
+mysql> <userinput>SELECT UNCOMPRESS('any string');</userinput>
+ -> NULL
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <remark role="help-topic" condition="UNCOMPRESSED_LENGTH"/>
+
+ <remark role="help-syntax-begin"/>
+
+ <para>
+ <indexterm type="function">
+ <primary>UNCOMPRESSED_LENGTH()</primary>
+ </indexterm>
+
+ <literal>UNCOMPRESSED_LENGTH(<replaceable>compressed_string</replaceable>)</literal>
+ </para>
+
+ <remark role="help-syntax-end"/>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ Returns the length that the compressed string had before
+ being compressed.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>SELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT('a',30)));</userinput>
+ -> 30
+</programlisting>
+ </listitem>
+
</itemizedlist>
</section>
Modified: trunk/refman-5.1/functions.xml
===================================================================
--- trunk/refman-5.1/functions.xml 2006-01-21 03:09:29 UTC (rev 960)
+++ trunk/refman-5.1/functions.xml 2006-01-21 03:09:42 UTC (rev 961)
@@ -2161,77 +2161,6 @@
</listitem>
<listitem>
- <remark role="help-topic" condition="COMPRESS"/>
-
- <remark role="help-syntax-begin"/>
-
- <para>
- <indexterm type="function">
- <primary>COMPRESS()</primary>
- </indexterm>
-
- <literal>COMPRESS(<replaceable>string_to_compress</replaceable>)</literal>
- </para>
-
- <remark role="help-syntax-end"/>
-
- <remark role="help-description-begin"/>
-
- <para>
- Compresses a string and returns the result as a binary string.
- This function requires MySQL to have been compiled with a
- compression library such as <literal>zlib</literal>.
- Otherwise, the return value is always <literal>NULL</literal>.
- The compressed string can be uncompressed with
- <literal>UNCOMPRESS()</literal>.
- </para>
-
- <remark role="help-description-end"/>
-
- <remark role="help-example"/>
-
-<programlisting>
-mysql> <userinput>SELECT LENGTH(COMPRESS(REPEAT('a',1000)));</userinput>
- -> 21
-mysql> <userinput>SELECT LENGTH(COMPRESS(''));</userinput>
- -> 0
-mysql> <userinput>SELECT LENGTH(COMPRESS('a'));</userinput>
- -> 13
-mysql> <userinput>SELECT LENGTH(COMPRESS(REPEAT('a',16)));</userinput>
- -> 15
-</programlisting>
-
- <para>
- The compressed string contents are stored the following way:
- </para>
-
- <itemizedlist>
-
- <listitem>
- <para>
- Empty strings are stored as empty strings.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Non-empty strings are stored as a four-byte length of the
- uncompressed string (low byte first), followed by the
- compressed string. If the string ends with space, an extra
- ‘<literal>.</literal>’ character is added to
- avoid problems with endspace trimming should the result be
- stored in a <literal>CHAR</literal> or
- <literal>VARCHAR</literal> column. (Use of
- <literal>CHAR</literal> or <literal>VARCHAR</literal> to
- store compressed strings is not recommended. It is better
- to use a <literal>BLOB</literal> column instead.)
- </para>
- </listitem>
-
- </itemizedlist>
- </listitem>
-
- <listitem>
<remark role="help-topic" condition="CONCAT"/>
<remark role="help-syntax-begin"/>
@@ -3837,76 +3766,6 @@
</listitem>
<listitem>
- <remark role="help-topic" condition="UNCOMPRESS"/>
-
- <remark role="help-syntax-begin"/>
-
- <para>
- <indexterm type="function">
- <primary>UNCOMPRESS()</primary>
- </indexterm>
-
- <literal>UNCOMPRESS(<replaceable>string_to_uncompress</replaceable>)</literal>
- </para>
-
- <remark role="help-syntax-end"/>
-
- <remark role="help-description-begin"/>
-
- <para>
- Uncompresses a string compressed by the
- <literal>COMPRESS()</literal> function. If the argument is not
- a compressed value, the result is <literal>NULL</literal>.
- This function requires MySQL to have been compiled with a
- compression library such as <literal>zlib</literal>.
- Otherwise, the return value is always <literal>NULL</literal>.
- </para>
-
- <remark role="help-description-end"/>
-
- <remark role="help-example"/>
-
-<programlisting>
-mysql> <userinput>SELECT UNCOMPRESS(COMPRESS('any string'));</userinput>
- -> 'any string'
-mysql> <userinput>SELECT UNCOMPRESS('any string');</userinput>
- -> NULL
-</programlisting>
- </listitem>
-
- <listitem>
- <remark role="help-topic" condition="UNCOMPRESSED_LENGTH"/>
-
- <remark role="help-syntax-begin"/>
-
- <para>
- <indexterm type="function">
- <primary>UNCOMPRESSED_LENGTH()</primary>
- </indexterm>
-
- <literal>UNCOMPRESSED_LENGTH(<replaceable>compressed_string</replaceable>)</literal>
- </para>
-
- <remark role="help-syntax-end"/>
-
- <remark role="help-description-begin"/>
-
- <para>
- Returns the length that the compressed string had before being
- compressed.
- </para>
-
- <remark role="help-description-end"/>
-
- <remark role="help-example"/>
-
-<programlisting>
-mysql> <userinput>SELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT('a',30)));</userinput>
- -> 30
-</programlisting>
- </listitem>
-
- <listitem>
<remark role="help-topic" condition="UNHEX"/>
<remark role="help-syntax-begin"/>
@@ -12262,6 +12121,77 @@
</listitem>
<listitem>
+ <remark role="help-topic" condition="COMPRESS"/>
+
+ <remark role="help-syntax-begin"/>
+
+ <para>
+ <indexterm type="function">
+ <primary>COMPRESS()</primary>
+ </indexterm>
+
+ <literal>COMPRESS(<replaceable>string_to_compress</replaceable>)</literal>
+ </para>
+
+ <remark role="help-syntax-end"/>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ Compresses a string and returns the result as a binary
+ string. This function requires MySQL to have been compiled
+ with a compression library such as <literal>zlib</literal>.
+ Otherwise, the return value is always
+ <literal>NULL</literal>. The compressed string can be
+ uncompressed with <literal>UNCOMPRESS()</literal>.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>SELECT LENGTH(COMPRESS(REPEAT('a',1000)));</userinput>
+ -> 21
+mysql> <userinput>SELECT LENGTH(COMPRESS(''));</userinput>
+ -> 0
+mysql> <userinput>SELECT LENGTH(COMPRESS('a'));</userinput>
+ -> 13
+mysql> <userinput>SELECT LENGTH(COMPRESS(REPEAT('a',16)));</userinput>
+ -> 15
+</programlisting>
+
+ <para>
+ The compressed string contents are stored the following way:
+ </para>
+
+ <itemizedlist>
+
+ <listitem>
+ <para>
+ Empty strings are stored as empty strings.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ Non-empty strings are stored as a four-byte length of
+ the uncompressed string (low byte first), followed by
+ the compressed string. If the string ends with space, an
+ extra ‘<literal>.</literal>’ character is
+ added to avoid problems with endspace trimming should
+ the result be stored in a <literal>CHAR</literal> or
+ <literal>VARCHAR</literal> column. (Use of
+ <literal>CHAR</literal> or <literal>VARCHAR</literal> to
+ store compressed strings is not recommended. It is
+ better to use a <literal>BLOB</literal> column instead.)
+ </para>
+ </listitem>
+
+ </itemizedlist>
+ </listitem>
+
+ <listitem>
<remark role="help-topic" condition="DECODE"/>
<remark role="help-syntax-begin"/>
@@ -12756,6 +12686,77 @@
</para>
</listitem>
+ <listitem>
+ <remark role="help-topic" condition="UNCOMPRESS"/>
+
+ <remark role="help-syntax-begin"/>
+
+ <para>
+ <indexterm type="function">
+ <primary>UNCOMPRESS()</primary>
+ </indexterm>
+
+ <literal>UNCOMPRESS(<replaceable>string_to_uncompress</replaceable>)</literal>
+ </para>
+
+ <remark role="help-syntax-end"/>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ Uncompresses a string compressed by the
+ <literal>COMPRESS()</literal> function. If the argument is
+ not a compressed value, the result is
+ <literal>NULL</literal>. This function requires MySQL to
+ have been compiled with a compression library such as
+ <literal>zlib</literal>. Otherwise, the return value is
+ always <literal>NULL</literal>.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>SELECT UNCOMPRESS(COMPRESS('any string'));</userinput>
+ -> 'any string'
+mysql> <userinput>SELECT UNCOMPRESS('any string');</userinput>
+ -> NULL
+</programlisting>
+ </listitem>
+
+ <listitem>
+ <remark role="help-topic" condition="UNCOMPRESSED_LENGTH"/>
+
+ <remark role="help-syntax-begin"/>
+
+ <para>
+ <indexterm type="function">
+ <primary>UNCOMPRESSED_LENGTH()</primary>
+ </indexterm>
+
+ <literal>UNCOMPRESSED_LENGTH(<replaceable>compressed_string</replaceable>)</literal>
+ </para>
+
+ <remark role="help-syntax-end"/>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ Returns the length that the compressed string had before
+ being compressed.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>SELECT UNCOMPRESSED_LENGTH(COMPRESS(REPEAT('a',30)));</userinput>
+ -> 30
+</programlisting>
+ </listitem>
+
</itemizedlist>
</section>
Modified: trunk/refman-common/titles.en.ent
===================================================================
--- trunk/refman-common/titles.en.ent 2006-01-21 03:09:29 UTC (rev 960)
+++ trunk/refman-common/titles.en.ent 2006-01-21 03:09:42 UTC (rev 961)
@@ -340,7 +340,7 @@
<!ENTITY title-dynamic-format "Dynamic Table Characteristics">
<!ENTITY title-dynamic-system-variables "Dynamic System Variables">
<!ENTITY title-eiffel "MySQL Eiffel Wrapper">
-<!ENTITY title-encryption-functions "Encryption Functions">
+<!ENTITY title-encryption-functions "Encryption and Compression Functions">
<!ENTITY title-engines-table "The <literal>INFORMATION_SCHEMA ENGINES</literal> Table">
<!ENTITY title-entering-queries "Entering Queries">
<!ENTITY title-enum "The <literal>ENUM</literal> Type">
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r961 - in trunk: . refman-4.1 refman-5.0 refman-5.1 refman-common | paul | 21 Jan |