use mysql; --disable_warnings drop table if exists t1, t1_part1, t1_part2; --enable_warnings create table t1_part1 ( a int primary key, b varchar(30) ) ENGINE = MYISAM ; create table t1_part2 ( a int primary key, b varchar(30) ) ENGINE = MYISAM ; create table t1 ( a int primary key, b varchar(30), index(a) ) ENGINE = MERGE UNION=(t1_part1,t1_part2) INSERT_METHOD=LAST; commit ; insert into t1 values(6, 'six' ); # the second insert fails, because the first column is primary key --error 1022 insert into t1 values(6, NULL ); select a,b from t1 ; Select "###### the insert should not fail !!! #####" as my_col ; Select "please remove the '--error 1022' line" as my_col ; --error 1022 insert into t1 set a=6, b='sechs' on duplicate key update a=a + 1, b='modified' ; select a,b from t1 ;