New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for CHECK constraints (feature request) #13592

Open
stevenwdv opened this Issue Aug 18, 2017 · 7 comments

Comments

Projects
None yet
6 participants
@stevenwdv
Contributor

stevenwdv commented Aug 18, 2017

MariaDB (MySQL-compatible) added support for CHECK constraints to version 10.2.1 (stable=10.2.8). It would be very useful if PHPMyAdmin had a UI for adding and managing these in tbl_create.php and tbl_structure.php.
(Update: see also phpmyadmin/sql-parser#167)

Edit: they are also not exported by export.php.

@nijel nijel added the enhancement label Aug 21, 2017

@nulll-pointer

This comment has been minimized.

Contributor

nulll-pointer commented Mar 3, 2018

The MySQL Reference Manual says:
The CHECK clause is parsed but ignored by all storage engines.

Triggers should be used instead of check constraint.

@Gemorroj

This comment has been minimized.

@nulll-pointer

This comment has been minimized.

Contributor

nulll-pointer commented Mar 3, 2018

It's ignored in my version of mariaDB
check
Have you tried implementing?

@Gemorroj

This comment has been minimized.

Contributor

Gemorroj commented Mar 3, 2018

@nulll-pointer you use mariadb 10.1.30, but support check constraints added in 10.2.1 version.

@ibennetch

This comment has been minimized.

Member

ibennetch commented Mar 3, 2018

@nulll-pointer according to the documentation link posted by Gemorroj, your MariaDB is too old. MySQL ignoring it doesn't mean we shouldn't implement it for MariaDB.

@ibennetch

This comment has been minimized.

Member

ibennetch commented Apr 13, 2018

I see this as a three-part issue:

  • Update parser to understand this syntax
  • Update the export interface to allow including these in an export
  • Implement an interface for interacting with these constraints
@maherbo

This comment has been minimized.

maherbo commented Jun 11, 2018

Using version 4.7.4, this is more than enhancement, it is a bug.

Right now, you can add the CHECK constraint with a custom SQL statement. Even though the parser indicates a syntax error, it works.

But, when you try to export the table, the CHECK constraint is unrecognized and is ignored in the CREATE TABLE statement ... but so are ALL columns definitions afterward. That is a bug.

@nulll-pointer nulll-pointer referenced this issue Jul 11, 2018

Open

Add Support for CHECK Constraints #14479

0 of 4 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment