Commit a79183b0 authored by Sergei Golubchik's avatar Sergei Golubchik

correct table name in CHECK failures during ALTER TABLE

parent fca44b7c
......@@ -59,7 +59,7 @@ partition p2 values less than ('2020-10-19'));
insert t1 values (0, '2000-01-02', 0);
insert t1 values (1, '2020-01-02', 10);
alter table t1 add check (b in (0, 1));
ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`#sql-temporary`
ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
alter table t1 add check (b in (0, 10));
show create table t1;
Table Create Table
......@@ -83,7 +83,7 @@ partition p2 values less than ('2020-10-19'));
insert t1 values (0, '2000-01-02', 0);
insert t1 values (1, '2020-01-02', 10);
alter table t1 add check (b in (0, 1));
ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`#sql-temporary`
ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
alter table t1 add check (b in (0, 10));
show create table t1;
Table Create Table
......
......@@ -79,7 +79,6 @@ partition p1 values less than ('2016-10-18'),
partition p2 values less than ('2020-10-19'));
insert t1 values (0, '2000-01-02', 0);
insert t1 values (1, '2020-01-02', 10);
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
--error ER_CONSTRAINT_FAILED
alter table t1 add check (b in (0, 1));
alter table t1 add check (b in (0, 10));
......@@ -96,7 +95,6 @@ partition p1 values less than ('2016-10-18'),
partition p2 values less than ('2020-10-19'));
insert t1 values (0, '2000-01-02', 0);
insert t1 values (1, '2020-01-02', 10);
--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
--error ER_CONSTRAINT_FAILED
alter table t1 add check (b in (0, 1));
alter table t1 add check (b in (0, 10));
......
......@@ -5178,7 +5178,7 @@ int TABLE::verify_constraints(bool ignore_failure)
field_error.append((*chk)->name.str);
my_error(ER_CONSTRAINT_FAILED,
MYF(ignore_failure ? ME_JUST_WARNING : 0), field_error.c_ptr(),
s->db.str, s->table_name.str);
s->db.str, s->error_table_name());
return ignore_failure ? VIEW_CHECK_SKIP : VIEW_CHECK_ERROR;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment