Description:
Useing 5.1.20 on a mysql-cluster setup with a replication from 2 api's to 2 individual slave's
NDB.1 NDB.2
API.1 API.2
Slave.1 Slave.2
Doing a update on on of the API's (which are the masters for the 2 slaves) will update the record right on the masters, but will update wrongly on the slaves; updating only the field specified by update BUT will change the none specified fields to there default values!!!
How to repeat:
On API.1;
CREATE TABLE `t1` (
`id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`field1` VARCHAR( 32 ) NOT NULL DEFAULT 'field1',
`field2` MEDIUMINT( 5 ) NOT NULL DEFAULT '13' ,
`field3` SMALLINT( 3 ) NOT NULL DEFAULT '0'
) ENGINE = NDBCLUSTER;
INSERT INTO t1 VALUES (NULL,'',52,52);
INSERT INTO t1 VALUES (NULL,'',52,52);
INSERT INTO t1 VALUES (NULL,'',52,52);
SELECT * FROM t1;
+----+--------+--------+--------+
| id | field1 | field2 | field3 |
+----+--------+--------+--------+
| 1 | | 51 | 51 |
| 2 | | 52 | 52 |
| 3 | | 53 | 53 |
+----+--------+--------+--------+
On Slave.1 (or Slave.2)
SELECT * FROM t1;
+----+--------+--------+--------+
| id | field1 | field2 | field3 |
+----+--------+--------+--------+
| 1 | | 51 | 51 |
| 2 | | 52 | 52 |
| 3 | | 53 | 53 |
+----+--------+--------+--------+
Back on the master again (API.1)
mysql> update t1 set field1 = NULL where id = 3;
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 1
mysql> show warnings;
+---------+------+--------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------+
| Warning | 1048 | Column 'field1' cannot be null |
+---------+------+--------------------------------+
1 row in set (0.00 sec)
mysql> select * from t1;
+----+--------+--------+--------+
| id | field1 | field2 | field3 |
+----+--------+--------+--------+
| 1 | | 51 | 51 |
| 2 | | 52 | 52 |
| 3 | | 53 | 53 |
+----+--------+--------+--------+
3 rows in set (0.00 sec)
On one of the slaves;
mysql> SELECT * FROM t1;
+----+--------+--------+--------+
| id | field1 | field2 | field3 |
+----+--------+--------+--------+
| 1 | | 51 | 51 |
| 2 | | 52 | 52 |
| 3 | | 13 | 0 |
+----+--------+--------+--------+
And again;
Master(API.2)
UPDATE t1 SET field1 = 'test' WHERE id = 1;
Slave
mysql> SELECT * FROM t1;
+----+--------+--------+--------+
| id | field1 | field2 | field3 |
+----+--------+--------+--------+
| 1 | test | 13 | 0 |
| 2 | | 52 | 52 |
| 3 | | 13 | 0 |
+----+--------+--------+--------+
Description: Useing 5.1.20 on a mysql-cluster setup with a replication from 2 api's to 2 individual slave's NDB.1 NDB.2 API.1 API.2 Slave.1 Slave.2 Doing a update on on of the API's (which are the masters for the 2 slaves) will update the record right on the masters, but will update wrongly on the slaves; updating only the field specified by update BUT will change the none specified fields to there default values!!! How to repeat: On API.1; CREATE TABLE `t1` ( `id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY , `field1` VARCHAR( 32 ) NOT NULL DEFAULT 'field1', `field2` MEDIUMINT( 5 ) NOT NULL DEFAULT '13' , `field3` SMALLINT( 3 ) NOT NULL DEFAULT '0' ) ENGINE = NDBCLUSTER; INSERT INTO t1 VALUES (NULL,'',52,52); INSERT INTO t1 VALUES (NULL,'',52,52); INSERT INTO t1 VALUES (NULL,'',52,52); SELECT * FROM t1; +----+--------+--------+--------+ | id | field1 | field2 | field3 | +----+--------+--------+--------+ | 1 | | 51 | 51 | | 2 | | 52 | 52 | | 3 | | 53 | 53 | +----+--------+--------+--------+ On Slave.1 (or Slave.2) SELECT * FROM t1; +----+--------+--------+--------+ | id | field1 | field2 | field3 | +----+--------+--------+--------+ | 1 | | 51 | 51 | | 2 | | 52 | 52 | | 3 | | 53 | 53 | +----+--------+--------+--------+ Back on the master again (API.1) mysql> update t1 set field1 = NULL where id = 3; Query OK, 1 row affected, 1 warning (0.00 sec) Rows matched: 1 Changed: 1 Warnings: 1 mysql> show warnings; +---------+------+--------------------------------+ | Level | Code | Message | +---------+------+--------------------------------+ | Warning | 1048 | Column 'field1' cannot be null | +---------+------+--------------------------------+ 1 row in set (0.00 sec) mysql> select * from t1; +----+--------+--------+--------+ | id | field1 | field2 | field3 | +----+--------+--------+--------+ | 1 | | 51 | 51 | | 2 | | 52 | 52 | | 3 | | 53 | 53 | +----+--------+--------+--------+ 3 rows in set (0.00 sec) On one of the slaves; mysql> SELECT * FROM t1; +----+--------+--------+--------+ | id | field1 | field2 | field3 | +----+--------+--------+--------+ | 1 | | 51 | 51 | | 2 | | 52 | 52 | | 3 | | 13 | 0 | +----+--------+--------+--------+ And again; Master(API.2) UPDATE t1 SET field1 = 'test' WHERE id = 1; Slave mysql> SELECT * FROM t1; +----+--------+--------+--------+ | id | field1 | field2 | field3 | +----+--------+--------+--------+ | 1 | test | 13 | 0 | | 2 | | 52 | 52 | | 3 | | 13 | 0 | +----+--------+--------+--------+