Author: jstephens
Date: 2007-11-09 12:37:11 +0100 (Fri, 09 Nov 2007)
New Revision: 8607
Log:
New fix for Docs Bug #32164:
Added link to HEX() in mathematical-functions.
Moved OCT() and CONV() to mathematical-functions
Updated opfunctions file
Modified:
trunk/dynamic-docs/opsfunctions/opfunctions.xml
trunk/refman-4.1/functions-core.xml
trunk/refman-5.0/functions-core.xml
trunk/refman-5.1/functions-core.xml
trunk/refman-6.0/functions-core.xml
Modified: trunk/dynamic-docs/opsfunctions/opfunctions.xml
===================================================================
--- trunk/dynamic-docs/opsfunctions/opfunctions.xml 2007-11-09 10:39:54 UTC (rev 8606)
+++ trunk/dynamic-docs/opsfunctions/opfunctions.xml 2007-11-09 11:37:11 UTC (rev 8607)
Changed blocks: 3, Lines Added: 6, Lines Deleted: 4; 1607 bytes
@@ -2836,7 +2836,7 @@
</versions>
</opfunction>
- <opfunction type="function" id="conv" class="string">
+ <opfunction type="function" id="conv" class="numeric-arithmetic">
<display>CONV()</display>
<description lang="en">Convert numbers between different number bases</description>
<arguments>
@@ -2941,7 +2941,8 @@
<opfunction type="function" id="hex" class="string">
<display>HEX()</display>
- <description lang="en">Return a string representation of a hex value</description>
+ <description lang="en">Return a hexadecimal representation of a
+ decimal or string value</description>
<arguments>
<format><![CDATA[<replaceable>N_or_S</replaceable>]]></format>
<argument seq="1" name="expr" type="mixed"></argument>
@@ -3204,9 +3205,10 @@
</versions>
</opfunction>
- <opfunction type="function" id="oct" class="string">
+ <opfunction type="function" id="oct" class="numeric-mathematical">
<display>OCT()</display>
- <description lang="en">Return a string representation of the octal argument</description>
+ <description lang="en">Return an octal representation of a decimal
+ number</description>
<arguments>
<format><![CDATA[<replaceable>N</replaceable>]]></format>
<argument seq="1" name="expr" type="string"></argument>
Modified: trunk/refman-4.1/functions-core.xml
===================================================================
--- trunk/refman-4.1/functions-core.xml 2007-11-09 10:39:54 UTC (rev 8606)
+++ trunk/refman-4.1/functions-core.xml 2007-11-09 11:37:11 UTC (rev 8607)
Changed blocks: 6, Lines Added: 109, Lines Deleted: 89; 8079 bytes
@@ -2331,57 +2331,6 @@
</listitem>
<listitem>
- <remark role="help-topic" condition="CONV"/>
-
- <remark role="help-syntax-begin"/>
-
- <para id="function_conv">
- <indexterm>
- <primary>CONV()</primary>
- </indexterm>
-
- <literal>CONV(<replaceable>N</replaceable>,<replaceable>from_base</replaceable>,<replaceable>to_base</replaceable>)</literal>
- </para>
-
- <remark role="help-syntax-end"/>
-
- <remark role="help-description-begin"/>
-
- <para>
- Converts numbers between different number bases. Returns a
- string representation of the number
- <replaceable>N</replaceable>, converted from base
- <replaceable>from_base</replaceable> to base
- <replaceable>to_base</replaceable>. Returns
- <literal>NULL</literal> if any argument is
- <literal>NULL</literal>. The argument
- <replaceable>N</replaceable> is interpreted as an integer, but
- may be specified as an integer or a string. The minimum base
- is <literal>2</literal> and the maximum base is
- <literal>36</literal>. If <replaceable>to_base</replaceable>
- is a negative number, <replaceable>N</replaceable> is regarded
- as a signed number. Otherwise, <replaceable>N</replaceable> is
- treated as unsigned. <literal>CONV()</literal> works with
- 64-bit precision.
- </para>
-
- <remark role="help-description-end"/>
-
- <remark role="help-example"/>
-
-<programlisting>
-mysql> <userinput>SELECT CONV('a',16,2);</userinput>
- -> '1010'
-mysql> <userinput>SELECT CONV('6E',18,8);</userinput>
- -> '172'
-mysql> <userinput>SELECT CONV(-17,10,-18);</userinput>
- -> '-H'
-mysql> <userinput>SELECT CONV(10+'10'+'10'+0xa,10,10);</userinput>
- -> '40'
-</programlisting>
- </listitem>
-
- <listitem>
<remark role="help-topic" condition="ELT"/>
<remark role="help-syntax-begin"/>
@@ -2638,7 +2587,8 @@
is a string, returns a hexadecimal string representation of
<replaceable>N_or_S</replaceable> where each character in
<replaceable>N_or_S</replaceable> is converted to two
- hexadecimal digits.
+ hexadecimal digits. The inverse of this operation is performed
+ by the <function role="sql">UNHEX()</function> function.
</para>
<remark role="help-description-end"/>
@@ -3135,43 +3085,6 @@
</listitem>
<listitem>
- <remark role="help-topic" condition="OCT"/>
-
- <remark role="help-syntax-begin"/>
-
- <para id="function_oct">
- <indexterm>
- <primary>OCT()</primary>
- </indexterm>
-
- <literal>OCT(<replaceable>N</replaceable>)</literal>
- </para>
-
- <remark role="help-syntax-end"/>
-
- <remark role="help-description-begin"/>
-
- <para>
- Returns a string representation of the octal value of
- <replaceable>N</replaceable>, where
- <replaceable>N</replaceable> is a longlong
- (<literal>BIGINT</literal>) number. This is equivalent to
- <literal>CONV(<replaceable>N</replaceable>,10,8)</literal>.
- Returns <literal>NULL</literal> if
- <replaceable>N</replaceable> is <literal>NULL</literal>.
- </para>
-
- <remark role="help-description-end"/>
-
- <remark role="help-example"/>
-
-<programlisting>
-mysql> <userinput>SELECT OCT(12);</userinput>
- -> '14'
-</programlisting>
- </listitem>
-
- <listitem>
<remark role="help-topic" condition="OCTET_LENGTH"/>
<remark role="help-syntax-begin"/>
@@ -5936,6 +5849,57 @@
</listitem>
<listitem>
+ <remark role="help-topic" condition="CONV"/>
+
+ <remark role="help-syntax-begin"/>
+
+ <para id="function_conv">
+ <indexterm>
+ <primary>CONV()</primary>
+ </indexterm>
+
+ <literal>CONV(<replaceable>N</replaceable>,<replaceable>from_base</replaceable>,<replaceable>to_base</replaceable>)</literal>
+ </para>
+
+ <remark role="help-syntax-end"/>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ Converts numbers between different number bases. Returns a
+ string representation of the number
+ <replaceable>N</replaceable>, converted from base
+ <replaceable>from_base</replaceable> to base
+ <replaceable>to_base</replaceable>. Returns
+ <literal>NULL</literal> if any argument is
+ <literal>NULL</literal>. The argument
+ <replaceable>N</replaceable> is interpreted as an integer,
+ but may be specified as an integer or a string. The minimum
+ base is <literal>2</literal> and the maximum base is
+ <literal>36</literal>. If <replaceable>to_base</replaceable>
+ is a negative number, <replaceable>N</replaceable> is
+ regarded as a signed number. Otherwise,
+ <replaceable>N</replaceable> is treated as unsigned.
+ <literal>CONV()</literal> works with 64-bit precision.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>SELECT CONV('a',16,2);</userinput>
+ -> '1010'
+mysql> <userinput>SELECT CONV('6E',18,8);</userinput>
+ -> '172'
+mysql> <userinput>SELECT CONV(-17,10,-18);</userinput>
+ -> '-H'
+mysql> <userinput>SELECT CONV(10+'10'+'10'+0xa,10,10);</userinput>
+ -> '40'
+</programlisting>
+ </listitem>
+
+ <listitem>
<remark role="help-topic" condition="COS"/>
<remark role="help-syntax-begin"/>
@@ -6165,6 +6129,25 @@
</listitem>
<listitem>
+ <para>
+ <indexterm>
+ <primary>HEX()</primary>
+ </indexterm>
+
+ <literal>HEX(N_or_S)</literal>
+ </para>
+
+ <para>
+ This function can be used to obtain a hexadecimal
+ representation of a decimal number or (beginning with MySQL
+ 4.0.1) a string; the manner in which it does so varies
+ according to the argument's type. See this
+ function's description in
+ <xref linkend="string-functions"/>, for details.
+ </para>
+ </listitem>
+
+ <listitem>
<remark role="help-topic" condition="LN"/>
<remark role="help-syntax-begin"/>
@@ -6436,6 +6419,43 @@
</listitem>
<listitem>
+ <remark role="help-topic" condition="OCT"/>
+
+ <remark role="help-syntax-begin"/>
+
+ <para id="function_oct">
+ <indexterm>
+ <primary>OCT()</primary>
+ </indexterm>
+
+ <literal>OCT(<replaceable>N</replaceable>)</literal>
+ </para>
+
+ <remark role="help-syntax-end"/>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ Returns a string representation of the octal value of
+ <replaceable>N</replaceable>, where
+ <replaceable>N</replaceable> is a longlong
+ (<literal>BIGINT</literal>) number. This is equivalent to
+ <literal>CONV(<replaceable>N</replaceable>,10,8)</literal>.
+ Returns <literal>NULL</literal> if
+ <replaceable>N</replaceable> is <literal>NULL</literal>.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>SELECT OCT(12);</userinput>
+ -> '14'
+</programlisting>
+ </listitem>
+
+ <listitem>
<remark role="help-topic" condition="PI"/>
<remark role="help-syntax-begin"/>
Modified: trunk/refman-5.0/functions-core.xml
===================================================================
--- trunk/refman-5.0/functions-core.xml 2007-11-09 10:39:54 UTC (rev 8606)
+++ trunk/refman-5.0/functions-core.xml 2007-11-09 11:37:11 UTC (rev 8607)
Changed blocks: 4, Lines Added: 71, Lines Deleted: 52; 5537 bytes
@@ -2423,57 +2423,6 @@
</listitem>
<listitem>
- <remark role="help-topic" condition="CONV"/>
-
- <remark role="help-syntax-begin"/>
-
- <para id="function_conv">
- <indexterm>
- <primary>CONV()</primary>
- </indexterm>
-
- <literal>CONV(<replaceable>N</replaceable>,<replaceable>from_base</replaceable>,<replaceable>to_base</replaceable>)</literal>
- </para>
-
- <remark role="help-syntax-end"/>
-
- <remark role="help-description-begin"/>
-
- <para>
- Converts numbers between different number bases. Returns a
- string representation of the number
- <replaceable>N</replaceable>, converted from base
- <replaceable>from_base</replaceable> to base
- <replaceable>to_base</replaceable>. Returns
- <literal>NULL</literal> if any argument is
- <literal>NULL</literal>. The argument
- <replaceable>N</replaceable> is interpreted as an integer, but
- may be specified as an integer or a string. The minimum base
- is <literal>2</literal> and the maximum base is
- <literal>36</literal>. If <replaceable>to_base</replaceable>
- is a negative number, <replaceable>N</replaceable> is regarded
- as a signed number. Otherwise, <replaceable>N</replaceable> is
- treated as unsigned. <literal>CONV()</literal> works with
- 64-bit precision.
- </para>
-
- <remark role="help-description-end"/>
-
- <remark role="help-example"/>
-
-<programlisting>
-mysql> <userinput>SELECT CONV('a',16,2);</userinput>
- -> '1010'
-mysql> <userinput>SELECT CONV('6E',18,8);</userinput>
- -> '172'
-mysql> <userinput>SELECT CONV(-17,10,-18);</userinput>
- -> '-H'
-mysql> <userinput>SELECT CONV(10+'10'+'10'+0xa,10,10);</userinput>
- -> '40'
-</programlisting>
- </listitem>
-
- <listitem>
<remark role="help-topic" condition="ELT"/>
<remark role="help-syntax-begin"/>
@@ -2730,7 +2679,8 @@
hexadecimal string representation of
<replaceable>N_or_S</replaceable> where each character in
<replaceable>N_or_S</replaceable> is converted to two
- hexadecimal digits.
+ hexadecimal digits. The inverse of this operation is performed
+ by the <function role="sql">UNHEX()</function> function.
</para>
<remark role="help-description-end"/>
@@ -6045,6 +5995,57 @@
</listitem>
<listitem>
+ <remark role="help-topic" condition="CONV"/>
+
+ <remark role="help-syntax-begin"/>
+
+ <para id="function_conv">
+ <indexterm>
+ <primary>CONV()</primary>
+ </indexterm>
+
+ <literal>CONV(<replaceable>N</replaceable>,<replaceable>from_base</replaceable>,<replaceable>to_base</replaceable>)</literal>
+ </para>
+
+ <remark role="help-syntax-end"/>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ Converts numbers between different number bases. Returns a
+ string representation of the number
+ <replaceable>N</replaceable>, converted from base
+ <replaceable>from_base</replaceable> to base
+ <replaceable>to_base</replaceable>. Returns
+ <literal>NULL</literal> if any argument is
+ <literal>NULL</literal>. The argument
+ <replaceable>N</replaceable> is interpreted as an integer,
+ but may be specified as an integer or a string. The minimum
+ base is <literal>2</literal> and the maximum base is
+ <literal>36</literal>. If <replaceable>to_base</replaceable>
+ is a negative number, <replaceable>N</replaceable> is
+ regarded as a signed number. Otherwise,
+ <replaceable>N</replaceable> is treated as unsigned.
+ <literal>CONV()</literal> works with 64-bit precision.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>SELECT CONV('a',16,2);</userinput>
+ -> '1010'
+mysql> <userinput>SELECT CONV('6E',18,8);</userinput>
+ -> '172'
+mysql> <userinput>SELECT CONV(-17,10,-18);</userinput>
+ -> '-H'
+mysql> <userinput>SELECT CONV(10+'10'+'10'+0xa,10,10);</userinput>
+ -> '40'
+</programlisting>
+ </listitem>
+
+ <listitem>
<remark role="help-topic" condition="COS"/>
<remark role="help-syntax-begin"/>
@@ -6277,6 +6278,24 @@
</listitem>
<listitem>
+ <para>
+ <indexterm>
+ <primary>HEX()</primary>
+ </indexterm>
+
+ <literal>HEX(N_or_S)</literal>
+ </para>
+
+ <para>
+ This function can be used to obtain a hexadecimal
+ representation of a decimal number or a string; the manner
+ in which it does so varies according to the argument's
+ type. See this function's description in
+ <xref linkend="string-functions"/>, for details.
+ </para>
+ </listitem>
+
+ <listitem>
<remark role="help-topic" condition="LN"/>
<remark role="help-syntax-begin"/>
Modified: trunk/refman-5.1/functions-core.xml
===================================================================
--- trunk/refman-5.1/functions-core.xml 2007-11-09 10:39:54 UTC (rev 8606)
+++ trunk/refman-5.1/functions-core.xml 2007-11-09 11:37:11 UTC (rev 8607)
Changed blocks: 6, Lines Added: 108, Lines Deleted: 89; 8015 bytes
@@ -2395,57 +2395,6 @@
</listitem>
<listitem>
- <remark role="help-topic" condition="CONV"/>
-
- <remark role="help-syntax-begin"/>
-
- <para id="function_conv">
- <indexterm>
- <primary>CONV()</primary>
- </indexterm>
-
- <literal>CONV(<replaceable>N</replaceable>,<replaceable>from_base</replaceable>,<replaceable>to_base</replaceable>)</literal>
- </para>
-
- <remark role="help-syntax-end"/>
-
- <remark role="help-description-begin"/>
-
- <para>
- Converts numbers between different number bases. Returns a
- string representation of the number
- <replaceable>N</replaceable>, converted from base
- <replaceable>from_base</replaceable> to base
- <replaceable>to_base</replaceable>. Returns
- <literal>NULL</literal> if any argument is
- <literal>NULL</literal>. The argument
- <replaceable>N</replaceable> is interpreted as an integer, but
- may be specified as an integer or a string. The minimum base
- is <literal>2</literal> and the maximum base is
- <literal>36</literal>. If <replaceable>to_base</replaceable>
- is a negative number, <replaceable>N</replaceable> is regarded
- as a signed number. Otherwise, <replaceable>N</replaceable> is
- treated as unsigned. <literal>CONV()</literal> works with
- 64-bit precision.
- </para>
-
- <remark role="help-description-end"/>
-
- <remark role="help-example"/>
-
-<programlisting>
-mysql> <userinput>SELECT CONV('a',16,2);</userinput>
- -> '1010'
-mysql> <userinput>SELECT CONV('6E',18,8);</userinput>
- -> '172'
-mysql> <userinput>SELECT CONV(-17,10,-18);</userinput>
- -> '-H'
-mysql> <userinput>SELECT CONV(10+'10'+'10'+0xa,10,10);</userinput>
- -> '40'
-</programlisting>
- </listitem>
-
- <listitem>
<remark role="help-topic" condition="ELT"/>
<remark role="help-syntax-begin"/>
@@ -2702,7 +2651,8 @@
hexadecimal string representation of
<replaceable>N_or_S</replaceable> where each character in
<replaceable>N_or_S</replaceable> is converted to two
- hexadecimal digits.
+ hexadecimal digits. The inverse of this operation is performed
+ by the <function role="sql">UNHEX()</function> function.
</para>
<remark role="help-description-end"/>
@@ -3197,43 +3147,6 @@
</listitem>
<listitem>
- <remark role="help-topic" condition="OCT"/>
-
- <remark role="help-syntax-begin"/>
-
- <para id="function_oct">
- <indexterm>
- <primary>OCT()</primary>
- </indexterm>
-
- <literal>OCT(<replaceable>N</replaceable>)</literal>
- </para>
-
- <remark role="help-syntax-end"/>
-
- <remark role="help-description-begin"/>
-
- <para>
- Returns a string representation of the octal value of
- <replaceable>N</replaceable>, where
- <replaceable>N</replaceable> is a longlong
- (<literal>BIGINT</literal>) number. This is equivalent to
- <literal>CONV(<replaceable>N</replaceable>,10,8)</literal>.
- Returns <literal>NULL</literal> if
- <replaceable>N</replaceable> is <literal>NULL</literal>.
- </para>
-
- <remark role="help-description-end"/>
-
- <remark role="help-example"/>
-
-<programlisting>
-mysql> <userinput>SELECT OCT(12);</userinput>
- -> '14'
-</programlisting>
- </listitem>
-
- <listitem>
<remark role="help-topic" condition="OCTET_LENGTH"/>
<remark role="help-syntax-begin"/>
@@ -6017,6 +5930,57 @@
</listitem>
<listitem>
+ <remark role="help-topic" condition="CONV"/>
+
+ <remark role="help-syntax-begin"/>
+
+ <para id="function_conv">
+ <indexterm>
+ <primary>CONV()</primary>
+ </indexterm>
+
+ <literal>CONV(<replaceable>N</replaceable>,<replaceable>from_base</replaceable>,<replaceable>to_base</replaceable>)</literal>
+ </para>
+
+ <remark role="help-syntax-end"/>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ Converts numbers between different number bases. Returns a
+ string representation of the number
+ <replaceable>N</replaceable>, converted from base
+ <replaceable>from_base</replaceable> to base
+ <replaceable>to_base</replaceable>. Returns
+ <literal>NULL</literal> if any argument is
+ <literal>NULL</literal>. The argument
+ <replaceable>N</replaceable> is interpreted as an integer,
+ but may be specified as an integer or a string. The minimum
+ base is <literal>2</literal> and the maximum base is
+ <literal>36</literal>. If <replaceable>to_base</replaceable>
+ is a negative number, <replaceable>N</replaceable> is
+ regarded as a signed number. Otherwise,
+ <replaceable>N</replaceable> is treated as unsigned.
+ <literal>CONV()</literal> works with 64-bit precision.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>SELECT CONV('a',16,2);</userinput>
+ -> '1010'
+mysql> <userinput>SELECT CONV('6E',18,8);</userinput>
+ -> '172'
+mysql> <userinput>SELECT CONV(-17,10,-18);</userinput>
+ -> '-H'
+mysql> <userinput>SELECT CONV(10+'10'+'10'+0xa,10,10);</userinput>
+ -> '40'
+</programlisting>
+ </listitem>
+
+ <listitem>
<remark role="help-topic" condition="COS"/>
<remark role="help-syntax-begin"/>
@@ -6249,6 +6213,24 @@
</listitem>
<listitem>
+ <para>
+ <indexterm>
+ <primary>HEX()</primary>
+ </indexterm>
+
+ <literal>HEX(N_or_S)</literal>
+ </para>
+
+ <para>
+ This function can be used to obtain a hexadecimal
+ representation of a decimal number or a string; the manner
+ in which it does so varies according to the argument's
+ type. See this function's description in
+ <xref linkend="string-functions"/>, for details.
+ </para>
+ </listitem>
+
+ <listitem>
<remark role="help-topic" condition="LN"/>
<remark role="help-syntax-begin"/>
@@ -6512,6 +6494,43 @@
</listitem>
<listitem>
+ <remark role="help-topic" condition="OCT"/>
+
+ <remark role="help-syntax-begin"/>
+
+ <para id="function_oct">
+ <indexterm>
+ <primary>OCT()</primary>
+ </indexterm>
+
+ <literal>OCT(<replaceable>N</replaceable>)</literal>
+ </para>
+
+ <remark role="help-syntax-end"/>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ Returns a string representation of the octal value of
+ <replaceable>N</replaceable>, where
+ <replaceable>N</replaceable> is a longlong
+ (<literal>BIGINT</literal>) number. This is equivalent to
+ <literal>CONV(<replaceable>N</replaceable>,10,8)</literal>.
+ Returns <literal>NULL</literal> if
+ <replaceable>N</replaceable> is <literal>NULL</literal>.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>SELECT OCT(12);</userinput>
+ -> '14'
+</programlisting>
+ </listitem>
+
+ <listitem>
<remark role="help-topic" condition="PI"/>
<remark role="help-syntax-begin"/>
Modified: trunk/refman-6.0/functions-core.xml
===================================================================
--- trunk/refman-6.0/functions-core.xml 2007-11-09 10:39:54 UTC (rev 8606)
+++ trunk/refman-6.0/functions-core.xml 2007-11-09 11:37:11 UTC (rev 8607)
Changed blocks: 6, Lines Added: 108, Lines Deleted: 89; 8015 bytes
@@ -2395,57 +2395,6 @@
</listitem>
<listitem>
- <remark role="help-topic" condition="CONV"/>
-
- <remark role="help-syntax-begin"/>
-
- <para id="function_conv">
- <indexterm>
- <primary>CONV()</primary>
- </indexterm>
-
- <literal>CONV(<replaceable>N</replaceable>,<replaceable>from_base</replaceable>,<replaceable>to_base</replaceable>)</literal>
- </para>
-
- <remark role="help-syntax-end"/>
-
- <remark role="help-description-begin"/>
-
- <para>
- Converts numbers between different number bases. Returns a
- string representation of the number
- <replaceable>N</replaceable>, converted from base
- <replaceable>from_base</replaceable> to base
- <replaceable>to_base</replaceable>. Returns
- <literal>NULL</literal> if any argument is
- <literal>NULL</literal>. The argument
- <replaceable>N</replaceable> is interpreted as an integer, but
- may be specified as an integer or a string. The minimum base
- is <literal>2</literal> and the maximum base is
- <literal>36</literal>. If <replaceable>to_base</replaceable>
- is a negative number, <replaceable>N</replaceable> is regarded
- as a signed number. Otherwise, <replaceable>N</replaceable> is
- treated as unsigned. <literal>CONV()</literal> works with
- 64-bit precision.
- </para>
-
- <remark role="help-description-end"/>
-
- <remark role="help-example"/>
-
-<programlisting>
-mysql> <userinput>SELECT CONV('a',16,2);</userinput>
- -> '1010'
-mysql> <userinput>SELECT CONV('6E',18,8);</userinput>
- -> '172'
-mysql> <userinput>SELECT CONV(-17,10,-18);</userinput>
- -> '-H'
-mysql> <userinput>SELECT CONV(10+'10'+'10'+0xa,10,10);</userinput>
- -> '40'
-</programlisting>
- </listitem>
-
- <listitem>
<remark role="help-topic" condition="ELT"/>
<remark role="help-syntax-begin"/>
@@ -2702,7 +2651,8 @@
hexadecimal string representation of
<replaceable>N_or_S</replaceable> where each character in
<replaceable>N_or_S</replaceable> is converted to two
- hexadecimal digits.
+ hexadecimal digits. The inverse of this operation is performed
+ by the <function role="sql">UNHEX()</function> function.
</para>
<remark role="help-description-end"/>
@@ -3196,43 +3146,6 @@
</listitem>
<listitem>
- <remark role="help-topic" condition="OCT"/>
-
- <remark role="help-syntax-begin"/>
-
- <para id="function_oct">
- <indexterm>
- <primary>OCT()</primary>
- </indexterm>
-
- <literal>OCT(<replaceable>N</replaceable>)</literal>
- </para>
-
- <remark role="help-syntax-end"/>
-
- <remark role="help-description-begin"/>
-
- <para>
- Returns a string representation of the octal value of
- <replaceable>N</replaceable>, where
- <replaceable>N</replaceable> is a longlong
- (<literal>BIGINT</literal>) number. This is equivalent to
- <literal>CONV(<replaceable>N</replaceable>,10,8)</literal>.
- Returns <literal>NULL</literal> if
- <replaceable>N</replaceable> is <literal>NULL</literal>.
- </para>
-
- <remark role="help-description-end"/>
-
- <remark role="help-example"/>
-
-<programlisting>
-mysql> <userinput>SELECT OCT(12);</userinput>
- -> '14'
-</programlisting>
- </listitem>
-
- <listitem>
<remark role="help-topic" condition="OCTET_LENGTH"/>
<remark role="help-syntax-begin"/>
@@ -6015,6 +5928,57 @@
</listitem>
<listitem>
+ <remark role="help-topic" condition="CONV"/>
+
+ <remark role="help-syntax-begin"/>
+
+ <para id="function_conv">
+ <indexterm>
+ <primary>CONV()</primary>
+ </indexterm>
+
+ <literal>CONV(<replaceable>N</replaceable>,<replaceable>from_base</replaceable>,<replaceable>to_base</replaceable>)</literal>
+ </para>
+
+ <remark role="help-syntax-end"/>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ Converts numbers between different number bases. Returns a
+ string representation of the number
+ <replaceable>N</replaceable>, converted from base
+ <replaceable>from_base</replaceable> to base
+ <replaceable>to_base</replaceable>. Returns
+ <literal>NULL</literal> if any argument is
+ <literal>NULL</literal>. The argument
+ <replaceable>N</replaceable> is interpreted as an integer,
+ but may be specified as an integer or a string. The minimum
+ base is <literal>2</literal> and the maximum base is
+ <literal>36</literal>. If <replaceable>to_base</replaceable>
+ is a negative number, <replaceable>N</replaceable> is
+ regarded as a signed number. Otherwise,
+ <replaceable>N</replaceable> is treated as unsigned.
+ <literal>CONV()</literal> works with 64-bit precision.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>SELECT CONV('a',16,2);</userinput>
+ -> '1010'
+mysql> <userinput>SELECT CONV('6E',18,8);</userinput>
+ -> '172'
+mysql> <userinput>SELECT CONV(-17,10,-18);</userinput>
+ -> '-H'
+mysql> <userinput>SELECT CONV(10+'10'+'10'+0xa,10,10);</userinput>
+ -> '40'
+</programlisting>
+ </listitem>
+
+ <listitem>
<remark role="help-topic" condition="COS"/>
<remark role="help-syntax-begin"/>
@@ -6247,6 +6211,24 @@
</listitem>
<listitem>
+ <para>
+ <indexterm>
+ <primary>HEX()</primary>
+ </indexterm>
+
+ <literal>HEX(N_or_S)</literal>
+ </para>
+
+ <para>
+ This function can be used to obtain a hexadecimal
+ representation of a decimal number or a string; the manner
+ in which it does so varies according to the argument's
+ type. See this function's description in
+ <xref linkend="string-functions"/>, for details.
+ </para>
+ </listitem>
+
+ <listitem>
<remark role="help-topic" condition="LN"/>
<remark role="help-syntax-begin"/>
@@ -6510,6 +6492,43 @@
</listitem>
<listitem>
+ <remark role="help-topic" condition="OCT"/>
+
+ <remark role="help-syntax-begin"/>
+
+ <para id="function_oct">
+ <indexterm>
+ <primary>OCT()</primary>
+ </indexterm>
+
+ <literal>OCT(<replaceable>N</replaceable>)</literal>
+ </para>
+
+ <remark role="help-syntax-end"/>
+
+ <remark role="help-description-begin"/>
+
+ <para>
+ Returns a string representation of the octal value of
+ <replaceable>N</replaceable>, where
+ <replaceable>N</replaceable> is a longlong
+ (<literal>BIGINT</literal>) number. This is equivalent to
+ <literal>CONV(<replaceable>N</replaceable>,10,8)</literal>.
+ Returns <literal>NULL</literal> if
+ <replaceable>N</replaceable> is <literal>NULL</literal>.
+ </para>
+
+ <remark role="help-description-end"/>
+
+ <remark role="help-example"/>
+
+<programlisting>
+mysql> <userinput>SELECT OCT(12);</userinput>
+ -> '14'
+</programlisting>
+ </listitem>
+
+ <listitem>
<remark role="help-topic" condition="PI"/>
<remark role="help-syntax-begin"/>
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r8607 - in trunk: dynamic-docs/opsfunctions refman-4.1 refman-5.0 refman-5.1 refman-6.0 | jon | 9 Nov |