List:Commits« Previous MessageNext Message »
From:paul Date:April 19 2006 5:13pm
Subject:svn commit - mysqldoc@docsrva: r1870 - in trunk: . refman-4.1 refman-5.0 refman-5.1
View as plain text  
Author: paul
Date: 2006-04-19 19:13:36 +0200 (Wed, 19 Apr 2006)
New Revision: 1870

Log:
 r4545@kite-hub:  paul | 2006-04-19 11:58:52 -0500
 Add MYSQL_TYPE_NEWECIMAL to table of binary protocol types. (Bug#14140)
 Fill in some blanks in the table.
 Add some remarks about data conversions.


Modified:
   trunk/
   trunk/refman-4.1/apis.xml
   trunk/refman-5.0/apis.xml
   trunk/refman-5.1/apis.xml


Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:6745
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:9568
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:4544
   + 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:6745
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:9568
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:4545

Modified: trunk/refman-4.1/apis.xml
===================================================================
--- trunk/refman-4.1/apis.xml	2006-04-19 17:13:13 UTC (rev 1869)
+++ trunk/refman-4.1/apis.xml	2006-04-19 17:13:36 UTC (rev 1870)
@@ -8420,9 +8420,37 @@
         <literal>MYSQL_BIND</literal> structures. The table also shows
         those SQL types that correspond most closely to each
         <literal>buffer_type</literal> value, and, for numeric and
-        temporal types, the corresponding C type.
+        temporal types, the corresponding recommended C type.
       </para>
 
+      <para>
+        The types are <quote>recommended</quote> because implicit type
+        conversion may be performed in both directions. The
+        <literal>buffer_type</literal> value controls the conversion
+        that will be performed. For example, to fetch a SQL
+        <literal>MEDIUMINT</literal> column value, you can specify a
+        <literal>buffer_type</literal> value of
+        <literal>MYSQL_TYPE_LONG</literal> and use a C variable of type
+        <literal>int</literal> as the destination buffer. If you fetch a
+        numeric column with a value of 255 into a
+        <literal>char[4]</literal> character array, specify a
+        <literal>buffer_type</literal> value of
+        <literal>MYSQL_TYPE_STRING</literal> and the resulting value in
+        the array will be a 4-byte string containing
+        <literal>'255\0'</literal>.
+      </para>
+
+      <para>
+        To distinguish between binary and non-binary data for string
+        data types, check whether the <literal>charsetnr</literal> value
+        of the result set metadata is 63. If so, the character set is
+        <literal>binary</literal>, which indicates binary rather than
+        non-binary data. This is how to distinguish between
+        <literal>BINARY</literal> and <literal>CHAR</literal>,
+        <literal>VARBINARY</literal> and <literal>VARCHAR</literal>, and
+        <literal>BLOB</literal> and <literal>TEXT</literal>.
+      </para>
+
       <informaltable>
         <tgroup cols="3">
           <colspec colwidth="33*"/>
@@ -8432,12 +8460,12 @@
             <row>
               <entry><literal>buffer_type</literal> <emphasis role="bold">Value</emphasis></entry>
               <entry><emphasis role="bold">SQL Type</emphasis></entry>
-              <entry><emphasis role="bold">C Type</emphasis></entry>
+              <entry><emphasis role="bold">Recommended C Type</emphasis></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_TINY</literal></entry>
               <entry><literal>TINYINT</literal></entry>
-              <entry><literal>char</literal></entry>
+              <entry><literal>unsigned char</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_SHORT</literal></entry>
@@ -8487,46 +8515,37 @@
             <row>
               <entry><literal>MYSQL_TYPE_STRING</literal></entry>
               <entry><literal>CHAR/BINARY</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_VAR_STRING</literal></entry>
               <entry><literal>VARCHAR/VARBINARY</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_TINY_BLOB</literal></entry>
               <entry><literal>TINYBLOB/TINYTEXT</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_BLOB</literal></entry>
               <entry><literal>BLOB/TEXT</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_MEDIUM_BLOB</literal></entry>
               <entry><literal>MEDIUMBLOB/MEDIUMTEXT</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_LONG_BLOB</literal></entry>
               <entry><literal>LONGBLOB/LONGTEXT</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
           </tbody>
         </tgroup>
       </informaltable>
 
-      <para>
-        Implicit type conversion may be performed in both directions.
-      </para>
-
-      <remark role="todo">
-        Explain what that means and give some examples. Need list of
-        allowable/supported conversions
-      </remark>
-
     </section>
 
     <section id="c-api-prepared-statement-function-overview">

Modified: trunk/refman-5.0/apis.xml
===================================================================
--- trunk/refman-5.0/apis.xml	2006-04-19 17:13:13 UTC (rev 1869)
+++ trunk/refman-5.0/apis.xml	2006-04-19 17:13:36 UTC (rev 1870)
@@ -8602,9 +8602,37 @@
         <literal>MYSQL_BIND</literal> structures. The table also shows
         those SQL types that correspond most closely to each
         <literal>buffer_type</literal> value, and, for numeric and
-        temporal types, the corresponding C type.
+        temporal types, the corresponding recommended C type.
       </para>
 
+      <para>
+        The types are <quote>recommended</quote> because implicit type
+        conversion may be performed in both directions. The
+        <literal>buffer_type</literal> value controls the conversion
+        that will be performed. For example, to fetch a SQL
+        <literal>MEDIUMINT</literal> column value, you can specify a
+        <literal>buffer_type</literal> value of
+        <literal>MYSQL_TYPE_LONG</literal> and use a C variable of type
+        <literal>int</literal> as the destination buffer. If you fetch a
+        numeric column with a value of 255 into a
+        <literal>char[4]</literal> character array, specify a
+        <literal>buffer_type</literal> value of
+        <literal>MYSQL_TYPE_STRING</literal> and the resulting value in
+        the array will be a 4-byte string containing
+        <literal>'255\0'</literal>.
+      </para>
+
+      <para>
+        To distinguish between binary and non-binary data for string
+        data types, check whether the <literal>charsetnr</literal> value
+        of the result set metadata is 63. If so, the character set is
+        <literal>binary</literal>, which indicates binary rather than
+        non-binary data. This is how to distinguish between
+        <literal>BINARY</literal> and <literal>CHAR</literal>,
+        <literal>VARBINARY</literal> and <literal>VARCHAR</literal>, and
+        <literal>BLOB</literal> and <literal>TEXT</literal>.
+      </para>
+
       <informaltable>
         <tgroup cols="3">
           <colspec colwidth="33*"/>
@@ -8614,7 +8642,7 @@
             <row>
               <entry><literal>buffer_type</literal> <emphasis role="bold">Value</emphasis></entry>
               <entry><emphasis role="bold">SQL Type</emphasis></entry>
-              <entry><emphasis role="bold">C Type</emphasis></entry>
+              <entry><emphasis role="bold">Recommended C Type</emphasis></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_BIT</literal></entry>
@@ -8624,7 +8652,7 @@
             <row>
               <entry><literal>MYSQL_TYPE_TINY</literal></entry>
               <entry><literal>TINYINT</literal></entry>
-              <entry><literal>char</literal></entry>
+              <entry><literal>unsigned char</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_SHORT</literal></entry>
@@ -8652,6 +8680,11 @@
               <entry><literal>double</literal></entry>
             </row>
             <row>
+              <entry><literal>MYSQL_TYPE_NEWDECIMAL</literal></entry>
+              <entry><literal>DECIMAL</literal></entry>
+              <entry><literal>char[]</literal></entry>
+            </row>
+            <row>
               <entry><literal>MYSQL_TYPE_TIME</literal></entry>
               <entry><literal>TIME</literal></entry>
               <entry><literal>MYSQL_TIME</literal></entry>
@@ -8674,46 +8707,37 @@
             <row>
               <entry><literal>MYSQL_TYPE_STRING</literal></entry>
               <entry><literal>CHAR/BINARY</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_VAR_STRING</literal></entry>
               <entry><literal>VARCHAR/VARBINARY</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_TINY_BLOB</literal></entry>
               <entry><literal>TINYBLOB/TINYTEXT</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_BLOB</literal></entry>
               <entry><literal>BLOB/TEXT</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_MEDIUM_BLOB</literal></entry>
               <entry><literal>MEDIUMBLOB/MEDIUMTEXT</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_LONG_BLOB</literal></entry>
               <entry><literal>LONGBLOB/LONGTEXT</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
           </tbody>
         </tgroup>
       </informaltable>
 
-      <para>
-        Implicit type conversion may be performed in both directions.
-      </para>
-
-      <remark role="todo">
-        Explain what that means and give some examples. Need list of
-        allowable/supported conversions
-      </remark>
-
     </section>
 
     <section id="c-api-prepared-statement-function-overview">

Modified: trunk/refman-5.1/apis.xml
===================================================================
--- trunk/refman-5.1/apis.xml	2006-04-19 17:13:13 UTC (rev 1869)
+++ trunk/refman-5.1/apis.xml	2006-04-19 17:13:36 UTC (rev 1870)
@@ -8470,9 +8470,37 @@
         <literal>MYSQL_BIND</literal> structures. The table also shows
         those SQL types that correspond most closely to each
         <literal>buffer_type</literal> value, and, for numeric and
-        temporal types, the corresponding C type.
+        temporal types, the corresponding recommended C type.
       </para>
 
+      <para>
+        The types are <quote>recommended</quote> because implicit type
+        conversion may be performed in both directions. The
+        <literal>buffer_type</literal> value controls the conversion
+        that will be performed. For example, to fetch a SQL
+        <literal>MEDIUMINT</literal> column value, you can specify a
+        <literal>buffer_type</literal> value of
+        <literal>MYSQL_TYPE_LONG</literal> and use a C variable of type
+        <literal>int</literal> as the destination buffer. If you fetch a
+        numeric column with a value of 255 into a
+        <literal>char[4]</literal> character array, specify a
+        <literal>buffer_type</literal> value of
+        <literal>MYSQL_TYPE_STRING</literal> and the resulting value in
+        the array will be a 4-byte string containing
+        <literal>'255\0'</literal>.
+      </para>
+
+      <para>
+        To distinguish between binary and non-binary data for string
+        data types, check whether the <literal>charsetnr</literal> value
+        of the result set metadata is 63. If so, the character set is
+        <literal>binary</literal>, which indicates binary rather than
+        non-binary data. This is how to distinguish between
+        <literal>BINARY</literal> and <literal>CHAR</literal>,
+        <literal>VARBINARY</literal> and <literal>VARCHAR</literal>, and
+        <literal>BLOB</literal> and <literal>TEXT</literal>.
+      </para>
+
       <informaltable>
         <tgroup cols="3">
           <colspec colwidth="33*"/>
@@ -8482,7 +8510,7 @@
             <row>
               <entry><literal>buffer_type</literal> <emphasis role="bold">Value</emphasis></entry>
               <entry><emphasis role="bold">SQL Type</emphasis></entry>
-              <entry><emphasis role="bold">C Type</emphasis></entry>
+              <entry><emphasis role="bold">Recommended C Type</emphasis></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_BIT</literal></entry>
@@ -8492,7 +8520,7 @@
             <row>
               <entry><literal>MYSQL_TYPE_TINY</literal></entry>
               <entry><literal>TINYINT</literal></entry>
-              <entry><literal>char</literal></entry>
+              <entry><literal>unsigned char</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_SHORT</literal></entry>
@@ -8520,6 +8548,11 @@
               <entry><literal>double</literal></entry>
             </row>
             <row>
+              <entry><literal>MYSQL_TYPE_NEWDECIMAL</literal></entry>
+              <entry><literal>DECIMAL</literal></entry>
+              <entry><literal>char[]</literal></entry>
+            </row>
+            <row>
               <entry><literal>MYSQL_TYPE_TIME</literal></entry>
               <entry><literal>TIME</literal></entry>
               <entry><literal>MYSQL_TIME</literal></entry>
@@ -8542,46 +8575,37 @@
             <row>
               <entry><literal>MYSQL_TYPE_STRING</literal></entry>
               <entry><literal>CHAR/BINARY</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_VAR_STRING</literal></entry>
               <entry><literal>VARCHAR/VARBINARY</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_TINY_BLOB</literal></entry>
               <entry><literal>TINYBLOB/TINYTEXT</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_BLOB</literal></entry>
               <entry><literal>BLOB/TEXT</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_MEDIUM_BLOB</literal></entry>
               <entry><literal>MEDIUMBLOB/MEDIUMTEXT</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
             <row>
               <entry><literal>MYSQL_TYPE_LONG_BLOB</literal></entry>
               <entry><literal>LONGBLOB/LONGTEXT</literal></entry>
-              <entry/>
+              <entry><literal>char[]</literal></entry>
             </row>
           </tbody>
         </tgroup>
       </informaltable>
 
-      <para>
-        Implicit type conversion may be performed in both directions.
-      </para>
-
-      <remark role="todo">
-        Explain what that means and give some examples. Need list of
-        allowable/supported conversions
-      </remark>
-
     </section>
 
     <section id="c-api-prepared-statement-function-overview">

Thread
svn commit - mysqldoc@docsrva: r1870 - in trunk: . refman-4.1 refman-5.0 refman-5.1paul19 Apr