[MDEV-7563] Support CHECK constraint as in (or close to) SQL Standard Created: 2015-02-09  Updated: 2018-09-28  Resolved: 2016-07-04

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table
Fix Version/s: 10.2.1

Type: Task Priority: Major
Reporter: Sergei Golubchik Assignee: Michael Widenius
Resolution: Fixed Votes: 11
Labels: None

Issue Links:
PartOf
is part of MDEV-10137 Providing compatibility to other data... Open
Problem/Incident
causes MDEV-16331 Support instant DROP CHECK CONSTRAINT Closed
Relates
relates to MDEV-11114 Cannot drop column referenced by CHEC... Closed
relates to MDEV-11115 CHECK constraints are not shown in I_... Closed
relates to MDEV-11117 CHECK constraint fails on intermediat... Closed
relates to MDEV-12890 constraint name in column constraints Confirmed
relates to MDEV-17323 Backport INFORMATION_SCHEMA.CHECK_CON... Closed
relates to MDEV-13596 CHECK constraints disallow NULL to pa... Closed
Epic Link: Oracle Compatibility
Sprint: Compatibility-1

 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`;



 Comments   
Comment by Paul Weiss [ 2015-08-17 ]

This one is very high priority for me.

Comment by Todd Allen [ 2016-04-17 ]

I would also very much like to see this implemented.

Comment by Laurent Langlois [ 2016-04-25 ]

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.

Comment by ManasaTulluri [ 2016-05-03 ]

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.

Comment by Sergei Golubchik [ 2016-05-03 ]

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

Comment by Michael Widenius [ 2016-06-18 ]

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/

Generated at Thu Feb 08 07:20:33 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.