Bug #5703 Alter table failure with strange error message
Submitted: 22 Sep 2004 14:53 Modified: 28 Sep 2004 13:08
Reporter: Tomas Ulin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:4.1.5 source OS:Linux (linux 2.6)
Assigned to: Martin Skold CPU Architecture:Any

[22 Sep 2004 14:53] Tomas Ulin
Description:
alter table with several connections and auto increment fails with strange error message

bash-2.05b$ mysqltest -D test < t/ndb_my2_test.test
mysqltest: At line 16: query 'alter table t1 drop column to_be_deleted' failed: 1296: Got error 4350 'Transaction already aborted' from ndbcluster

How to repeat:

t/ndb_my2_test.test
(note that the insert below has to be there with a NULL in the second argument to cause failure)

-- source include/have_ndb.inc

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

create table t1 (
col1 int not null auto_increment primary key,
to_be_deleted int)  ENGINE=ndbcluster;

SET SQL_MODE=NO_AUTO_VALUE_ON_ZERO;
insert into t1 values (0,7),(NULL,7);

connect (con1,localhost,,,test);

alter table t1 drop column to_be_deleted;
[26 Sep 2004 9:37] Martin Skold
This seems to be several bugs.
The one related to alter table directly is 
a general bug. When tables are copied
as part of alter table the NO_AUTO_VALUE_ON_ZERO
always have to be set. After the table copy is
finished the SQL_MODE should be set to
whatever it was before. This bug gives incorrect
behaviour (duplicate key error) in InnoDB as well.

Another problem occurs after this bug has been
and seems to be related to coordinating  local
table caches for Ndb API and Ndb DICT in 
different connections. This is hopefully fixed in
a pending patch from Magnus.
[28 Sep 2004 13:07] Martin Skold
Pushed a fix for the above problem in 4.1_ndb and the problem is now
gone.
[28 Sep 2004 13:08] Martin Skold
Added test case in ndb_alter_table