diff options
author | unknown <heikki@hundin.mysql.fi> | 2003-07-07 16:39:53 +0300 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2003-07-07 16:39:53 +0300 |
commit | 5f5eb87f786f2b012134f50ac515f8dbb19f0fc3 (patch) | |
tree | 90f7e15926bfff52755777d5c4bd0114dbf5965b /sql/sql_delete.cc | |
parent | dfa08e3a8e148da73a8f6d871299a5da1b8130f9 (diff) | |
download | mariadb-git-5f5eb87f786f2b012134f50ac515f8dbb19f0fc3.tar.gz |
sql_delete.cc:
Fix bug: if a DELETE failed in a FOREIGN KEY error and it had already deleted some rows, then MySQL did not roll back the failed SQL statement, and also wrote it to the binlog
sql/sql_delete.cc:
Fix bug: if a DELETE failed in a FOREIGN KEY error and it had already deleted some rows, then MySQL did not roll back the failed SQL statement, and also wrote it to the binlog
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r-- | sql/sql_delete.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index caa1e0e0312..96638617610 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -145,7 +145,12 @@ int mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, ORDER *order, else { table->file->print_error(error,MYF(0)); - error=0; + error=1; /* In < 4.0.14 we set the error number to 0 here, but that + was not sensible, because then MySQL would not roll back the + failed DELETE, and also wrote it to the binlog. For MyISAM + tables a DELETE probably never should fail (?), but for + InnoDB it can fail in a FOREIGN KEY error or an + out-of-tablespace error. (Comment by Heikki July 7, 2003) */ break; } } |