mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge mysql.com:/home/jimw/my/mysql-5.0-10543
into mysql.com:/home/jimw/my/mysql-5.0-clean sql/field.cc: Auto merged sql/field.h: Auto merged sql/sql_table.cc: Auto merged
This commit is contained in:
@ -329,3 +329,28 @@ ERROR 42S21: Duplicate column name 'c1'
|
||||
alter table t1 add key (c1,c1,c2);
|
||||
ERROR 42S21: Duplicate column name 'c1'
|
||||
drop table t1;
|
||||
create table t1 (a varchar(10), b varchar(10), key(a(10),b(10)));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) default NULL,
|
||||
`b` varchar(10) default NULL,
|
||||
KEY `a` (`a`,`b`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
alter table t1 modify b varchar(20);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(10) default NULL,
|
||||
`b` varchar(20) default NULL,
|
||||
KEY `a` (`a`,`b`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
alter table t1 modify a varchar(20);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`a` varchar(20) default NULL,
|
||||
`b` varchar(20) default NULL,
|
||||
KEY `a` (`a`,`b`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
|
@ -392,3 +392,26 @@ group by t1.b, t1.a;
|
||||
a b min(t1.b)
|
||||
22 NULL NULL
|
||||
drop table t1, t2;
|
||||
create table t1 (f1 varchar(65500));
|
||||
create index index1 on t1(f1(10));
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` varchar(65500) default NULL,
|
||||
KEY `index1` (`f1`(10))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
alter table t1 modify f1 varchar(255);
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` varchar(255) default NULL,
|
||||
KEY `index1` (`f1`(10))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
alter table t1 modify f1 tinytext;
|
||||
show create table t1;
|
||||
Table Create Table
|
||||
t1 CREATE TABLE `t1` (
|
||||
`f1` tinytext,
|
||||
KEY `index1` (`f1`(10))
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
|
@ -324,3 +324,16 @@ alter table t1 add key (c1,c2,c1);
|
||||
--error 1060
|
||||
alter table t1 add key (c1,c1,c2);
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# If we use a partial field for a key that is actually the length of the
|
||||
# field, and we extend the field, we end up with a key that includes the
|
||||
# whole new length of the field.
|
||||
#
|
||||
create table t1 (a varchar(10), b varchar(10), key(a(10),b(10)));
|
||||
show create table t1;
|
||||
alter table t1 modify b varchar(20);
|
||||
show create table t1;
|
||||
alter table t1 modify a varchar(20);
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
@ -118,3 +118,15 @@ insert into t2 values (22), (22);
|
||||
select t1.a, t1.b, min(t1.b) from t1 inner join t2 ON t2.a = t1.a
|
||||
group by t1.b, t1.a;
|
||||
drop table t1, t2;
|
||||
|
||||
#
|
||||
# Bug #10543: convert varchar with index to text
|
||||
#
|
||||
create table t1 (f1 varchar(65500));
|
||||
create index index1 on t1(f1(10));
|
||||
show create table t1;
|
||||
alter table t1 modify f1 varchar(255);
|
||||
show create table t1;
|
||||
alter table t1 modify f1 tinytext;
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user