Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson 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@stripped, 2007-04-25 12:08:39+02:00, msvensson@stripped +3 -0
Merge pilot.blaudden:/home/msvensson/mysql/bug25262/my50-bug25262
into pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
MERGE: 1.2392.53.1
mysql-test/r/alter_table.result@stripped, 2007-04-25 12:08:38+02:00,
msvensson@stripped +0 -0
Merge tests
MERGE: 1.62.1.1
mysql-test/t/alter_table.test@stripped, 2007-04-25 12:08:38+02:00, msvensson@stripped
+0 -2
Merge tests
MERGE: 1.49.1.1
sql/sql_table.cc@stripped, 2007-04-25 12:08:10+02:00, msvensson@stripped +0 -0
Auto merged
MERGE: 1.328.1.6
# 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: msvensson
# Host: pilot.blaudden
# Root: /home/msvensson/mysql/mysql-5.0-maint/RESYNC
--- 1.340/sql/sql_table.cc 2007-04-17 15:51:57 +02:00
+++ 1.341/sql/sql_table.cc 2007-04-25 12:08:10 +02:00
@@ -3316,6 +3316,12 @@ view_err:
create_info->avg_row_length= table->s->avg_row_length;
if (!(used_fields & HA_CREATE_USED_DEFAULT_CHARSET))
create_info->default_table_charset= table->s->table_charset;
+ if (!(used_fields & HA_CREATE_USED_AUTO) &&
table->found_next_number_field)
+ {
+ /* Table has an autoincrement, copy value to new table */
+ table->file->info(HA_STATUS_AUTO);
+ create_info->auto_increment_value= table->file->auto_increment_value;
+ }
restore_record(table, s->default_values); // Empty record for DEFAULT
List_iterator<Alter_drop> drop_it(alter_info->drop_list);
--- 1.63/mysql-test/r/alter_table.result 2007-03-01 13:42:39 +01:00
+++ 1.64/mysql-test/r/alter_table.result 2007-04-25 12:08:38 +02:00
@@ -826,6 +826,40 @@ create table t1 (t varchar(255) default
engine=myisam default charset=latin1;
alter table t1 change t t text;
drop table t1;
+CREATE TABLE t1 (a varchar(500));
+ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b);
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(500) default NULL,
+ `b` geometry NOT NULL,
+ SPATIAL KEY `b` (`b`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ALTER TABLE t1 ADD KEY(b(50));
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(500) default NULL,
+ `b` geometry NOT NULL,
+ SPATIAL KEY `b` (`b`),
+ KEY `b_2` (`b`(50))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ALTER TABLE t1 ADD c POINT;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `a` varchar(500) default NULL,
+ `b` geometry NOT NULL,
+ `c` point default NULL,
+ SPATIAL KEY `b` (`b`),
+ KEY `b_2` (`b`(50))
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+CREATE TABLE t2 (a INT, KEY (a(20)));
+ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is
longer than the key part, or the storage engine doesn't support unique sub keys
+ALTER TABLE t1 ADD d INT;
+ALTER TABLE t1 ADD KEY (d(20));
+ERROR HY000: Incorrect sub part key; the used key part isn't a string, the used length is
longer than the key part, or the storage engine doesn't support unique sub keys
+DROP TABLE t1;
create table t1(id int(8) primary key auto_increment) engine=heap;
insert into t1 values (null);
insert into t1 values (null);
--- 1.50/mysql-test/t/alter_table.test 2007-03-01 13:43:03 +01:00
+++ 1.51/mysql-test/t/alter_table.test 2007-04-25 12:08:38 +02:00
@@ -615,6 +615,27 @@ alter table t1 change t t text;
drop table t1;
#
+# Bug #26794: Adding an index with a prefix on a SPATIAL type breaks ALTER
+# TABLE
+#
+CREATE TABLE t1 (a varchar(500));
+
+ALTER TABLE t1 ADD b GEOMETRY NOT NULL, ADD SPATIAL INDEX(b);
+SHOW CREATE TABLE t1;
+ALTER TABLE t1 ADD KEY(b(50));
+SHOW CREATE TABLE t1;
+
+ALTER TABLE t1 ADD c POINT;
+SHOW CREATE TABLE t1;
+
+--error ER_WRONG_SUB_KEY
+CREATE TABLE t2 (a INT, KEY (a(20)));
+
+ALTER TABLE t1 ADD d INT;
+--error ER_WRONG_SUB_KEY
+ALTER TABLE t1 ADD KEY (d(20));
+
+DROP TABLE t1;
# Bug#25262 Auto Increment lost when changing Engine type
#
| Thread |
|---|
| • bk commit into 5.0 tree (msvensson:1.2458) | msvensson | 25 Apr |