diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index b51436e6747..7b1fdab9ec2 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -1043,11 +1043,12 @@ alter table t1 add partition (partition p2 values in (3)); alter table t1 drop partition p2; use test; drop database db99; +drop procedure if exists mysqltest_1; create table t1 (a int) partition by list (a) (partition p0 values in (0)); insert into t1 values (0); -create procedure po () +create procedure mysqltest_1 () begin begin declare continue handler for sqlexception begin end; @@ -1056,6 +1057,7 @@ end; prepare stmt1 from 'alter table t1'; execute stmt1; end// -call po()// +call mysqltest_1()// drop table t1; +drop procedure mysqltest_1; End of 5.1 tests diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index 8cfcc059920..e82f0d184bf 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -1202,7 +1202,9 @@ drop database db99; # #BUG 17138 Problem with stored procedure and analyze partition # -drop procedure mysqltest_1 if exists; +--disable_warnings +drop procedure if exists mysqltest_1; +--enable_warnings create table t1 (a int) partition by list (a) diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 8b0bd655360..21a8da05ad9 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -981,8 +981,13 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info) goto err; table->file->restore_auto_increment(); // it's too early here! BUG#20188 is_duplicate_key_error= table->file->is_fatal_error(error, 0); - if (info->ignore && !is_duplicate_key_error) - goto ok_or_after_trg_err; + if (!is_duplicate_key_error) + { + if (info->ignore) + goto ok_or_after_trg_err; + else + goto err; + } if ((int) (key_nr = table->file->get_dup_key(error)) < 0) { error=HA_ERR_FOUND_DUPP_KEY; /* Database can't find key */