MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:paul Date:December 12 2007 4:19am
Subject:svn commit - mysqldoc@docsrva: r9258 - in trunk: . refman-4.1 refman-5.0 refman-5.1 refman-6.0
View as plain text  
Author: paul
Date: 2007-12-12 05:19:22 +0100 (Wed, 12 Dec 2007)
New Revision: 9258

Log:
 r28064@frost:  paul | 2007-12-11 22:16:57 -0600
 Clarify meaning of Key field for SHOW COLUMNS output.
 (Bug#32522)


Modified:
   trunk/refman-4.1/sql-syntax.xml
   trunk/refman-5.0/sql-syntax.xml
   trunk/refman-5.1/sql-syntax.xml
   trunk/refman-6.0/sql-syntax.xml

Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:34153
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:28060
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:22582
   + 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:34153
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:28064
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:22582


Modified: trunk/refman-4.1/sql-syntax.xml
===================================================================
--- trunk/refman-4.1/sql-syntax.xml	2007-12-12 03:35:03 UTC (rev 9257)
+++ trunk/refman-4.1/sql-syntax.xml	2007-12-12 04:19:22 UTC (rev 9258)
Changed blocks: 1, Lines Added: 53, Lines Deleted: 11; 3194 bytes

@@ -10197,22 +10197,64 @@
 
       <para>
         The <literal>Key</literal> field indicates whether the column is
-        indexed. A value of <literal>PRI</literal> indicates that the
-        column is part of the table's primary key.
-        <literal>UNI</literal> indicates that the column is part of a
-        <literal>UNIQUE</literal> index. The <literal>MUL</literal>
-        value indicates that multiple occurrences of a given value are
-        allowed within the column.
+        indexed:
       </para>
 
+      <itemizedlist>
+
+        <listitem>
+          <para>
+            If <literal>Key</literal> is empty, the column either is not
+            indexed or is indexed only as a secondary column in a
+            multiple-column, non-unique index.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            If <literal>Key</literal> is <literal>PRI</literal>, the
+            column is a <literal>PRIMARY KEY</literal> or is one of the
+            columns in a multiple-column <literal>PRIMARY KEY</literal>.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            If <literal>Key</literal> is <literal>UNI</literal>, the
+            column is the first column of a unique-valued index that
+            cannot contain <literal>NULL</literal> values.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            If <literal>Key</literal> is <literal>MUL</literal>,
+            multiple occurrences of a given value are allowed within the
+            column. The column is the first column of a non-unique index
+            or a unique-valued index that can contain
+            <literal>NULL</literal> values.
+          </para>
+        </listitem>
+
+      </itemizedlist>
+
       <para>
-        One reason for <literal>MUL</literal> to be displayed on a
-        <literal>UNIQUE</literal> index is that several columns form a
+        If more than one of the <literal>Key</literal> values applies to
+        a given column of a table, <literal>Key</literal> displays the
+        one with the highest priority, in the order
+        <literal>PRI</literal>, <literal>UNI</literal>,
+        <literal>MUL</literal>.
+      </para>
+
+      <para>
+        A <literal>UNIQUE</literal> index may be displayed as
+        <literal>PRI</literal> if it cannot contain
+        <literal>NULL</literal> values and there is no <literal>PRIMARY
+        KEY</literal> in the table. A <literal>UNIQUE</literal> index
+        may display as <literal>MUL</literal> if several columns form a
         composite <literal>UNIQUE</literal> index; although the
         combination of the columns is unique, each column can still hold
-        multiple occurrences of a given value. Note that in a composite
-        index, only the leftmost column of the index has an entry in the
-        <literal>Key</literal> field.
+        multiple occurrences of a given value.
       </para>
 
       <para>


Modified: trunk/refman-5.0/sql-syntax.xml
===================================================================
--- trunk/refman-5.0/sql-syntax.xml	2007-12-12 03:35:03 UTC (rev 9257)
+++ trunk/refman-5.0/sql-syntax.xml	2007-12-12 04:19:22 UTC (rev 9258)
Changed blocks: 1, Lines Added: 54, Lines Deleted: 12; 3641 bytes

@@ -10997,28 +10997,70 @@
 
       <para>
         The <literal>Key</literal> field indicates whether the column is
-        indexed. A value of <literal>PRI</literal> indicates that the
-        column is part of the table's primary key.
-        <literal>UNI</literal> indicates that the column is part of a
-        <literal>UNIQUE</literal> index. The <literal>MUL</literal>
-        value indicates that multiple occurrences of a given value are
-        allowed within the column.
+        indexed:
       </para>
 
+      <itemizedlist>
+
+        <listitem>
+          <para>
+            If <literal>Key</literal> is empty, the column either is not
+            indexed or is indexed only as a secondary column in a
+            multiple-column, non-unique index.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            If <literal>Key</literal> is <literal>PRI</literal>, the
+            column is a <literal>PRIMARY KEY</literal> or is one of the
+            columns in a multiple-column <literal>PRIMARY KEY</literal>.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            If <literal>Key</literal> is <literal>UNI</literal>, the
+            column is the first column of a unique-valued index that
+            cannot contain <literal>NULL</literal> values.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            If <literal>Key</literal> is <literal>MUL</literal>,
+            multiple occurrences of a given value are allowed within the
+            column. The column is the first column of a non-unique index
+            or a unique-valued index that can contain
+            <literal>NULL</literal> values.
+          </para>
+        </listitem>
+
+      </itemizedlist>
+
       <para>
-        One reason for <literal>MUL</literal> to be displayed on a
-        <literal>UNIQUE</literal> index is that several columns form a
+        If more than one of the <literal>Key</literal> values applies to
+        a given column of a table, <literal>Key</literal> displays the
+        one with the highest priority, in the order
+        <literal>PRI</literal>, <literal>UNI</literal>,
+        <literal>MUL</literal>.
+      </para>
+
+      <para>
+        A <literal>UNIQUE</literal> index may be displayed as
+        <literal>PRI</literal> if it cannot contain
+        <literal>NULL</literal> values and there is no <literal>PRIMARY
+        KEY</literal> in the table. A <literal>UNIQUE</literal> index
+        may display as <literal>MUL</literal> if several columns form a
         composite <literal>UNIQUE</literal> index; although the
         combination of the columns is unique, each column can still hold
-        multiple occurrences of a given value. Note that in a composite
-        index, only the leftmost column of the index has an entry in the
-        <literal>Key</literal> field.
+        multiple occurrences of a given value.
       </para>
 
       <para>
         Before MySQL 5.0.11, if the column allows
         <literal>NULL</literal> values, the <literal>Key</literal> value
-        can be <literal>MUL</literal> even when a
+        can be <literal>MUL</literal> even when a single-column
         <literal>UNIQUE</literal> index is used. The rationale was that
         multiple rows in a <literal>UNIQUE</literal> index can hold a
         <literal>NULL</literal> value if the column is not declared


Modified: trunk/refman-5.1/sql-syntax.xml
===================================================================
--- trunk/refman-5.1/sql-syntax.xml	2007-12-12 03:35:03 UTC (rev 9257)
+++ trunk/refman-5.1/sql-syntax.xml	2007-12-12 04:19:22 UTC (rev 9258)
Changed blocks: 1, Lines Added: 53, Lines Deleted: 11; 3194 bytes

@@ -13404,22 +13404,64 @@
 
       <para>
         The <literal>Key</literal> field indicates whether the column is
-        indexed. A value of <literal>PRI</literal> indicates that the
-        column is part of the table's primary key.
-        <literal>UNI</literal> indicates that the column is part of a
-        <literal>UNIQUE</literal> index. The <literal>MUL</literal>
-        value indicates that multiple occurrences of a given value are
-        allowed within the column.
+        indexed:
       </para>
 
+      <itemizedlist>
+
+        <listitem>
+          <para>
+            If <literal>Key</literal> is empty, the column either is not
+            indexed or is indexed only as a secondary column in a
+            multiple-column, non-unique index.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            If <literal>Key</literal> is <literal>PRI</literal>, the
+            column is a <literal>PRIMARY KEY</literal> or is one of the
+            columns in a multiple-column <literal>PRIMARY KEY</literal>.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            If <literal>Key</literal> is <literal>UNI</literal>, the
+            column is the first column of a unique-valued index that
+            cannot contain <literal>NULL</literal> values.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            If <literal>Key</literal> is <literal>MUL</literal>,
+            multiple occurrences of a given value are allowed within the
+            column. The column is the first column of a non-unique index
+            or a unique-valued index that can contain
+            <literal>NULL</literal> values.
+          </para>
+        </listitem>
+
+      </itemizedlist>
+
       <para>
-        One reason for <literal>MUL</literal> to be displayed on a
-        <literal>UNIQUE</literal> index is that several columns form a
+        If more than one of the <literal>Key</literal> values applies to
+        a given column of a table, <literal>Key</literal> displays the
+        one with the highest priority, in the order
+        <literal>PRI</literal>, <literal>UNI</literal>,
+        <literal>MUL</literal>.
+      </para>
+
+      <para>
+        A <literal>UNIQUE</literal> index may be displayed as
+        <literal>PRI</literal> if it cannot contain
+        <literal>NULL</literal> values and there is no <literal>PRIMARY
+        KEY</literal> in the table. A <literal>UNIQUE</literal> index
+        may display as <literal>MUL</literal> if several columns form a
         composite <literal>UNIQUE</literal> index; although the
         combination of the columns is unique, each column can still hold
-        multiple occurrences of a given value. Note that in a composite
-        index, only the leftmost column of the index has an entry in the
-        <literal>Key</literal> field.
+        multiple occurrences of a given value.
       </para>
 
       <para>


Modified: trunk/refman-6.0/sql-syntax.xml
===================================================================
--- trunk/refman-6.0/sql-syntax.xml	2007-12-12 03:35:03 UTC (rev 9257)
+++ trunk/refman-6.0/sql-syntax.xml	2007-12-12 04:19:22 UTC (rev 9258)
Changed blocks: 1, Lines Added: 53, Lines Deleted: 11; 3194 bytes

@@ -13801,22 +13801,64 @@
 
       <para>
         The <literal>Key</literal> field indicates whether the column is
-        indexed. A value of <literal>PRI</literal> indicates that the
-        column is part of the table's primary key.
-        <literal>UNI</literal> indicates that the column is part of a
-        <literal>UNIQUE</literal> index. The <literal>MUL</literal>
-        value indicates that multiple occurrences of a given value are
-        allowed within the column.
+        indexed:
       </para>
 
+      <itemizedlist>
+
+        <listitem>
+          <para>
+            If <literal>Key</literal> is empty, the column either is not
+            indexed or is indexed only as a secondary column in a
+            multiple-column, non-unique index.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            If <literal>Key</literal> is <literal>PRI</literal>, the
+            column is a <literal>PRIMARY KEY</literal> or is one of the
+            columns in a multiple-column <literal>PRIMARY KEY</literal>.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            If <literal>Key</literal> is <literal>UNI</literal>, the
+            column is the first column of a unique-valued index that
+            cannot contain <literal>NULL</literal> values.
+          </para>
+        </listitem>
+
+        <listitem>
+          <para>
+            If <literal>Key</literal> is <literal>MUL</literal>,
+            multiple occurrences of a given value are allowed within the
+            column. The column is the first column of a non-unique index
+            or a unique-valued index that can contain
+            <literal>NULL</literal> values.
+          </para>
+        </listitem>
+
+      </itemizedlist>
+
       <para>
-        One reason for <literal>MUL</literal> to be displayed on a
-        <literal>UNIQUE</literal> index is that several columns form a
+        If more than one of the <literal>Key</literal> values applies to
+        a given column of a table, <literal>Key</literal> displays the
+        one with the highest priority, in the order
+        <literal>PRI</literal>, <literal>UNI</literal>,
+        <literal>MUL</literal>.
+      </para>
+
+      <para>
+        A <literal>UNIQUE</literal> index may be displayed as
+        <literal>PRI</literal> if it cannot contain
+        <literal>NULL</literal> values and there is no <literal>PRIMARY
+        KEY</literal> in the table. A <literal>UNIQUE</literal> index
+        may display as <literal>MUL</literal> if several columns form a
         composite <literal>UNIQUE</literal> index; although the
         combination of the columns is unique, each column can still hold
-        multiple occurrences of a given value. Note that in a composite
-        index, only the leftmost column of the index has an entry in the
-        <literal>Key</literal> field.
+        multiple occurrences of a given value.
       </para>
 
       <para>


Thread
svn commit - mysqldoc@docsrva: r9258 - in trunk: . refman-4.1 refman-5.0 refman-5.1 refman-6.0paul12 Dec