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

Support CHECK constraint as in (or close to) SQL Standard

Details

    Description

      Support CHECK constraint as in (or close to) SQL Standard.

      The following syntaxes will be supported (they are already supported by the current MariaDB parser, but does nothing):

      As part of column definition:
      CREATE TABLE t1 (a int check (A > 10));

      As an independent constraint:
      CREATE TABLE t1 (a int, constraint `A` CHECK (A > 10));

      ALTER TABLE DROP CONSTRAINT `A`;

      Attachments

        Issue Links

          Activity

            libcub Paul Weiss added a comment -

            This one is very high priority for me.

            libcub Paul Weiss added a comment - This one is very high priority for me.
            toddmallen Todd Allen added a comment -

            I would also very much like to see this implemented.

            toddmallen Todd Allen added a comment - I would also very much like to see this implemented.

            This issue if also of rather high priority for me.

            We are in the process of migrating databases from Sybase to MariaDB and our database makes extensive use of Sybase "rules." From what I know, it would seem that to implement the equivalent, 'check constraint' would be much easier to use (implement, maintain, etc.) than triggers.

            laurent.langlois Laurent Langlois added a comment - This issue if also of rather high priority for me. We are in the process of migrating databases from Sybase to MariaDB and our database makes extensive use of Sybase "rules." From what I know, it would seem that to implement the equivalent, 'check constraint' would be much easier to use (implement, maintain, etc.) than triggers.
            Manasa ManasaTulluri added a comment - - edited

            Hi Dev Team,

            Kindly let us know if you are implementing check constraints any time soon in the up coming releases.

            Please let us know tentative date. We are migrating from Oracle to Mariadb and this will be very handy for us.

            Thanks & Regards,
            Manasa Tulluri.

            Manasa ManasaTulluri added a comment - - edited Hi Dev Team, Kindly let us know if you are implementing check constraints any time soon in the up coming releases. Please let us know tentative date. We are migrating from Oracle to Mariadb and this will be very handy for us. Thanks & Regards, Manasa Tulluri.

            Yes, there are plans to do it. But at the moment there's nothing final yet. Ask in a few weeks, please.

            serg Sergei Golubchik added a comment - Yes, there are plans to do it. But at the moment there's nothing final yet. Ask in a few weeks, please.

            This is now available in bb-10.2-default branch. Will be pushed into 10.2.1 shortly.
            It's already documented at https://mariadb.com/kb/en/mariadb/create-table/

            monty Michael Widenius added a comment - This is now available in bb-10.2-default branch. Will be pushed into 10.2.1 shortly. It's already documented at https://mariadb.com/kb/en/mariadb/create-table/

            People

              monty Michael Widenius
              serg Sergei Golubchik
              Votes:
              11 Vote for this issue
              Watchers:
              15 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.