diff options
author | unknown <Sinisa@sinisa.nasamreza.org> | 2001-10-25 14:41:49 +0300 |
---|---|---|
committer | unknown <Sinisa@sinisa.nasamreza.org> | 2001-10-25 14:41:49 +0300 |
commit | 1c908336061adcc88705c0e8f99ac849bb31b1d6 (patch) | |
tree | 8fa4e9dfeef51e31e2d6a03e2ba79a26d832f7c5 /sql/sql_delete.cc | |
parent | f9b331ff8a647dbb689061ec1cc0a03d73b53446 (diff) | |
download | mariadb-git-1c908336061adcc88705c0e8f99ac849bb31b1d6.tar.gz |
New alternate UNION syntax and bug fix for multi-table deletes
mysql-test/r/union.result:
New results for optional UNION syntax
mysql-test/t/union.test:
New test for alternate syntax for UNION
sql/sql_delete.cc:
Fixed bug in multi-table delete's with transactional tables
sql/sql_parse.cc:
A small change to enable new UNION syntax
sql/sql_union.cc:
New alternate UNION syntax
sql/sql_yacc.yy:
New alternate UNION syntax
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index b8d4f00533e..a712d4ca54c 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -455,11 +455,13 @@ int multi_delete::do_deletes (bool from_send_error) bool multi_delete::send_eof() { thd->proc_info="deleting from reference tables"; /* out: 1 if error, 0 if success */ + + /* Does deletes for the last n - 1 tables, returns 0 if ok */ int error = do_deletes(false); /* do_deletes returns 0 if success */ /* reset used flags */ delete_tables->table->no_keyread=0; - + if (error == -1) error = 0; thd->proc_info="end"; if (error) { @@ -485,12 +487,10 @@ bool multi_delete::send_eof() !some_table_is_not_transaction_safe(delete_tables)) error=1; /* Log write failed: roll back the SQL statement */ - if (deleted) - { - /* If autocommit is on we do a commit, in an error case we - roll back the current SQL statement */ - VOID(ha_autocommit_or_rollback(thd, error != 0)); - } + + /* Commit or rollback the current SQL statement */ + + VOID(ha_autocommit_or_rollback(thd,error > 0)); } ::send_ok(&thd->net,deleted); |