Bug #5872 ALTER TABLE with blob from ndb table to myisam fails
Submitted: 4 Oct 2004 7:26 Modified: 4 Oct 2004 12:06
Reporter: Tomas Ulin Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S1 (Critical)
Version:4.1.6 source OS:Linux (linux)
Assigned to: Tomas Ulin CPU Architecture:Any

[4 Oct 2004 7:26] Tomas Ulin
Description:
ALTER TABLE with blob from ndb table to myisam fails:

Note, this is only the case if the blob content is "long".  It works fine with e.g.  just 'AAAA' in the insert below.

the final drop of the ndb table will fail since it has a unfinished transaction ongoing:
DBTC: [ H'0x00000007 H'0x00100400] Time-out in state = CS_STARTED apiConnectptr.i = 32 - exec: 0 - place: 3571
DBTC: [ H'0x00000007 H'0x00100400] Time-out in state = CS_STARTED apiConnectptr.i = 32 - exec: 0 - place: 3571

however according to debug printout it has been closed from mysqld:

T@245776: ha_ndbcluster.cc:  2318: | | | | | >rnd_end
T@245776: ha_ndbcluster.cc:  2319: | | | | | <rnd_end
T@245776: ha_ndbcluster.cc:  2291: | | | | | >close_scan
T@245776:        Ndb.cpp:   471: | | | | | | >Ndb::closeTransaction
T@245776:        Ndb.cpp:   490: | | | | | | | info: close trans= 0x8ce2280, transid= 0x10040000000007
T@245776:        Ndb.cpp:   547: | | | | | | <Ndb::closeTransaction
T@245776: ha_ndbcluster.cc:  2313: | | | | | <close_scan
T@245776:    sql_base.cc:   245: | | | | | >free_io_cache
T@245776:    sql_base.cc:   252: | | | | | <free_io_cache

How to repeat:
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
  a int,
  b text,
  PRIMARY KEY  (a)
) ENGINE=ndb DEFAULT CHARSET=latin1;
 
INSERT INTO t1 VALUES 
(1,'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA');

select * from t1 order by a\G
alter table t1 engine=myisam;
[4 Oct 2004 12:06] Tomas Ulin
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html