Below is the list of changes that have just been committed into a local
5.0 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.1861 05/07/01 15:07:06 bar@stripped +3 -0
sql_table.cc:
Bug#11657 Creation of secondary index fails:
If TINYBLOB key part length is 255, it is equal
to field length. For BLOB, unlike for CHAR/VARCHAR,
we should keep a non-zero key part length, otherwise
"BLOB/TEXT column used in key specification without a key length"
error is produced afterwards.
type_blob.result, type_blob.test:
fixing tests accordinly
mysql-test/r/type_blob.result
1.47 05/07/01 15:03:41 bar@stripped +15 -0
fixing tests accordinly
mysql-test/t/type_blob.test
1.28 05/07/01 15:03:29 bar@stripped +8 -1
fixing tests accordinly
sql/sql_table.cc
1.256 05/07/01 15:01:26 bar@stripped +2 -1
Bug#11657 Creation of secondary index fails
For TINYBLOB key part length can be equal to field length.
We should still keep a non-zero key part length,
# 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-5.0
--- 1.255/sql/sql_table.cc 2005-06-30 13:38:22 +05:00
+++ 1.256/sql/sql_table.cc 2005-07-01 15:01:26 +05:00
@@ -3400,7 +3400,8 @@
*/
if (!Field::type_can_have_key_part(cfield->field->type()) ||
!Field::type_can_have_key_part(cfield->sql_type) ||
- cfield->field->field_length == key_part_length ||
+ (cfield->field->field_length == key_part_length &&
+ !f_is_blob(key_part->key_type)) ||
(cfield->length && (cfield->length < key_part_length /
key_part->field->charset()->mbmaxlen)))
key_part_length= 0; // Use whole field
--- 1.46/mysql-test/r/type_blob.result 2005-05-12 15:55:09 +05:00
+++ 1.47/mysql-test/r/type_blob.result 2005-07-01 15:03:41 +05:00
@@ -703,3 +703,18 @@
max(i)
4
drop table t1;
+create table t1 (a int, b int, c tinyblob, d int, e int);
+alter table t1 add primary key (a,b,c(255),d);
+alter table t1 add key (a,b,d,e);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` int(11) NOT NULL default '0',
+ `b` int(11) NOT NULL default '0',
+ `c` tinyblob NOT NULL,
+ `d` int(11) NOT NULL default '0',
+ `e` int(11) default NULL,
+ PRIMARY KEY (`a`,`b`,`c`(255),`d`),
+ KEY `a` (`a`,`b`,`d`,`e`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+drop table t1;
--- 1.27/mysql-test/t/type_blob.test 2005-04-06 07:45:08 +05:00
+++ 1.28/mysql-test/t/type_blob.test 2005-07-01 15:03:29 +05:00
@@ -394,4 +394,11 @@
select max(i) from t1 where c = '';
drop table t1;
-
+#
+# Bug#11657: Creation of secondary index fails
+#
+create table t1 (a int, b int, c tinyblob, d int, e int);
+alter table t1 add primary key (a,b,c(255),d);
+alter table t1 add key (a,b,d,e);
+show create table t1;
+drop table t1;
| Thread |
|---|
| • bk commit into 5.0 tree (bar:1.1861) BUG#11657 | bar | 1 Jul |