Menu

#836 Add check constraints

Git
closed-fixed
nobody
None
5
2025-02-22
2022-04-05
Marc
No

https://mariadb.com/kb/en/constraint/
https://dev.mysql.com/doc/refman/8.0/en/create-table-check-constraints.html

It would be great to see, and/or change constraints on a table to prevent given constraints on table changes.

Discussion

  • Marc

    Marc - 2022-10-29

    The last part just meant to say: if you have already defined a constraint and edit the table with adminer, the constraint is not preserved. This is the major bug.
    Editing the constraint would be nice, but is not as essential, as to prevent a given constraint.

     
  • J Koop

    J Koop - 2022-10-31

    I tried every combination of rename the table, rename a column, add a column, remove a column, alter a foreign key, alter a foreign key's target, and I couldn't get it to accidentally drop my check constraint.

    Perhaps your MySQL/MariaDB server is an old version or something?

    mysql> SHOW VARIABLES LIKE "%version%";
    +-----------------------------------+------------------------------------------+
    | Variable_name                     | Value                                    |
    +-----------------------------------+------------------------------------------+
    | in_predicate_conversion_threshold | 1000                                     |
    | innodb_version                    | 10.9.3                                   |
    | protocol_version                  | 10                                       |
    | slave_type_conversions            |                                          |
    | system_versioning_alter_history   | ERROR                                    |
    | system_versioning_asof            | DEFAULT                                  |
    | tls_version                       | TLSv1.1,TLSv1.2,TLSv1.3                  |
    | version                           | 10.9.3-MariaDB-1:10.9.3+maria~ubu2204    |
    | version_comment                   | mariadb.org binary distribution          |
    | version_compile_machine           | x86_64                                   |
    | version_compile_os                | debian-linux-gnu                         |
    | version_malloc_library            | system                                   |
    | version_source_revision           | 50c6090107d582a39e5be018c9fb4f40202210f9 |
    | version_ssl_library               | OpenSSL 3.0.2 15 Mar 2022                |
    | wsrep_patch_version               | wsrep_26.22                              |
    +-----------------------------------+------------------------------------------+
    15 rows in set (0.00 sec)
    
     
  • Marc

    Marc - 2022-10-31

    I'm sorry. You're right. Maybe I mixed sth. up.

     
  • Marc

    Marc - 2022-10-31

    At least it would be nice, to see on table page, that a constraint is defined on that table. IÄm not sure, if you added this with your commit.

     
  • J Koop

    J Koop - 2022-10-31

    Yeah, I did that.

     
  • Marc

    Marc - 2022-10-31

    Great! Thanks you!

     
  • Jakub Vrána

    Jakub Vrána - 2025-02-22
    • status: open --> closed-fixed
     
  • Jakub Vrána

    Jakub Vrána - 2025-02-22

    Fixed by 550289de.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.