List:Internals« Previous MessageNext Message »
From:Sergey Petrunia Date:April 16 2005 9:35pm
Subject:bk commit into 4.1 tree (sergefp:1.2190) BUG#9439
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of psergey. When psergey 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.2190 05/04/16 23:35:39 sergefp@stripped +3 -0
  Fix for BUG#9439:
  Changed type of "Sub_part" column in SHOW KEYS from TINYINT to SMALLINT (as
MAX_KEY_LENGTH=1024)
  (this is the final cset with proper tests)

  sql/sql_show.cc
    1.198 05/04/16 23:35:37 sergefp@stripped +2 -2
    Fix for BUG#9439:
    Changed type of "Sub_part" column in SHOW KEYS from TINYINT to SMALLINT (as
MAX_KEY_LENGTH=1024)

  mysql-test/t/show_check.test
    1.42 05/04/16 23:35:37 sergefp@stripped +11 -0
    Testcase for BUG#9439

  mysql-test/r/show_check.result
    1.62 05/04/16 23:35:36 sergefp@stripped +21 -0
    Testcase for BUG#9439

# 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:	sergefp
# Host:	newbox.mylan
# Root:	/home/psergey/mysql-4.1-bug9439

--- 1.197/sql/sql_show.cc	2005-03-23 21:19:09 +03:00
+++ 1.198/sql/sql_show.cc	2005-04-16 23:35:37 +04:00
@@ -980,7 +980,7 @@
   field_list.push_back(item=new Item_int("Cardinality",0,21));
   item->maybe_null=1;
   field_list.push_back(item=new Item_return_int("Sub_part",3,
-						MYSQL_TYPE_TINY));
+						MYSQL_TYPE_SHORT));
   item->maybe_null=1;
   field_list.push_back(item=new Item_empty_string("Packed",10));
   item->maybe_null=1;
@@ -1025,7 +1025,7 @@
       /* Check if we have a key part that only uses part of the field */
       if (!(key_info->flags & HA_FULLTEXT) && (!key_part->field ||
           key_part->length !=
table->field[key_part->fieldnr-1]->key_length()))
-        protocol->store_tiny((longlong) key_part->length / 
+        protocol->store_short((longlong) key_part->length / 
                              key_part->field->charset()->mbmaxlen);
       else
         protocol->store_null();

--- 1.61/mysql-test/r/show_check.result	2005-03-01 11:20:53 +03:00
+++ 1.62/mysql-test/r/show_check.result	2005-04-16 23:35:36 +04:00
@@ -477,3 +477,24 @@
   KEY `i` TYPE BTREE (`i`)
 ) ENGINE=HEAP DEFAULT CHARSET=latin1
 DROP TABLE t1;
+CREATE TABLE t1(
+field1 text NOT NULL,
+PRIMARY KEY(field1(1000))
+);
+show index from t1;
+Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max
length	Is_null	Flags	Decimals	Charsetnr
+def					Table	253	64	2	N	129	31	63
+def					Non_unique	1	1	1	N	32929	0	63
+def					Key_name	253	64	7	N	129	31	63
+def					Seq_in_index	1	2	1	N	32929	0	63
+def					Column_name	253	64	6	N	129	31	63
+def					Collation	253	1	1	Y	128	31	63
+def					Cardinality	8	21	1	Y	32896	0	63
+def					Sub_part	2	3	4	Y	32928	0	63
+def					Packed	253	10	0	Y	128	31	63
+def					Null	253	3	0	N	129	31	63
+def					Index_type	253	16	5	N	129	31	63
+def					Comment	253	255	0	N	129	31	63
+Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment
+t1	0	PRIMARY	1	field1	A	0	1000	NULL		BTREE	
+drop table t1;

--- 1.41/mysql-test/t/show_check.test	2005-04-02 04:41:50 +04:00
+++ 1.42/mysql-test/t/show_check.test	2005-04-16 23:35:37 +04:00
@@ -357,3 +357,14 @@
 ALTER TABLE t1 ENGINE=MEMORY;
 SHOW CREATE TABLE t1;
 DROP TABLE t1;
+
+# Test for BUG#9439 "Reporting wrong datatype for sub_part on show index"
+CREATE TABLE t1(
+  field1 text NOT NULL,
+  PRIMARY KEY(field1(1000))
+);
+--enable_metadata
+show index from t1;
+--disable_metadata
+drop table t1;
+
Thread
bk commit into 4.1 tree (sergefp:1.2190) BUG#9439Sergey Petrunia16 Apr