Commit d65b4af2 authored by unknown's avatar unknown
Browse files

BUG#17138: Stored procedure error

Review fixes


mysql-test/r/partition.result:
  Review fixes
mysql-test/t/partition.test:
  Review fixes
sql/sql_insert.cc:
  Fixed a bug
parent 9ee380cb
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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
+3 −1
Original line number Diff line number Diff line
@@ -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)
+7 −2
Original line number Diff line number Diff line
@@ -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)
      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 */