[MDEV-24785] ALTER TABLE with CHECK CONSTRAINTS gives "Out of Memory" error even table is empty and just created. Also, already confirmed that there is enough memory on the instance. Created: 2021-02-04  Updated: 2021-02-05  Resolved: 2021-02-05

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table
Affects Version/s: 10.4.16
Fix Version/s: N/A

Type: Bug Priority: Critical
Reporter: pk Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Environment:

centos7


Issue Links:
Duplicate
duplicates MDEV-24274 ALTER TABLE with CHECK CONSTRAINTS gi... Closed

 Description   

I am getting the error "ERROR 1041 (HY000): Out of memory." on creating check constraints. Also for any ALTER table command the same error is being thrown. please help in understanding and resolving the issue.



 Comments   
Comment by Alice Sherepa [ 2021-02-04 ]

Is it the same problem as MDEV-24274? Please add the output of show create table

Comment by pk [ 2021-02-05 ]

yes it seems like its the same issue. please let me know if this is fixed in any other version and when was it introduced so that we can plan a proper version accordingly and decide on our next steps for future security updates and version updates.

MariaDB [test]> CREATE TABLE `tab` (
-> `id` char(36) NOT NULL,
-> `created` datetime(6) NOT NULL,
-> `updated` datetime(6) NOT NULL,
-> `convid` varchar(50) NOT NULL,
-> `caller_id` varchar(2) NOT NULL,
-> `subject` varchar(1024) NOT NULL,
-> `body` varchar(1024) NOT NULL,
-> `is_read` bit(1) NOT NULL DEFAULT b'0',
-> `is_reply` bit(1) NOT NULL DEFAULT b'0',
-> `dest_id` char(2) NOT NULL,
-> `is_error` bit(1) NOT NULL DEFAULT b'0',
-> PRIMARY KEY (`id`),
-> CONSTRAINT `dest_id` CHECK (`dest_id` regexp '^[A-Z]

{2}$'),
-> CONSTRAINT `caller_id` CHECK (`caller_id` regexp '^[A-Z]{2}

$')
-> ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
Query OK, 0 rows affected (0.045 sec)

MariaDB [test]> alter table tab force;
ERROR 1041 (HY000): Out of memory.
MariaDB [test]> alter table tab encrypted=yes;
ERROR 1041 (HY000): Out of memory.
MariaDB [test]>

Generated at Thu Feb 08 09:32:39 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.