Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-24274

ALTER TABLE with CHECK CONSTRAINTS gives "Out of Memory" error

    XMLWordPrintable

Details

    Description

      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.

      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.028 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.
      

      But if we remove CHECK CONSTRAINTS, it works.

      MariaDB [test]> CREATE TABLE `tab1` (
          ->   `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`)
          ->  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
      Query OK, 0 rows affected (0.028 sec)
       
      MariaDB [test]> alter table tab1 force;
      Query OK, 0 rows affected (0.084 sec)
      Records: 0  Duplicates: 0  Warnings: 0
       
      MariaDB [test]> alter table tab1 encrypted=yes;
      ERROR 1478 (HY000): Table storage engine 'InnoDB' does not support the create option 'ENCRYPTION_KEY_ID'
      MariaDB [test]> 
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              niljoshi Nilnandan Joshi
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.