Bug #20902 Alter table invalid schema version with statement-based binlogging
Submitted: 7 Jul 2006 12:33 Modified: 8 Jul 2006 17:24
Reporter: Kristian Nielsen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S1 (Critical)
Version:5.1.12 OS:Linux (Linux)
Assigned to: Tomas Ulin CPU Architecture:Any

[7 Jul 2006 12:33] Kristian Nielsen
Description:
The test case ndb_alter_table3 fails when run in statement-based binlogging mode:

$ ./mysql-test-run.pl --mysqld=--binlog-format=statement ndb_alter_table3
ndb_alter_table3               [ fail ]

Errors are (from /dev/shm/v4/log/mysqltest-time) :
mysqltest: At line 21: query 'select * from t1 where c = 'two'' failed: 1412: Table definition has changed, please retry transaction

It does not fail in row-based binlogging mode, ie. either with --mysqld=--binlog-format=statement or with no --mysqld option.

Until this is fixed, I will push a change to the test to include

    -- source include/have_binlog_format_row.inc

to keep this test disabled in statement-based replication mode until the bug is fixed. Please remember to remove this statement again from the test case as part of fixing this bug.

How to repeat:
First, remove this statement at the top of mysql-test/t/ndb_alter_table3.test:

    -- source include/have_binlog_format_row.inc

Then run the test as follows:

    ./mysql-test-run.pl --mysqld=--binlog-format=statement ndb_alter_table3
[7 Jul 2006 12:46] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/8906
[7 Jul 2006 15:23] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/8917
[7 Jul 2006 15:29] Kristian Nielsen
The same problem seems to occur in test cases ndb_autodiscover3, ndb_dd_advance, and ndb_multi.

I will push a change to disable all four tests in statement-based binlogging mode. As part of the fix of this bug, that change must be removed from all of the following tests:

    ndb_alter_table3
    ndb_autodiscover3
    ndb_dd_advance
    ndb_multi
[7 Jul 2006 19:02] Tomas Ulin
mysqld1:
create table t1 (a int key) engine=ndb;

mysqld2:
select * from t1;

mysqld1:
alter table t1 add column b int;

mysqld2:
select * from t1;
ERROR 1412 (HY000): Table definition has changed, please retry transaction
select * from t1;
Empty set (0.01 sec)

this is consistant with 5.0, but we plan to remove this error from happening, and thus avoiding having to retry in 5.1
[7 Jul 2006 23:36] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/8945