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

Online alter ignores check constraint violation

Details

    Description

      --source include/have_debug_sync.inc
       
      create table t (a int);
      insert into t values (1),(2);
      --send
        set debug_sync= 'now wait_for downgraded';
       
      --connect (con_alter,localhost,root,,test)
      set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
      --send
        alter table t add check (a<10), algorithm=copy, lock=none;
       
      --connection default
      --reap
      insert into t values (11),(12);
      set debug_sync= 'now signal goforit';
       
      --connection con_alter
      --reap
      show create table t;
      select * from t;
       
      # Cleanup
      drop table t;
      set debug_sync= reset;
      

      bb-10.10-MDEV-16329 49ad87590

      connection con_alter;
      show create table t;
      Table	Create Table
      t	CREATE TABLE `t` (
        `a` int(11) DEFAULT NULL,
        CONSTRAINT `CONSTRAINT_1` CHECK (`a` < 10)
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1
      select * from t;
      a
      1
      2
      11
      12
      

      Either INSERT or ALTER should fail.

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova created issue -
            elenst Elena Stepanova made changes -
            Field Original Value New Value
            elenst Elena Stepanova made changes -
            Description {code:sql}
            --source include/have_debug_sync.inc

            create table t (a int);
            insert into t values (1),(2);
            --send
              set debug_sync= 'now wait_for downgraded';

            --connect (con_alter,localhost,root,,test)
            set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
            --send
              alter table t add check (a<10), algorithm=copy, lock=none;

            --connection default
            --reap
            insert into t values (11),(12);
            set debug_sync= 'now signal goforit';

            --connection con_alter
            --reap
            show create table t;
            select * from t;

            # Cleanup
            drop table t;
            set debug_sync= reset;
            {code}

            {code:sql|title=bb-10.10-MDEV-16329 49ad87590}
            connection con_alter;
            show create table t;
            Table Create Table
            t CREATE TABLE `t` (
              `a` int(11) DEFAULT NULL,
              CONSTRAINT `CONSTRAINT_1` CHECK (`a` < 10)
            ) ENGINE=MyISAM DEFAULT CHARSET=latin1
            select * from t;
            a
            1
            2
            11
            12
            {code}
            {code:sql}
            --source include/have_debug_sync.inc

            create table t (a int);
            insert into t values (1),(2);
            --send
              set debug_sync= 'now wait_for downgraded';

            --connect (con_alter,localhost,root,,test)
            set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
            --send
              alter table t add check (a<10), algorithm=copy, lock=none;

            --connection default
            --reap
            insert into t values (11),(12);
            set debug_sync= 'now signal goforit';

            --connection con_alter
            --reap
            show create table t;
            select * from t;

            # Cleanup
            drop table t;
            set debug_sync= reset;
            {code}

            {code:sql|title=bb-10.10-MDEV-16329 49ad87590}
            connection con_alter;
            show create table t;
            Table Create Table
            t CREATE TABLE `t` (
              `a` int(11) DEFAULT NULL,
              CONSTRAINT `CONSTRAINT_1` CHECK (`a` < 10)
            ) ENGINE=MyISAM DEFAULT CHARSET=latin1
            select * from t;
            a
            1
            2
            11
            12
            {code}

            Either INSERT or ALTER should fail.
            serg Sergei Golubchik made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            serg Sergei Golubchik made changes -
            Status In Progress [ 3 ] In Testing [ 10301 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 10.11 [ 27614 ]
            Fix Version/s 10.10 [ 27530 ]
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            Fix Version/s 10.12 [ 28320 ]
            Fix Version/s 10.11 [ 27614 ]
            ralf.gebhardt Ralf Gebhardt made changes -
            Fix Version/s 11.1 [ 28549 ]
            Fix Version/s 11.0 [ 28320 ]
            serg Sergei Golubchik made changes -
            Fix Version/s N/A [ 14700 ]
            Fix Version/s 11.1 [ 28549 ]
            Resolution Fixed [ 1 ]
            Status In Testing [ 10301 ] Closed [ 6 ]
            elenst Elena Stepanova made changes -
            serg Sergei Golubchik made changes -
            Fix Version/s 11.2.1 [ 29034 ]
            Fix Version/s N/A [ 14700 ]

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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