Two bug fixes

parent 3805a5ed
...@@ -50797,6 +50797,11 @@ each individual 4.0.x release. ...@@ -50797,6 +50797,11 @@ each individual 4.0.x release.
@appendixsubsec Changes in release 4.0.5 @appendixsubsec Changes in release 4.0.5
@itemize @itemize
@item @item
Fixed a bug in multi-table deletes when outer join is used on an empty
table, which get's first to be deleted
@item
Fixed a bug in multi-table updates when a single table is updated
@item
Updated source tree to be built using @code{automake 1.5} and Updated source tree to be built using @code{automake 1.5} and
@code{libtool 1.4}. @code{libtool 1.4}.
@item @item
...@@ -135,3 +135,19 @@ ID ParId tst tst1 ...@@ -135,3 +135,19 @@ ID ParId tst tst1
2 2 MSSQL Microsoft 2 2 MSSQL Microsoft
3 3 ORACLE ORACLE 3 3 ORACLE ORACLE
drop table parent, child; drop table parent, child;
drop table if exists t1, t2 ;
create table t1 (n numeric(10));
create table t2 (n numeric(10));
insert into t2 values (1),(2),(4),(8),(16),(32);
select * from t2 left outer join t1 using (n);
n n
1 NULL
2 NULL
4 NULL
8 NULL
16 NULL
32 NULL
delete t1,t2 from t2 left outer join t1 using (n);
select * from t2 left outer join t1 using (n);
n n
drop table if exists t1,t2 ;
...@@ -140,3 +140,11 @@ select * from child; ...@@ -140,3 +140,11 @@ select * from child;
drop table parent, child; drop table parent, child;
drop table if exists t1, t2 ;
create table t1 (n numeric(10));
create table t2 (n numeric(10));
insert into t2 values (1),(2),(4),(8),(16),(32);
select * from t2 left outer join t1 using (n);
delete t1,t2 from t2 left outer join t1 using (n);
select * from t2 left outer join t1 using (n);
drop table if exists t1,t2 ;
...@@ -329,7 +329,7 @@ bool multi_delete::send_data(List<Item> &values) ...@@ -329,7 +329,7 @@ bool multi_delete::send_data(List<Item> &values)
table->status|= STATUS_DELETED; table->status|= STATUS_DELETED;
if (!(error=table->file->delete_row(table->record[0]))) if (!(error=table->file->delete_row(table->record[0])))
deleted++; deleted++;
else else if (!table_being_deleted->next)
{ {
table->file->print_error(error,MYF(0)); table->file->print_error(error,MYF(0));
DBUG_RETURN(1); DBUG_RETURN(1);
......
...@@ -768,7 +768,7 @@ bool multi_update::send_eof() ...@@ -768,7 +768,7 @@ bool multi_update::send_eof()
thd->proc_info="updating the reference tables"; thd->proc_info="updating the reference tables";
/* Does updates for the last n - 1 tables, returns 0 if ok */ /* Does updates for the last n - 1 tables, returns 0 if ok */
int error = do_updates(false); /* do_updates returns 0 if success */ int error = (num_updated > 1) ? do_updates(false) : 0; /* do_updates returns 0 if success */
/* reset used flags */ /* reset used flags */
#ifndef NOT_USED #ifndef NOT_USED
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment