Two bug fixes

parent 3805a5ed
......@@ -50797,6 +50797,11 @@ each individual 4.0.x release.
@appendixsubsec Changes in release 4.0.5
@itemize
@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
@code{libtool 1.4}.
@item
......@@ -135,3 +135,19 @@ ID ParId tst tst1
2 2 MSSQL Microsoft
3 3 ORACLE ORACLE
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 ;
......@@ -139,4 +139,12 @@ WHERE child.ParId = parent.Id;
select * from child;
drop table parent, child;
\ No newline at end of file
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)
table->status|= STATUS_DELETED;
if (!(error=table->file->delete_row(table->record[0])))
deleted++;
else
else if (!table_being_deleted->next)
{
table->file->print_error(error,MYF(0));
DBUG_RETURN(1);
......
......@@ -768,7 +768,7 @@ bool multi_update::send_eof()
thd->proc_info="updating the reference tables";
/* 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 */
#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