1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

branches/zip: Minor cleanup.

innobase_create_index_def(): Add parameter new_primary.

innobase_copy_index_def(): Simplify the documented algorithm,
and try to implement it properly.

innodb-index.test: Replace CHECKSUM TABLE with something more stable and
useful.  The test passes on an older BitKeeper snapshot:

ChangeSet@1.2475.18.9, 2007-05-08 11:16:41+02:00, jbruehe@mysql.com +1 -0
  Raise version number after cloning 5.1.18-beta

But it fails on a newer one where the statement
	alter table t1 add primary key (a), add key (b(20));
results in fast index creation:

ChangeSet@1.2500.1.40, 2007-06-01 20:06:13+04:00, kostja@bodhi.(none) +2 -0
  Merge bodhi.(none):/opt/local/work/mysql-5.0-runtime
  into  bodhi.(none):/opt/local/work/mysql-5.1-runtime
  MERGE: 1.1810.2984.14
This commit is contained in:
marko
2007-06-07 12:23:26 +00:00
parent 0e14cb5579
commit aa2a74a67c
3 changed files with 83 additions and 69 deletions

View File

@@ -936,29 +936,35 @@ id select_type table type possible_keys key key_len ref rows Extra
explain select * from t1 order by a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 index NULL PRIMARY 4 NULL 2 Using index
checksum table t1;
Table Checksum
test.t1 1531596814
drop table t1;
create table t1(a int, b blob,c text) engine=innodb default charset = utf8;
insert into t1 values (1,repeat('jejdkrun87',220),repeat('jejdkrun87',440));
insert into t1 values (2,repeat('adfd72nh9k',440),repeat('adfd72nh9k',1100));
checksum table t1;
Table Checksum
test.t1 1121933170
create table t1(a int, b blob, c text, d text not null) engine=innodb default charset = utf8;
insert into t1 values (22,repeat('jejdkrun87',220),repeat('jejdkrun87',440),'jejdkrun87');
insert into t1 values (44,repeat('adfd72nh9k',440),repeat('adfd72nh9k',880),'adfd72nh9k');
select count(*) from t1 where a=44;
count(*)
1
select a,b=repeat(d,10*a),c=repeat(d,20*a) from t1;
a b=repeat(d,10*a) c=repeat(d,20*a)
22 1 1
44 1 1
alter table t1 add primary key (a), add key (b(20));
checksum table t1;
Table Checksum
test.t1 335046842
insert into t1 values (3,repeat('adfdpplkeock',440),repeat('adfdpplkeock',1100));
insert into t1 values (4,repeat('adfdijnmnb78k',440),repeat('adfdijnmnb78k',1100));
insert into t1 values (5,repeat('adfdijn0loKNHJik',440),repeat('adfdijn0loKNHJik',1100));
select count(*) from t1 where a=44;
count(*)
1
select a,b=repeat(d,10*a),c=repeat(d,20*a) from t1;
a b=repeat(d,10*a) c=repeat(d,20*a)
22 1 1
44 1 1
insert into t1 values (33,repeat('adfdpplkeock',330),repeat('adfdpplkeock',660),'adfdpplkeock');
insert into t1 values (55,repeat('adfdijnmnb78k',550),repeat('adfdijnmnb78k',1100),'adfdijnmnb78k');
insert into t1 values (66,repeat('adfdijn0loKNHJik',660),repeat('adfdijn0loKNHJik',1320),'adfdijn0loKNHJik');
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL DEFAULT '0',
`b` blob,
`c` text,
`d` text NOT NULL,
PRIMARY KEY (`a`),
KEY `b` (`b`(20))
) ENGINE=InnoDB DEFAULT CHARSET=utf8
@@ -968,7 +974,11 @@ test.t1 check status OK
explain select * from t1 where b like 'adfd%';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range b b 23 NULL 2 Using where
checksum table t1;
Table Checksum
test.t1 1008226368
select a,b=repeat(d,10*a),c=repeat(d,20*a) from t1;
a b=repeat(d,10*a) c=repeat(d,20*a)
22 1 1
33 1 1
44 1 1
55 1 1
66 1 1
drop table t1;