Bug #5072 ALTER TABLE and BLOB columns
Submitted: 17 Aug 2004 13:33 Modified: 20 Aug 2004 14:16
Reporter: Magnus Blåudd Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S2 (Serious)
Version:mysql 4.1 bk OS:
Assigned to: Martin Skold CPU Architecture:Any

[17 Aug 2004 13:33] Magnus Blåudd
Description:
It's not possible to insert records in a table with blobs that has been ALTERed(probably needs to be from another engine).

How to repeat:
Hi,

I don't know if it is a bug, but it shows on different behavior compared 
to how blobs work in innodb and myisam, compared to how they work in ndb.

This works:

mysql> create table t5(a integer primary key auto_increment, b blob) 
engine=ndb;

mysql> insert into t5(b) values("ee");
Query OK, 1 row affected (0.00 sec)

mysql> insert into t5(b) values("ee");
Query OK, 1 row affected (0.00 sec)

mysql> insert into t5(b) values("ee");
Query OK, 1 row affected (0.00 sec)

mysql> select * from t5;
+---+------+
| a | b    |
+---+------+
| 2 | ee   |
| 1 | ee   |
| 0 | ee   |

But:

Created an innodb table with a blob column.
Alter the table to ndb, but I can't insert data any data into the table.

mysql> create table t6(a integer primary key auto_increment, b blob) 
engine=innodb;
Query OK, 0 rows affected (0.09 sec)

mysql> insert into t6(b) values("ee");
Query OK, 1 row affected (0.02 sec)

mysql> insert into t6(b) values("ee");
Query OK, 1 row affected (0.02 sec)

mysql> alter table t6 type=ndb;
Query OK, 2 rows affected, 1 warning (1.15 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> insert into t6(b) values("ee");
ERROR 1296 (HY000): Got error 4263 'Invalid blob attributes or invalid 
blob parts table' from ndbcluster
mysql> create table t5(a integer primary key auto_increment, b blob) 
engine=ndb;

Suggested fix:
I guess the blob tables are not created/renamed correctly during the ALTER TABLE command.
[20 Aug 2004 11:40] Martin Skold
Not related to the specific alter table:

alter table t5 add c int;
select * from t5;
ERROR 1296 (HY000): Got error 4263 'Invalid blob attributes or invalid blob parts table' from ndbcluster

It is probably the table rename part of alter table that is not
working for tables with BLOBs, some meta-data is probably
not copied correctly.
If I skip selecting the BLOB column everything works.
Also accessing tables directly (ndb_select_all) seems to work fine!
[20 Aug 2004 12:02] Martin Skold
The BLOB tables are also not dropped after the
drop table part of alter table.
[20 Aug 2004 13:33] Martin Skold
The problem was that the BLOB tables are identified
with table id, version, and column id. The version is
incremented ate alter table (at table rename) and
the BLOB table cannot be found.
Just removed version form BLOB table name.