Commit becf27e6 authored by monty@donna.mysql.fi's avatar monty@donna.mysql.fi
Browse files

Removed duplicated index_init() calls that causes problems with BDB

tables.
Merged maxsql.spec with mysql.spec
parent d2b05129
Loading
Loading
Loading
Loading
+57 −21
Original line number Diff line number Diff line
@@ -108,14 +108,14 @@ id parent_id level
1204	107	2
id	parent_id	level
1008	102	2
1015	102	2
1010	102	2
1015	102	2
table	type	possible_keys	key	key_len	ref	rows	Extra
t1	ref	level	level	1	const	1	where used; Using index
t1	index	level	level	1	NULL	39	where used; Using index
table	type	possible_keys	key	key_len	ref	rows	Extra
t1	ref	level	level	1	const	1	where used; Using index
t1	index	level	level	1	NULL	39	where used; Using index
table	type	possible_keys	key	key_len	ref	rows	Extra
t1	ref	level	level	1	const	1	where used
t1	ref	level	level	1	const	12	
level	id
1	1002
1	1003
@@ -130,28 +130,29 @@ level id parent_id
1	1005	101
1	1006	101
1	1007	101
Table	Op	Msg_type	Msg_text
test.t1	optimize	error	The handler for the table doesn't support check/repair
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Comment
t1	0	PRIMARY	1	id	A	2	NULL	NULL	
t1	1	parent_id	1	parent_id	A	4	NULL	NULL	
t1	1	level	1	level	A	4	NULL	NULL	
gesuchnr	benutzer_id
1	1
2	1
Table	Op	Msg_type	Msg_text
test.t1	optimize	error	The handler for the table doesn't support check/repair
a
2
Table	Op	Msg_type	Msg_text
test.t1	check	error	The handler for the table doesn't support check/repair
a	b
a	1
a	2
a	3
a	4
a	5
b	2
b	3
b	4
c	1
c	2
c	3
d	1
d	2
d	5
e	1
k	1
2	testing
Table	Op	Msg_type	Msg_text
test.t1	analyze	error	The handler for the table doesn't support check/repair
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Comment
t1	1	skr	1	a	A	3	NULL	NULL	
a	b
1	
n	after rollback
n	after commit
4	after commit
@@ -249,6 +250,11 @@ id ggid email passwd
1	test1		xxx
id	ggid	email	passwd
2	test2		yyy
id	ggid	email	passwd
2	test2		yyy
100	test2		xxx
id	ggid	email	passwd
id	ggid	email	passwd
user_name	password	subscribed	user_id	quota	weight	access_date	access_time	approved	dummy_primary_key
user_0	somepassword	N	0	0	0	2000-09-07	23:06:59	2000-09-07 23:06:59	1
user_1	somepassword	Y	1	1	1	2000-09-07	23:06:59	2000-09-07 23:06:59	2
@@ -344,7 +350,7 @@ id parent_id level
1025	102	2
1016	102	2
table	type	possible_keys	key	key_len	ref	rows	Extra
t1	ref	level	level	1	const	1	where used; Using index
t1	ref	level	level	1	const	6	where used; Using index
level	id
1	1004
1	1005
@@ -402,7 +408,37 @@ id parent_id level
1180	105	2
count(*)
1
count(*)
1
count(*)
2
count(*)
1
count(*)
0
count(*)
1
count(*)
1
sca_pic
NULL
NULL
a
1
2
3
a
2
3
5
a	b
world	2
hello	1
Table	Op	Msg_type	Msg_text
test.t1	optimize	error	The handler for the table doesn't support check/repair
Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Comment
t1	0	PRIMARY	1	a	A	1	NULL	NULL	
i	j
1	2
i	j
1	2
+3 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ CREATE TABLE t1 (

replace into t1 (gesuchnr,benutzer_id) values (2,1);
replace into t1 (gesuchnr,benutzer_id) values (1,1);
--error 1022
replace into t1 (gesuchnr,benutzer_id) values (1,1);
select * from t1;
drop table t1;
@@ -268,7 +269,9 @@ select * from t1 where ggid='test1';
select * from t1 where passwd='xxx';
select * from t1 where id=2;

--error 1022
replace into t1 (ggid,id) values ('this will work',1);
--error 1022
replace into t1 (ggid,passwd) values ('test2','this will work');
-- error 1062
update t1 set id=100,ggid='test2' where id=1;
+7 −7
Original line number Diff line number Diff line
@@ -487,7 +487,7 @@ check_select_key2("*","id","id2","select_key");
check_select_key2("id,id2","id","id2","select_key_return_key");
check_select_key("*","id3","select_key2");
check_select_key("id3","id3","select_key2_return_key");
check_select_key("id1,id2","id3","select_key2_return_prim");
check_select_key("id,id2","id3","select_key2_return_prim");

####
#### A lot of simple selects on ranges
@@ -1443,7 +1443,7 @@ end_benchmark($start_time);

sub check_select_key
{
  my ($column,$check)= @_;
  my ($sel_columns,$column,$check)= @_;
  my ($loop_time,$end_time,$i,$tmp_var,$tmp,$count,$row_count,$estimated);

  $estimated=0;
@@ -1454,10 +1454,10 @@ sub check_select_key
    $count+=2;
    $tmpvar^= ((($tmpvar + 63) + $i)*3 % $opt_loop_count);
    $tmp=$tmpvar % ($total_rows);
    fetch_all_rows($dbh,"select * from bench1 where $column=$tmp")
    fetch_all_rows($dbh,"select $sel_columns from bench1 where $column=$tmp")
      or die $DBI::errstr;
    $tmp+=$total_rows;
    defined($row_count=fetch_all_rows($dbh,"select * from bench1 where $column=$tmp")) or die $DBI::errstr;
    defined($row_count=fetch_all_rows($dbh,"select $sel_columns from bench1 where $column=$tmp")) or die $DBI::errstr;
    die "Found $row_count rows on impossible id: $tmp\n" if ($row_count);
    $end_time=new Benchmark;
    last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$i,
@@ -1475,7 +1475,7 @@ sub check_select_key

sub check_select_key2
{
  my ($column,$column2,$check)= @_;
  my ($sel_columns,$column,$column2,$check)= @_;
  my ($loop_time,$end_time,$i,$tmp_var,$tmp,$count,$row_count,$estimated);

  $estimated=0;
@@ -1486,10 +1486,10 @@ sub check_select_key2
    $count+=2;
    $tmpvar^= ((($tmpvar + 63) + $i)*3 % $opt_loop_count);
    $tmp=$tmpvar % ($total_rows);
    fetch_all_rows($dbh,"select * from bench1 where $column=$tmp and $column2=$tmp")
    fetch_all_rows($dbh,"select $sel_columns from bench1 where $column=$tmp and $column2=$tmp")
      or die $DBI::errstr;
    $tmp+=$total_rows;
    defined($row_count=fetch_all_rows($dbh,"select * from bench1 where $column=$tmp and $column2=$tmp")) or die $DBI::errstr;
    defined($row_count=fetch_all_rows($dbh,"select $sel_columns from bench1 where $column=$tmp and $column2=$tmp")) or die $DBI::errstr;
    die "Found $row_count rows on impossible id: $tmp\n" if ($row_count);
    $end_time=new Benchmark;
    last if ($estimated=predict_query_time($loop_time,$end_time,\$count,$i,
+2 −0
Original line number Diff line number Diff line
@@ -1306,6 +1306,7 @@ int ha_berkeley::index_init(uint keynr)
{
  int error;
  DBUG_ENTER("index_init");
  DBUG_PRINT("enter",("table: '%s'  key: %d", table->real_name, keynr));
  active_index=keynr;
  dbug_assert(cursor == 0);
  if ((error=key_file[keynr]->cursor(key_file[keynr], transaction, &cursor,
@@ -1323,6 +1324,7 @@ int ha_berkeley::index_end()
  DBUG_ENTER("index_end");
  if (cursor)
  {
    DBUG_PRINT("enter",("table: '%s'", table->real_name));
    error=cursor->c_close(cursor);
    cursor=0;
  }
+2 −2
Original line number Diff line number Diff line
@@ -2488,6 +2488,7 @@ make_join_readinfo(JOIN *join,uint options)
	else if (table->used_keys && ! (tab->select && tab->select->quick))
	{					// Only read index tree
	  tab->index=find_shortest_key(table, table->used_keys);
	  tab->table->file->index_init(tab->index);
	  tab->read_first_record= join_init_read_first_with_key;
	  tab->type=JT_NEXT;		// Read with index_first / index_next
	}
@@ -4445,7 +4446,6 @@ join_init_read_first_with_key(JOIN_TAB *tab)
  tab->read_record.file=table->file;
  tab->read_record.index=tab->index;
  tab->read_record.record=table->record[0];
  tab->table->file->index_init(tab->index);
  error=tab->table->file->index_first(tab->table->record[0]);
  if (error)
  {
@@ -4494,7 +4494,6 @@ join_init_read_last_with_key(JOIN_TAB *tab)
  tab->read_record.file=table->file;
  tab->read_record.index=tab->index;
  tab->read_record.record=table->record[0];
  tab->table->file->index_init(tab->index);
  error=tab->table->file->index_last(tab->table->record[0]);
  if (error)
  {
@@ -5177,6 +5176,7 @@ test_if_skip_sort_order(JOIN_TAB *tab,ORDER *order,ha_rows select_limit)
	  tab->index=nr;
	  tab->read_first_record=  (flag > 0 ? join_init_read_first_with_key:
				    join_init_read_last_with_key);
	  tab->table->file->index_init(tab->index);
	  tab->type=JT_NEXT;	// Read with index_first(), index_next()
	  DBUG_RETURN(1);
	}
Loading