[MDEV-29067] Online alter ignores check constraint violation Created: 2022-07-08  Updated: 2023-08-16  Resolved: 2023-03-29

Status: Closed
Project: MariaDB Server
Component/s: Data Definition - Alter Table
Affects Version/s: N/A
Fix Version/s: 11.2.1

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
is caused by MDEV-16329 Engine-independent online ALTER TABLE Closed
Relates
relates to MDEV-28808 Test MDEV-16329 (ALTER ONLINE TABLE) ... Stalled

 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.


Generated at Thu Feb 08 10:05:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.