1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-07 17:42:39 +03:00

Merge mysql.com:/home/timka/mysql/src/5.0-virgin

into  mysql.com:/home/timka/mysql/src/5.0-bug-12672
This commit is contained in:
timour@mysql.com
2005-08-30 12:50:09 +03:00
3 changed files with 79 additions and 0 deletions

View File

@@ -1972,6 +1972,26 @@ a
b
c
d
create table bug12672 (
pk_col int auto_increment primary key, a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' '
) engine=innodb;
insert into bug12672 (a1, a2, b, c, d, dummy) select * from t1;
create index idx12672_0 on bug12672 (a1);
create index idx12672_1 on bug12672 (a1,a2,b,c);
create index idx12672_2 on bug12672 (a1,a2,b);
analyze table t1;
Table Op Msg_type Msg_text
test.t1 analyze status Table is already up to date
explain select distinct a1 from bug12672 where pk_col not in (1,2,3,4);
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE bug12672 range PRIMARY PRIMARY 4 NULL 93 Using where; Using temporary
select distinct a1 from bug12672 where pk_col not in (1,2,3,4);
a1
a
b
c
d
drop table bug12672;
drop table t1;
drop table t2;
drop table t3;

View File

@@ -651,6 +651,25 @@ select a1 from t1 where a2 = 'b' group by a1;
explain select distinct a1 from t1 where a2 = 'b';
select distinct a1 from t1 where a2 = 'b';
#
# Bug #12672: primary key implcitly included in every innodb index
#
create table bug12672 (
pk_col int auto_increment primary key, a1 char(64), a2 char(64), b char(16), c char(16) not null, d char(16), dummy char(64) default ' '
) engine=innodb;
insert into bug12672 (a1, a2, b, c, d, dummy) select * from t1;
create index idx12672_0 on bug12672 (a1);
create index idx12672_1 on bug12672 (a1,a2,b,c);
create index idx12672_2 on bug12672 (a1,a2,b);
analyze table t1;
explain select distinct a1 from bug12672 where pk_col not in (1,2,3,4);
select distinct a1 from bug12672 where pk_col not in (1,2,3,4);
drop table bug12672;
drop table t1;
drop table t2;