summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2003-11-18 17:28:33 +0200
committerunknown <monty@mashka.mysql.fi>2003-11-18 17:28:33 +0200
commitcde9c4299b1f77abed719dbacb278030010760e6 (patch)
tree14411f816b508dee086e59ce38b1301c725a901f
parentc05413175bbbe2ec715d28c5cd28542ceba3d7e2 (diff)
parent3a553cf2afa6adebf81e9cf8a6cba4eaf90ded3d (diff)
downloadmariadb-git-cde9c4299b1f77abed719dbacb278030010760e6.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mashka.mysql.fi:/home/my/mysql-4.1
-rw-r--r--BitKeeper/etc/logging_ok1
-rw-r--r--mysql-test/r/multi_update.result22
-rw-r--r--mysql-test/t/multi_update.test35
-rw-r--r--sql/uniques.cc3
4 files changed, 60 insertions, 1 deletions
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok
index 00084b365f5..0cb7fbd10fd 100644
--- a/BitKeeper/etc/logging_ok
+++ b/BitKeeper/etc/logging_ok
@@ -117,6 +117,7 @@ serg@serg.mylan
serg@serg.mysql.com
serg@sergbook.mylan
serg@sergbook.mysql.com
+sergefp@mysql.com
sinisa@rhols221.adsl.netsonic.fi
tfr@beta.frontier86.ee
tfr@indrek.tfr.cafe.ee
diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
index a7579b538b5..b0d597f238a 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -341,3 +341,25 @@ select t1.a, t1.b,t2.a, t2.b from t1 left join t2 on t1.a=t2.a where t1.b=1 and
a b a b
2 2 NULL NULL
drop table t1,t2;
+create table t1 ( a int not null, b int not null) ;
+alter table t1 add index i1(a);
+delete from t1 where a > 2000000;
+create table t2 like t1;
+insert into t2 select * from t1;
+select 't2 rows before small delete', count(*) from t1;
+t2 rows before small delete count(*)
+t2 rows before small delete 2000000
+delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 2;
+select 't2 rows after small delete', count(*) from t2;
+t2 rows after small delete count(*)
+t2 rows after small delete 1999999
+select 't1 rows after small delete', count(*) from t1;
+t1 rows after small delete count(*)
+t1 rows after small delete 1999999
+delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 100*1000;
+select 't2 rows after big delete', count(*) from t2;
+t2 rows after big delete count(*)
+t2 rows after big delete 1900001
+select 't1 rows after big delete', count(*) from t1;
+t1 rows after big delete count(*)
+t1 rows after big delete 1900001
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 6b59778bbce..b3c742e0b30 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -275,3 +275,38 @@ insert into t2 values (1,1), (3,1);
update t1 left join t2 on t1.a=t2.a set t1.b=2, t2.b=2 where t1.b=1 and t2.b=1 or t2.a is NULL;
select t1.a, t1.b,t2.a, t2.b from t1 left join t2 on t1.a=t2.a where t1.b=1 and t2.b=1 or t2.a is NULL;
drop table t1,t2;
+
+#
+# Test for bug #1820.
+#
+
+create table t1 ( a int not null, b int not null) ;
+--disable_query_log
+insert into t1 values (1,1),(2,2),(3,3),(4,4);
+let $1=19;
+set @d=4;
+while ($1)
+{
+ eval insert into t1 select a+@d,b+@d from t1;
+ eval set @d=@d*2;
+ dec $1;
+}
+
+--enable_query_log
+alter table t1 add index i1(a);
+delete from t1 where a > 2000000;
+create table t2 like t1;
+insert into t2 select * from t1;
+
+select 't2 rows before small delete', count(*) from t1;
+delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 2;
+select 't2 rows after small delete', count(*) from t2;
+select 't1 rows after small delete', count(*) from t1;
+
+## Try deleting many rows
+
+delete t1,t2 from t1,t2 where t1.b=t2.a and t1.a < 100*1000;
+select 't2 rows after big delete', count(*) from t2;
+select 't1 rows after big delete', count(*) from t1;
+
+#drop table t1,t2;
diff --git a/sql/uniques.cc b/sql/uniques.cc
index 4514de834a8..f289fd11f5b 100644
--- a/sql/uniques.cc
+++ b/sql/uniques.cc
@@ -132,7 +132,8 @@ bool Unique::get(TABLE *table)
bzero((char*) &sort_param,sizeof(sort_param));
sort_param.max_rows= elements;
sort_param.sort_form=table;
- sort_param.sort_length=sort_param.ref_length=tree.size_of_element;
+ sort_param.rec_length= sort_param.sort_length=sort_param.ref_length=
+ tree.size_of_element;
sort_param.keys= max_in_memory_size / sort_param.sort_length;
sort_param.not_killable=1;