Commit 2fef897c authored by unknown's avatar unknown
Browse files

Merge jlindstrom@bk-internal.mysql.com:/home/bk/mysql-4.1

into hundin.mysql.fi:/home/jan/mysql-4.1

parents d2d4b488 9639bc21
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -529,6 +529,7 @@ show keys from t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment
t1	1	a	1	a	A	NULL	NULL	NULL	YES	BTREE	disabled
create table t2 (a int);
set @@rand_seed1=31415926,@@rand_seed2=2718281828;
insert t1 select * from t2;
show keys from t1;
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment
+7 −0
Original line number Diff line number Diff line
@@ -87,6 +87,13 @@ a b c
7	8	3
8	2	3
drop table t2;
CREATE TABLE t2 (
a int unsigned NOT NULL PRIMARY KEY,
b int unsigned not null,
c int unsigned,
UNIQUE USING HASH (b, c)	
) engine=ndbcluster;
ERROR 42000: Column 'c' is used with UNIQUE or INDEX but is not defined as NOT NULL
CREATE TABLE t3 (
a int unsigned NOT NULL,
b int unsigned not null,
+15 −0
Original line number Diff line number Diff line
@@ -1990,3 +1990,18 @@ ac
700
NULL
drop tables t1,t2;
create table t1 (a int not null, b int not null, c int, primary key (a,b));
insert into t1 values (1,1,1), (2,2,2), (3,3,3);
set @b:= 0;
explain select sum(a) from t1 where b > @b;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	index	NULL	PRIMARY	8	NULL	3	Using where; Using index
set @a:= (select sum(a) from t1 where b > @b);
explain select a from t1 where c=2;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	Using where
do @a:= (select sum(a) from t1 where b > @b);
explain select a from t1 where c=2;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ALL	NULL	NULL	NULL	NULL	3	Using where
drop table t1;
+2 −1
Original line number Diff line number Diff line
@@ -498,11 +498,12 @@ alter table t1 disable keys;
show keys from t1;
create table t2 (a int);
let $i=1000;
set @@rand_seed1=31415926,@@rand_seed2=2718281828;
--disable_query_log
while ($i)
{
  dec $i;
  eval insert t2 values (rand()*100000);
  insert t2 values (rand()*100000);
}
--enable_query_log
insert t1 select * from t2;
+8 −0
Original line number Diff line number Diff line
@@ -58,6 +58,14 @@ select * from t2 order by a;

drop table t2;

-- error 1121
CREATE TABLE t2 (
  a int unsigned NOT NULL PRIMARY KEY,
  b int unsigned not null,
  c int unsigned,
  UNIQUE USING HASH (b, c)	
) engine=ndbcluster;

#
# Show use of PRIMARY KEY USING HASH indexes 
#
Loading