List:Internals« Previous MessageNext Message »
From:Jim Winstead Date:August 25 2005 4:00am
Subject:bk commit into 5.0 tree (jimw:1.1912) BUG#12764
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of jimw. When jimw does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.1912 05/08/24 19:00:03 jimw@stripped +3 -0
  Fix reporting of UNIQUE-but-possibly-NULL keys in DESCRIBE. (Bug #12764)

  sql/sql_show.cc
    1.273 05/08/24 19:00:00 jimw@stripped +3 -2
    Report UNIQUE keys that can contain NULLs as 'MUL', as documented.

  mysql-test/t/show_check.test
    1.54 05/08/24 19:00:00 jimw@stripped +7 -0
    Add new regression test

  mysql-test/r/show_check.result
    1.74 05/08/24 18:59:59 jimw@stripped +6 -0
    Add new results

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-5.0-12764

--- 1.272/sql/sql_show.cc	2005-08-22 17:46:14 -07:00
+++ 1.273/sql/sql_show.cc	2005-08-24 19:00:00 -07:00
@@ -2564,8 +2564,9 @@
       table->field[13]->set_notnull();
     }
     pos=(byte*) ((field->flags & PRI_KEY_FLAG) ? "PRI" :
-                 (field->flags & UNIQUE_KEY_FLAG) ? "UNI" :
-                 (field->flags & MULTIPLE_KEY_FLAG) ? "MUL":"");
+                 (field->flags & UNIQUE_KEY_FLAG) ?
+                 (field->maybe_null() ? "MUL" : "UNI") :
+                 (field->flags & MULTIPLE_KEY_FLAG) ? "MUL" : "");
     table->field[15]->store((const char*) pos,
                             strlen((const char*) pos), cs);
 

--- 1.73/mysql-test/r/show_check.result	2005-08-17 08:51:04 -07:00
+++ 1.74/mysql-test/r/show_check.result	2005-08-24 18:59:59 -07:00
@@ -557,3 +557,9 @@
 DROP TABLE urkunde;
 SHOW TABLES FROM non_existing_database;
 ERROR 42000: Unknown database 'non_existing_database'
+create table t1 (a int primary key, b int unique);
+desc t1;
+Field	Type	Null	Key	Default	Extra
+a	int(11)	NO	PRI		
+b	int(11)	YES	MUL	NULL	
+drop table t1;

--- 1.53/mysql-test/t/show_check.test	2005-08-17 08:51:04 -07:00
+++ 1.54/mysql-test/t/show_check.test	2005-08-24 19:00:00 -07:00
@@ -410,3 +410,10 @@
 #
 --error 1049
 SHOW TABLES FROM non_existing_database;
+
+#
+# Bug #12764: DESC table doesn't get UNIQUE but possibly NULL indexes right
+#
+create table t1 (a int primary key, b int unique);
+desc t1;
+drop table t1;
Thread
bk commit into 5.0 tree (jimw:1.1912) BUG#12764Jim Winstead25 Aug