mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 06:44:16 +01:00
537c23e833
This patch adds the ability to store extra field metadata in the table map event. This data can include pack_length() or field_lenght() for fields such as CHAR or VARCHAR enabling developers to add code that can check for compatibilty between master and slave columns. More importantly, the extra field metadata can be used to store data from the master correctly should a VARCHAR field on the master be <= 255 bytes while the same field on the slave is > 255 bytes. The patch also includes the needed changes to unpack to ensure that data which is smaller on the master can be unpacked correctly on the slave. WL#3915 : (NDB) master's cols > slave Slave starts accepting and handling rows of master's tables which have more columns. The most important part of implementation is how to caclulate the amount of bytes to skip for unknown by slave column.
758 lines
24 KiB
Text
758 lines
24 KiB
Text
stop slave;
|
||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||
reset master;
|
||
reset slave;
|
||
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
|
||
start slave;
|
||
set binlog_format=row;
|
||
CREATE TABLE t1 (f1 INT, f2 INT, f3 INT PRIMARY KEY, f4 CHAR(20),
|
||
/* extra */
|
||
f5 FLOAT DEFAULT '2.00',
|
||
f6 CHAR(4) DEFAULT 'TEST',
|
||
f7 INT DEFAULT '0',
|
||
f8 TEXT,
|
||
f9 LONGBLOB,
|
||
f10 BIT(63),
|
||
f11 VARBINARY(64))
|
||
ENGINE='InnoDB';
|
||
alter table t1 drop f5, drop f6, drop f7, drop f8, drop f9, drop f10, drop f11;
|
||
INSERT into t1 values (1, 1, 1, 'first', 1.0, 'yksi', 1, 'lounge of happiness', 'very fat blob', b'01010101010101', 0x123456);
|
||
INSERT into t1 values (2, 2, 2, 'second', 2.0, 'kaks', 2, 'got stolen from the paradise', 'very fat blob', b'01010101010101', 0x123456), (3, 3, 3, 'third', 3.0, 'kolm', 3, 'got stolen from the paradise', 'very fat blob', b'01010101010101', 0x123456);
|
||
update t1 set f4= 'next' where f1=1;
|
||
delete from t1 where f1=1;
|
||
select * from t1 order by f3;
|
||
f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11
|
||
2 2 2 second 2 kaks 2 got stolen from the paradise very fat blob |