List:Commits« Previous MessageNext Message »
From:Joerg Bruehe Date:June 30 2006 5:37pm
Subject:bk commit into 5.0 tree (joerg:1.2215) BUG#11228
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of joerg. When joerg 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.2215 06/06/30 19:37:11 joerg@stripped +3 -0
  Manual transfer of the following changeset into the 5.0.23 release clone:
     1.2525 06/06/30 18:29:27 monty@stripped +3 -0
     Reverted wrong bug fix (Bug#11228)

  sql/table.cc
    1.224 06/06/30 19:37:05 joerg@stripped +21 -0
    Manual transfer of the following fix into the 5.0.23 release clone:
       1.135 06/06/30 18:29:25 monty@stripped +21 -0
       Reverted wrong bug fix.   ...

  mysql-test/t/key.test
    1.26 06/06/30 19:37:05 joerg@stripped +1 -0
    Manual transfer of the following fix into the 5.0.23 release clone:
       1.24 06/06/30 18:29:25 monty@stripped +1 -0
       Added SHOW CREATE TABLE, which is the proper way to check for table definitions

  mysql-test/r/key.result
    1.31 06/06/30 19:37:05 joerg@stripped +9 -1
    Manual transfer of the following fix into the 5.0.23 release clone:
       1.27 06/06/30 18:29:25 monty@stripped +9 -1
       Fixed result after removing wrong bug fix

# 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:	joerg
# Host:	trift2.
# Root:	/M50/clone-5.0

--- 1.223/sql/table.cc	2006-06-26 04:48:10 +02:00
+++ 1.224/sql/table.cc	2006-06-30 19:37:05 +02:00
@@ -678,6 +678,27 @@
       if (outparam->key_info[key].flags & HA_FULLTEXT)
 	outparam->key_info[key].algorithm= HA_KEY_ALG_FULLTEXT;
 
+      if (primary_key >= MAX_KEY && (keyinfo->flags & HA_NOSAME))
+      {
+	/*
+	  If the UNIQUE key doesn't have NULL columns and is not a part key
+	  declare this as a primary key.
+	*/
+	primary_key=key;
+	for (i=0 ; i < keyinfo->key_parts ;i++)
+	{
+	  uint fieldnr= key_part[i].fieldnr;
+	  if (!fieldnr ||
+	      outparam->field[fieldnr-1]->null_ptr ||
+	      outparam->field[fieldnr-1]->key_length() !=
+	      key_part[i].length)
+	  {
+	    primary_key=MAX_KEY;		// Can't be used
+	    break;
+	  }
+	}
+      }
+
       for (i=0 ; i < keyinfo->key_parts ; key_part++,i++)
       {
 	if (new_field_pack_flag <= 1)

--- 1.30/mysql-test/r/key.result	2006-06-23 17:36:08 +02:00
+++ 1.31/mysql-test/r/key.result	2006-06-30 19:37:05 +02:00
@@ -336,8 +336,16 @@
 UNIQUE i2idx (i2));
 desc t1;
 Field	Type	Null	Key	Default	Extra
-i1	int(11)	NO	UNI		
+i1	int(11)	NO	PRI		
 i2	int(11)	NO	UNI		
+show create table t1;
+Table	Create Table
+t1	CREATE TABLE `t1` (
+  `i1` int(11) NOT NULL,
+  `i2` int(11) NOT NULL,
+  UNIQUE KEY `i1idx` (`i1`),
+  UNIQUE KEY `i2idx` (`i2`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
 drop table t1;
 create table t1 (
 c1 int,

--- 1.25/mysql-test/t/key.test	2006-06-23 12:53:39 +02:00
+++ 1.26/mysql-test/t/key.test	2006-06-30 19:37:05 +02:00
@@ -334,6 +334,7 @@
  UNIQUE i1idx (i1),
  UNIQUE i2idx (i2));
 desc t1;
+show create table t1;
 drop table t1;
 
 #
Thread
bk commit into 5.0 tree (joerg:1.2215) BUG#11228Joerg Bruehe30 Jun