Below is the list of changes that have just been committed into a local
4.1 repository of bar. When bar 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.2486 06/05/19 13:32:17 bar@stripped +3 -0
Bug#11228: DESC shows arbitrary column as "PRI"
An UNIQUE KEY consisting of NOT NULL columns
was displayed as PRIMARY KEY in "DESC t1".
According to the code, that was intentional
behaviour for some reasons unknown to me.
This code was written before bitkeeper time,
so I cannot check who and why made this.
I decided to keep this code under ifdef,
just for the case if someone will need this behaviour in
the future.
sql/table.cc
1.134 06/05/19 13:32:12 bar@stripped +2 -0
Switching off compilation of the wrong code.
mysql-test/t/key.test
1.23 06/05/19 13:32:12 bar@stripped +11 -0
Adding test case
mysql-test/r/key.result
1.26 06/05/19 13:32:12 bar@stripped +10 -0
Adding test case
# 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: bar
# Host: bar.intranet.mysql.r18.ru
# Root: /usr/home/bar/mysql-4.1.b11228
--- 1.133/sql/table.cc 2006-03-20 14:36:41 +04:00
+++ 1.134/sql/table.cc 2006-05-19 13:32:12 +05:00
@@ -567,6 +567,7 @@ int openfrm(const char *name, const char
if (outparam->key_info[key].flags & HA_FULLTEXT)
outparam->key_info[key].algorithm= HA_KEY_ALG_FULLTEXT;
+#ifdef NOT_NULL_UNIQUE_KEY_AS_PRIMARY_KEY
if (primary_key >= MAX_KEY && (keyinfo->flags & HA_NOSAME))
{
/*
@@ -587,6 +588,7 @@ int openfrm(const char *name, const char
}
}
}
+#endif
for (i=0 ; i < keyinfo->key_parts ; key_part++,i++)
{
--- 1.25/mysql-test/r/key.result 2005-08-29 19:50:06 +05:00
+++ 1.26/mysql-test/r/key.result 2006-05-19 13:32:12 +05:00
@@ -326,6 +326,16 @@ alter table t1 add key (c1,c1,c2);
ERROR 42S21: Duplicate column name 'c1'
drop table t1;
create table t1 (
+i1 INT NOT NULL,
+i2 INT NOT NULL,
+UNIQUE i1idx (i1),
+UNIQUE i2idx (i2));
+desc t1;
+Field Type Null Key Default Extra
+i1 int(11) UNI 0
+i2 int(11) UNI 0
+drop table t1;
+create table t1 (
c1 int,
c2 varchar(20) not null,
primary key (c1),
--- 1.22/mysql-test/t/key.test 2005-08-29 19:50:06 +05:00
+++ 1.23/mysql-test/t/key.test 2006-05-19 13:32:12 +05:00
@@ -322,6 +322,17 @@ alter table t1 add key (c1,c1,c2);
drop table t1;
#
+# Bug#11228: DESC shows arbitrary column as "PRI"
+#
+create table t1 (
+ i1 INT NOT NULL,
+ i2 INT NOT NULL,
+ UNIQUE i1idx (i1),
+ UNIQUE i2idx (i2));
+desc t1;
+drop table t1;
+
+#
# Bug#12565 - ERROR 1034 when running simple UPDATE or DELETE
# on large MyISAM table
#
| Thread |
|---|
| • bk commit into 4.1 tree (bar:1.2486) BUG#11228 | bar | 19 May |