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

            serg Sergei Golubchik created issue -
            ratzpo Rasmus Johansson (Inactive) made changes -
            Field Original Value New Value
            Workflow MariaDB v2 [ 59601 ] MariaDB v3 [ 66290 ]
            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.
            serg Sergei Golubchik made changes -
            Fix Version/s 10.2 [ 14601 ]
            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.
            serg Sergei Golubchik made changes -
            Assignee Michael Widenius [ monty ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.2 [ 14601 ]
            monty Michael Widenius made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            monty Michael Widenius made changes -
            Description Support CHECK constraint as in (or close to) SQL Standard 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));
            monty Michael Widenius made changes -
            monty Michael Widenius made changes -
            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));
            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`;

            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/
            monty Michael Widenius made changes -
            Component/s Data Definition - Alter Table [ 10114 ]
            serg Sergei Golubchik made changes -
            Fix Version/s 10.2.1 [ 22012 ]
            Fix Version/s 10.2 [ 14601 ]
            Resolution Fixed [ 1 ]
            Status In Progress [ 3 ] Closed [ 6 ]
            alvinr Alvin Richards (Inactive) made changes -
            Labels Compatibility
            alvinr Alvin Richards (Inactive) made changes -
            Sprint Compatibility-1 [ 88 ]
            alvinr Alvin Richards (Inactive) made changes -
            Epic Link MDEV-10872 [ 58182 ]
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            elenst Elena Stepanova made changes -
            alvinr Alvin Richards (Inactive) made changes -
            Labels Compatibility
            anikitin Andrii Nikitin (Inactive) made changes -
            alice Alice Sherepa made changes -
            marko Marko Mäkelä made changes -
            GeoffMontee Geoff Montee (Inactive) made changes -
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 66290 ] MariaDB v4 [ 132516 ]

            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.