diff options
author | unknown <pem@mysql.com> | 2005-11-23 11:56:53 +0100 |
---|---|---|
committer | unknown <pem@mysql.com> | 2005-11-23 11:56:53 +0100 |
commit | b118282377a7b80b8d50b996d896bd5424d5d52e (patch) | |
tree | 7ca8eb3c54bc1d029f63f069d01992739288eb36 /sql/sql_update.cc | |
parent | 0026b6f46e550ff8f8c874f55272d15f4a19f3ac (diff) | |
download | mariadb-git-b118282377a7b80b8d50b996d896bd5424d5d52e.tar.gz |
Fixed BUG#13729 Stored procedures: packet error after exception handled
Don't set thd->is_fatal_error in sql_update for duplicate key errors.
mysql-test/r/sp.result:
New test case for BUG#13729.
mysql-test/r/sp_trans.result:
New test case for BUG#14840.
mysql-test/t/sp.test:
New test case for BUG#13729.
mysql-test/t/sp_trans.test:
New test case for BUG#14840.
sql/sql_update.cc:
Don't set thd->is_fatal_error if it's a duplicate key error.
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 039aa0f71fa..50f8e35a9e9 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -465,7 +465,12 @@ int mysql_update(THD *thd, } else if (!ignore || error != HA_ERR_FOUND_DUPP_KEY) { - thd->fatal_error(); // Force error message + /* + If (ignore && error == HA_ERR_FOUND_DUPP_KEY) we don't have to + do anything; otherwise... + */ + if (error != HA_ERR_FOUND_DUPP_KEY) + thd->fatal_error(); /* Other handler errors are fatal */ table->file->print_error(error,MYF(0)); error= 1; break; @@ -1259,7 +1264,12 @@ bool multi_update::send_data(List<Item> ¬_used_values) updated--; if (!ignore || error != HA_ERR_FOUND_DUPP_KEY) { - thd->fatal_error(); // Force error message + /* + If (ignore && error == HA_ERR_FOUND_DUPP_KEY) we don't have to + do anything; otherwise... + */ + if (error != HA_ERR_FOUND_DUPP_KEY) + thd->fatal_error(); /* Other handler errors are fatal */ table->file->print_error(error,MYF(0)); DBUG_RETURN(1); } |