1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-24274 ALTER TABLE with CHECK CONSTRAINTS gives "Out of Memory" error

partially revert 76063c2a13. Item::clone() is not an all-purpose
Item copying machine, it was specifically created for pushdown
of predicates into derived tables and views and it does not
copy everything. In particular, it does not copy Item_func_regex.

Fix the bug differently by preserving the old constraint name.
But keep setting automatic_name=true to have it regenerated
for cases like ALTER TABLE ... ADD CONSTRAINT.
This commit is contained in:
Sergei Golubchik
2021-02-04 16:06:54 +01:00
parent c2c23e598d
commit ef5adf5207
4 changed files with 34 additions and 32 deletions

View File

@ -235,3 +235,15 @@ a b
insert t1 (b) values (1);
ERROR 23000: CONSTRAINT `CONSTRAINT_1` failed for `test`.`t1`
drop table t1;
#
# MDEV-24274 ALTER TABLE with CHECK CONSTRAINTS gives "Out of Memory" error
#
create table t1 (id varchar(2), constraint id check (id regexp '[a-z]'));
alter table t1 force;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`id` varchar(2) DEFAULT NULL,
CONSTRAINT `id` CHECK (`id` regexp '[a-z]')
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;