Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-15251

Error message should show altered table name for failing check constraint

    XMLWordPrintable

Details

    Description

      When a check constraint is added to a table where existing data violates the constraint, the resulting error message includes the table name of the temporary table created by alter, instead of the name of the altered table.

      MariaDB [test]> create table t1 (id int);
      Query OK, 0 rows affected (0.010 sec)
       
      MariaDB [test]> insert into t1 values (1),(10);
      Query OK, 2 rows affected (0.001 sec)
      Records: 2  Duplicates: 0  Warnings: 0
       
      MariaDB [test]> alter table t1 add constraint chk_id check (id<10);
      ERROR 4025 (23000): CONSTRAINT `chk_id` failed for `test`.`#sql-51e_1d`
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            ralf.gebhardt Ralf Gebhardt
            Votes:
            0 Vote for this issue
            Watchers:
            4 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.