Details

    Description

      CREATE TABLE t (
      path VARCHAR(100) NOT NULL COLLATE 'utf8_general_ci',
      json_c1 JSON NOT NULL DEFAULT '' COLLATE 'utf8mb4_bin',
      json_c2 JSON NOT NULL DEFAULT '' COLLATE 'utf8mb4_bin',
      comment VARCHAR(100) NULL DEFAULT NULL COLLATE 'utf8_general_ci',
      UNIQUE INDEX path (path),
      CONSTRAINT json_c1 CHECK (path > 0)
      )
      ;
      select * from information_schema.check_constraints where table_name='t';
      

      another example

      create table t (a int check (a>2), constraint a check (a < 5));
      select * from information_schema.check_constraints where table_name='t';
      

      Attachments

        Issue Links

          Activity

            Hi,
            MDEV-16630 distinguished between field and table check constraints based on inserts.
            Since I_S.check_constraints is used just for printing from tables->table->check_constraints, how we should approach to this?
            To raise the error when selecting from I_S.check_constraints in case there are duplicate check constraints?

            anel Anel Husakovic added a comment - Hi, MDEV-16630 distinguished between field and table check constraints based on inserts. Since I_S.check_constraints is used just for printing from tables->table->check_constraints , how we should approach to this? To raise the error when selecting from I_S.check_constraints in case there are duplicate check constraints?

            Well, MDEV-16630 was fixed incorrectly and should be reverted.
            Constraint names must be unique within a table.
            CREATE or ALTER TABLE must fail with two constraints happen to have the same name.

            Otherwise how would you interpret, for example, ALTER TABLE t1 DROP CONSTRAINT b ?

            serg Sergei Golubchik added a comment - Well, MDEV-16630 was fixed incorrectly and should be reverted. Constraint names must be unique within a table. CREATE or ALTER TABLE must fail with two constraints happen to have the same name. Otherwise how would you interpret, for example, ALTER TABLE t1 DROP CONSTRAINT b ?

            Make sense I understand now.
            Started working on MDEV-24598, MDEV-24601, MDEV-24602.

            anel Anel Husakovic added a comment - Make sense I understand now. Started working on MDEV-24598 , MDEV-24601 , MDEV-24602 .

            Related to the PR 2773

            anel Anel Husakovic added a comment - Related to the PR 2773
            anel Anel Husakovic added a comment - - edited Added commit ffd3ae247c9 as part of PR 2773. Rebased on 10.5 https://github.com/an3l/server/commits/bb-10.5-anel-MDEV-24602-field-constraint-v5/

            People

              serg Sergei Golubchik
              serg Sergei Golubchik
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.