Commit 27fb23c6 authored by unknown's avatar unknown
Browse files

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

into  c-5c0be253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/bug12796

parents 67b1ea24 7f3f9027
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
      DBUG_RETURN(1);
    }
    share->keydef= (HP_KEYDEF*) (share + 1);
    share->key_stat_version= 1;
    keyseg= (HA_KEYSEG*) (share->keydef + keys);
    init_block(&share->block, reclength + 1, min_records, max_records);
	/* Fix keys */
+1 −0
Original line number Diff line number Diff line
@@ -136,6 +136,7 @@ typedef struct st_heap_share
  HP_KEYDEF  *keydef;
  ulong min_records,max_records;	/* Params to open */
  ulong data_length,index_length,max_table_size;
  uint key_stat_version;                /* version to indicate insert/delete */
  uint records;				/* records */
  uint blength;				/* records rounded up to 2^n */
  uint deleted;				/* Deleted records in database */
+11 −1
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ SELECT * FROM t1 WHERE a=NULL;
a	b
explain SELECT * FROM t1 WHERE a IS NULL;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ref	a	a	5	const	1	Using where
1	SIMPLE	t1	ref	a	a	5	const	2	Using where
SELECT * FROM t1 WHERE a<=>NULL;
a	b
NULL	99
@@ -296,3 +296,13 @@ insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcd
insert into t1 values ("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
ERROR 23000: Duplicate entry 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijkl' for key 1
drop table t1;
CREATE TABLE t1 (a int, key(a)) engine=heap;
insert delayed into t1 values (0);
delete from t1;
select * from t1;
a
insert delayed into t1 values (0), (1);
select * from t1 where a = 0;
a
0
drop table t1;
+10 −10
Original line number Diff line number Diff line
@@ -182,7 +182,7 @@ SELECT * FROM t1 WHERE a=NULL;
a	b
explain SELECT * FROM t1 WHERE a IS NULL;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ref	a	a	5	const	1	Using where
1	SIMPLE	t1	ref	a	a	5	const	2	Using where
SELECT * FROM t1 WHERE a<=>NULL;
a	b
NULL	99
@@ -220,16 +220,16 @@ insert into t1 values ('aaag', 'prefill-hash=3',0);
insert into t1 values ('aaah', 'prefill-hash=6',0);
explain select * from t1 where a='aaaa';
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ref	a	a	8	const	1	Using where
1	SIMPLE	t1	ref	a	a	8	const	2	Using where
explain select * from t1 where a='aaab';
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ref	a	a	8	const	1	Using where
1	SIMPLE	t1	ref	a	a	8	const	2	Using where
explain select * from t1 where a='aaac';
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ref	a	a	8	const	1	Using where
1	SIMPLE	t1	ref	a	a	8	const	2	Using where
explain select * from t1 where a='aaad';
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ref	a	a	8	const	1	Using where
1	SIMPLE	t1	ref	a	a	8	const	2	Using where
insert into t1 select * from t1;
flush tables;
explain select * from t1 where a='aaaa';
@@ -291,25 +291,25 @@ insert into t1 (name) values ('Matt'), ('Lilu'), ('Corbin'), ('Carly'),
insert into t2 select * from t1;
explain select * from t1 where name='matt';
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ref	heap_idx,btree_idx	heap_idx	20	const	1	Using where
1	SIMPLE	t1	ref	heap_idx,btree_idx	btree_idx	20	const	1	Using where
explain select * from t2 where name='matt';
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t2	ref	btree_idx,heap_idx	btree_idx	20	const	1	Using where
explain select * from t1 where name='Lilu';
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ref	heap_idx,btree_idx	heap_idx	20	const	1	Using where
1	SIMPLE	t1	ref	heap_idx,btree_idx	btree_idx	20	const	1	Using where
explain select * from t2 where name='Lilu';
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t2	ref	btree_idx,heap_idx	btree_idx	20	const	1	Using where
explain select * from t1 where name='Phil';
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ref	heap_idx,btree_idx	heap_idx	20	const	1	Using where
1	SIMPLE	t1	ref	heap_idx,btree_idx	btree_idx	20	const	1	Using where
explain select * from t2 where name='Phil';
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t2	ref	btree_idx,heap_idx	btree_idx	20	const	1	Using where
explain select * from t1 where name='Lilu';
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	ref	heap_idx,btree_idx	heap_idx	20	const	1	Using where
1	SIMPLE	t1	ref	heap_idx,btree_idx	btree_idx	20	const	1	Using where
explain select * from t2 where name='Lilu';
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t2	ref	btree_idx,heap_idx	btree_idx	20	const	1	Using where
@@ -364,5 +364,5 @@ a
3
explain select a from t1 where a in (1,3);
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1	SIMPLE	t1	range	a	a	5	NULL	2	Using where
1	SIMPLE	t1	range	a	a	5	NULL	4	Using where
drop table t1;
+1 −1
Original line number Diff line number Diff line
@@ -554,7 +554,7 @@ Warnings:
Note	1031	Table storage engine for 't1' doesn't have this option
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	NULL	1000	NULL	NULL	YES	HASH	
t1	1	a	1	a	NULL	500	NULL	NULL	YES	HASH	
drop table t1,t2;
create table t1 ( a tinytext, b char(1), index idx (a(1),b) );
insert into t1 values (null,''), (null,'');
Loading