List:Commits« Previous MessageNext Message »
From:Mats Kindahl Date:October 5 2007 5:51pm
Subject:Re: bk commit into 5.1 tree (mats:1.2571) BUG#29549
View as plain text  
Andrei Elkin wrote:
> Mats, hi.
>
> Thanks for the newer cset addressing a part of my questions. 
> Here is my second parsing as I promised.
>
> There is one item of a concern, please read on.
>   

I have fixed the items you commented on below as I describe.

Just my few cents,
Mats Kindahl

>   
>> Below is the list of changes that have just been committed into a local
>> 5.1 repository of mats. When mats does a push these changes will
>> be propagated to the main repository and, within 24 hours after the
>> push, to the public repository.
>> For information on how to access the public repository
>> see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
>>
>> ChangeSet@stripped, 2007-10-04 21:41:18+02:00, mats@stripped +20
> -0
>>   BUG#29549 (Endians: test failures on Solaris):
>>   
>>   Refactoring code to add parameter to pack() and unpack() functions with
>>   purpose of indicating if data should be packed in little-endian or
>>   native order. Using new functions to always pack data for binary log
>>   in little-endian order. The purpose of this refactoring is to allow
>>   proper implementation of endian-agnostic pack() and unpack() functions.
>>   
>>   Eliminating several versions of virtual pack() and unpack() functions
>>   in favor for one single virtual function which is overridden in
>>   subclasses.
>>   
>>   Implementing pack() and unpack() functions for some field types that
>>   packed data in native format regardless of the value of the
>>   st_table_share::db_low_byte_first flag.
>>   
>>   The field types that were packed in native format regardless are:
>>   Field_real, Field_decimal, Field_tiny, Field_short, Field_medium,
>>   Field_long, and Field_longlong.
>>     
>
> How abote Field_blob? You confirmed on #irc it's in the list.
> Could you please add it?
>
>   
>>   
>>   Before the patch, row-based logging wrote the rows incorrectly on
>>   big-endian machines where the storage engine defined its own
>>   low_byte_first() to be FALSE on big-endian machines (the default
>>   is TRUE), while little-endian machines wrote the fields in correct
>>   order. The only known storage engine that does this is NDB. In effect,
>>   this means that row-based replication from or to a big-endian
>>   machine where the table was using NDB as storage engine failed if the
>>   other engine was either non-NDB or on a little-endian machine.
>>   
>>   With this patch, row-based logging is now always done in little-endian
>>   order, while ORDER BY uses the native order if the storage engine
>>   defines low_byte_first() to return FALSE for big-endian machines.
>>
>>   mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test@stripped, 2007-10-04
> 21:41:09+02:00, mats@stripped +1 -1
>>     Sorting by columns that produces deterministic order.
>>
>>   mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result@stripped, 2007-10-04
> 21:41:09+02:00, mats@stripped +2 -2
>>     Result change.
>>
>>   mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result@stripped, 2007-10-04
> 21:41:10+02:00, mats@stripped +2 -2
>>     Result change.
>>
>>   mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result@stripped, 2007-10-04
> 21:41:10+02:00, mats@stripped +3 -3
>>     Result change.
>>
>>   mysql-test/suite/rpl/t/disabled.def@stripped, 2007-10-04 21:41:10+02:00,
> mats@stripped +0 -1
>>     Enabling tests.
>>
>>   mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test@stripped, 2007-10-04 21:41:10+02:00,
> mats@stripped +1 -0
>>     Adding missing sync_slave_with_master causing slave to keep tables
>>     after shutdown.
>>
>>   mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result@stripped, 2007-10-04
> 21:41:13+02:00, mats@stripped +855 -0
>>     New BitKeeper file ``mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result''
>>
>>   mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result@stripped, 2007-10-04
> 21:41:13+02:00, mats@stripped +0 -0
>>
>>   mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result@stripped, 2007-10-04
> 21:41:14+02:00, mats@stripped +855 -0
>>     New BitKeeper file ``mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result''
>>
>>   mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result@stripped, 2007-10-04
> 21:41:14+02:00, mats@stripped +0 -0
>>
>>   mysql-test/suite/rpl_ndb/t/disabled.def@stripped, 2007-10-04 21:41:10+02:00,
> mats@stripped +0 -2
>>     Enabling tests.
>>
>>   mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt@stripped, 2007-10-04
> 21:41:11+02:00, mats@stripped +1 -1
>>     Adding --new option
>>
>>   mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test@stripped, 2007-10-04
> 21:41:11+02:00, mats@stripped +6 -4
>>     Adding have_log_bin.
>>
>>   mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt@stripped, 2007-10-04
> 21:41:11+02:00, mats@stripped +1 -1
>>     Adding --new option
>>
>>   mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test@stripped, 2007-10-04
> 21:41:11+02:00, mats@stripped +5 -2
>>     Adding have_log_bin
>>
>>   mysql-test/t/partition.test@stripped, 2007-10-04 21:41:11+02:00,
> mats@stripped +2 -1
>>     Adding have_archive, since that is used in the test.
>>
>>   sql/field.cc@stripped, 2007-10-04 21:41:12+02:00, mats@stripped
> +251 -141
>>     Eliminating all two-argument pack() and unpack() functions and moving
>>     functionality into the four-argument version. The four argument version
>>     is introduced so that it is possible to avoid using the storage engine
>>     default when writing and reading the packed format (the unpacked format
>>     still uses the storage engine's default). This is used by row-based
>>     replication to write the fields in a storage engine- and endian-agnostic
>>     format.
>>     
>>     Packing integral and floating-point numbers in little-endian format
>>     (if requested).
>>     
>>     
>
>   
>>     Using pad_char for the field instead of spaces (0x20) when
>>     unpacking.
>>     
>
> Sounds reasonable. However, as it's not a part of the bug description
> I am asking you to explain more verbose.
>
>   
>>     
>>     Adding some Doxygen documentation.
>>
>>   sql/field.h@stripped, 2007-10-04 21:41:12+02:00, mats@stripped
> +193 -39
>>     Eliminating all virtual pack() and unpack() functions except the four-
>>     argument version, which now is the function that shall be overridden.
>>     The two-argument versions are convenience functions, to prevent changes
>>     to code that uses these.
>>     
>>     Adding code to pack integer numbers and floating-point numbers in
>>     little-endian format, if requested.
>>
>>   sql/log.cc@stripped, 2007-10-04 21:41:12+02:00, mats@stripped
> +0 -3
>>     Removing debug printout causing crash when starting NDB on Solaris.
>>
>>   sql/log_event.cc@stripped, 2007-10-04 21:41:13+02:00,
> mats@stripped +4 -0
>>     Adding missing #ifndef causing compile failure. Adding debug printouts.
>>
>>   sql/rpl_record.cc@stripped, 2007-10-04 21:41:13+02:00,
> mats@stripped +16 -32
>>     Debriding code. Using new pack() and unpack() functions to always pack
>>     fields little-endian. Adding debug printouts.
>>
>>   sql/sql_show.cc@stripped, 2007-10-04 21:41:13+02:00,
> mats@stripped +4 -2
>>     Adding code that causes crash on Solaris machines since printf() cannot
>>     handle NULL values for strings properly.
>>
>> diff -Nrup a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
> b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test
>> --- a/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test	2007-07-30 17:58:49
> +02:00
>> +++ b/mysql-test/extra/rpl_tests/rpl_extraMaster_Col.test	2007-10-04 21:41:09
> +02:00
>> @@ -466,7 +466,7 @@ binary data';
>>     select * from t2 order by f1;
>>     select * from t3 order by f1;
>>     select * from t4 order by f1;
>> -   select * from t31 order by f1;
>> +   select * from t31 order by f3;
>>     
>>  connection master;
>>  
>> diff -Nrup a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
> b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result
>> --- a/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result	2007-07-30 17:58:50
> +02:00
>> +++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_innodb.result	2007-10-04 21:41:09
> +02:00
>> @@ -623,7 +623,7 @@ f1	f2	f3	f4
>>  select * from t4 order by f1;
>>  f1	f2	f3	f4
>>  1	1	1	first
>> -select * from t31 order by f1;
>> +select * from t31 order by f3;
>>  f1	f2	f3	f4
>>  1	1	1	first
>>  1	1	2	second
>> @@ -1302,7 +1302,7 @@ f1	f2	f3	f4
>>  select * from t4 order by f1;
>>  f1	f2	f3	f4
>>  1	1	1	first
>> -select * from t31 order by f1;
>> +select * from t31 order by f3;
>>  f1	f2	f3	f4
>>  1	1	1	first
>>  1	1	2	second
>> diff -Nrup a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
> b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result
>> --- a/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result	2007-07-30 17:58:51
> +02:00
>> +++ b/mysql-test/suite/rpl/r/rpl_extraColmaster_myisam.result	2007-10-04 21:41:10
> +02:00
>> @@ -623,7 +623,7 @@ f1	f2	f3	f4
>>  select * from t4 order by f1;
>>  f1	f2	f3	f4
>>  1	1	1	first
>> -select * from t31 order by f1;
>> +select * from t31 order by f3;
>>  f1	f2	f3	f4
>>  1	1	1	first
>>  1	1	2	second
>> @@ -1302,7 +1302,7 @@ f1	f2	f3	f4
>>  select * from t4 order by f1;
>>  f1	f2	f3	f4
>>  1	1	1	first
>> -select * from t31 order by f1;
>> +select * from t31 order by f3;
>>  f1	f2	f3	f4
>>  1	1	1	first
>>  1	1	2	second
>> diff -Nrup a/mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result
> b/mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result
>> --- a/mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result	2007-07-30
> 17:58:51 +02:00
>> +++ b/mysql-test/suite/rpl/r/rpl_row_extraColmaster_ndb.result	2007-10-04
> 21:41:10 +02:00
>> @@ -622,14 +622,14 @@ f1	f2	f3	f4
>>  select * from t4 order by f1;
>>  f1	f2	f3	f4
>>  1	1	1	first
>> -select * from t31 order by f1;
>> +select * from t31 order by f3;
>>  f1	f2	f3	f4
>> -1	1	5	fifth
>> -1	1	3	third
>>  1	1	1	first
>> -1	1	6	sixth
>>  1	1	2	second
>> +1	1	3	third
>>  1	1	4	fourth
>> +1	1	5	fifth
>> +1	1	6	sixth
>>  update t31 set f5=555555555555555 where f3=6;
>>  update t31 set f2=2 where f3=2;
>>  update t31 set f1=NULL where f3=1;
>> diff -Nrup a/mysql-test/suite/rpl/t/disabled.def
> b/mysql-test/suite/rpl/t/disabled.def
>> --- a/mysql-test/suite/rpl/t/disabled.def	2007-08-02 22:15:43 +02:00
>> +++ b/mysql-test/suite/rpl/t/disabled.def	2007-10-04 21:41:10 +02:00
>> @@ -16,4 +16,3 @@ rpl_innodb_mixed_dml     : Bug #29363 rp
>>  rpl_invoked_features     : BUG#29020 2007-06-21 Lars Non-deterministic test
> case
>>  rpl_auto_increment_11932   : Bug#29809 2007-07-16 ingo Slave SQL errors in
> warnings file
>>  rpl_stm_extraColmaster_ndb : WL#3915 : Statement-based replication not supported
> in ndb. Enable test when supported.
>> -rpl_row_extraColmaster_ndb : BUG#29549 : Replication of BLOBs fail for NDB
>> diff -Nrup a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
> b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
>> --- a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test	2007-06-27 14:27:31 +02:00
>> +++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test	2007-10-04 21:41:10 +02:00
>> @@ -344,5 +344,6 @@ FLUSH LOGS;
>>  --exec rm $MYSQLTEST_VARDIR/tmp/local.sql
>>  
>>  DROP TABLE IF EXISTS t1, t2, t3, t04, t05, t4, t5; 
>> +sync_slave_with_master;
>>  
>>  # End of 4.1 tests
>> diff -Nrup a/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result
> b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result
>> --- /dev/null	Wed Dec 31 16:00:00 196900
>> +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_innodb2ndb.result	2007-10-04 21:41:13
> +02:00
>> @@ -0,0 +1,855 @@
>> +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 storage_engine=innodb;
>> +--- Doing pre test cleanup --- 
>> +DROP TABLE IF EXISTS t1;
>> +--- Start test 1 Basic testing ---
>> +--- Create Table Section ---
>> +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), 
>> +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, 
>> +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, 
>> +y YEAR, t DATE,PRIMARY KEY(id));
>> +--- Show table on master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`)
>> +) ENGINE=InnoDB DEFAULT CHARSET=latin1
>> +--- Show table on slave ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`)
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- Check that simple Alter statements are replicated correctly --
>> +ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
>> +ALTER TABLE t1 MODIFY vc TEXT;
>> +--- Show the new improved table on the master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`,`total`)
>> +) ENGINE=InnoDB DEFAULT CHARSET=latin1
>> +--- Make sure that our tables on slave are still same engine ---
>> +--- and that the alter statements replicated correctly ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`,`total`)
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly --- 
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- End test 1 Basic testing ---
>> +--- Do Cleanup --
>> +DROP TABLE IF EXISTS t1;
>> +--- Start test 2 partition RANGE testing --
>> +--- Do setup --
>> +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), 
>> +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, 
>> +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, 
>> +y YEAR, t DATE)
>> +PARTITION BY RANGE (YEAR(t)) 
>> +(PARTITION p0 VALUES LESS THAN (1901), 
>> +PARTITION p1 VALUES LESS THAN (1946),  
>> +PARTITION p2 VALUES LESS THAN (1966), 
>> +PARTITION p3 VALUES LESS THAN (1986), 
>> +PARTITION p4 VALUES LESS THAN (2005), 
>> +PARTITION p5 VALUES LESS THAN MAXVALUE);
>> +--- Show table on master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL
>> +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t))
> (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN
> (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3
> VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE =
> InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
>> +--- Show table on slave --
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t))
> (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN
> (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
> PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN
> (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster)
> */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- Check that simple Alter statements are replicated correctly ---
>> +ALTER TABLE t1 ADD PRIMARY KEY(t,id);
>> +ALTER TABLE t1 MODIFY vc TEXT;
>> +--- Show the new improved table on the master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date NOT NULL DEFAULT '0000-00-00',
>> +  PRIMARY KEY (`t`,`id`)
>> +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t))
> (PARTITION p0 VALUES LESS THAN (1901) ENGINE = InnoDB, PARTITION p1 VALUES LESS THAN
> (1946) ENGINE = InnoDB, PARTITION p2 VALUES LESS THAN (1966) ENGINE = InnoDB, PARTITION p3
> VALUES LESS THAN (1986) ENGINE = InnoDB, PARTITION p4 VALUES LESS THAN (2005) ENGINE =
> InnoDB, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = InnoDB) */
>> +--- Make sure that our tables on slave are still same engine ---
>> +--- and that the alter statements replicated correctly ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date NOT NULL DEFAULT '0000-00-00',
>> +  PRIMARY KEY (`t`,`id`)
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t))
> (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN
> (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
> PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN
> (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster)
> */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- End test 2 partition RANGE testing ---
>> +--- Do Cleanup ---
>> +DROP TABLE IF EXISTS t1;
>> +--- Start test 3 partition LIST testing ---
>> +--- Do setup ---
>> +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), 
>> +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, 
>> +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, 
>> +y YEAR, t DATE)
>> +PARTITION BY LIST(id) 
>> +(PARTITION p0 VALUES IN (2, 4), 
>> +PARTITION p1 VALUES IN (42, 142));
>> +--- Test 3 Alter to add partition ---
>> +ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412));
>> +--- Show table on master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL
>> +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id)
> (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE =
> InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
>> +--- Show table on slave ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id)
> (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE
> = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- Check that simple Alter statements are replicated correctly ---
>> +ALTER TABLE t1 ADD PRIMARY KEY(id);
>> +ALTER TABLE t1 MODIFY vc TEXT;
>> +--- Show the new improved table on the master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`)
>> +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id)
> (PARTITION p0 VALUES IN (2,4) ENGINE = InnoDB, PARTITION p1 VALUES IN (42,142) ENGINE =
> InnoDB, PARTITION p2 VALUES IN (412) ENGINE = InnoDB) */
>> +--- Make sure that our tables on slave are still same engine ---
>> +--- and that the alter statements replicated correctly ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`)
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id)
> (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE
> = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- End test 3 partition LIST testing ---
>> +--- Do Cleanup --
>> +DROP TABLE IF EXISTS t1;
>> +--- Start test 4 partition HASH testing ---
>> +--- Do setup ---
>> +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), 
>> +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, 
>> +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, 
>> +y YEAR, t DATE)
>> +PARTITION BY HASH( YEAR(t) ) 
>> +PARTITIONS 4;
>> +--- show that tables have been created correctly ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL
>> +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t))
> PARTITIONS 4  */
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t))
> PARTITIONS 4  */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- Check that simple Alter statements are replicated correctly ---
>> +ALTER TABLE t1 ADD PRIMARY KEY(t,id);
>> +ALTER TABLE t1 MODIFY vc TEXT;
>> +--- Show the new improved table on the master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date NOT NULL DEFAULT '0000-00-00',
>> +  PRIMARY KEY (`t`,`id`)
>> +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t))
> PARTITIONS 4  */
>> +--- Make sure that our tables on slave are still same engine ---
>> +--- and that the alter statements replicated correctly ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date NOT NULL DEFAULT '0000-00-00',
>> +  PRIMARY KEY (`t`,`id`)
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t))
> PARTITIONS 4  */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- End test 4 partition HASH testing ---
>> +--- Do Cleanup --
>> +DROP TABLE IF EXISTS t1;
>> +--- Start test 5 partition by key testing ---
>> +--- Create Table Section ---
>> +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), 
>> +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, 
>> +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, 
>> +y YEAR, t DATE,PRIMARY KEY(id))
>> +PARTITION BY KEY() 
>> +PARTITIONS 4;
>> +--- Show that tables on master are ndbcluster tables ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`)
>> +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4
>  */
>> +--- Show that tables on slave ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`)
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY ()
> PARTITIONS 4  */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- Check that simple Alter statements are replicated correctly ---
>> +ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
>> +--- Show the new improved table on the master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`,`total`)
>> +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4
>  */
>> +--- Make sure that our tables on slave are still right type ---
>> +--- and that the alter statements replicated correctly ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`,`total`)
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY ()
> PARTITIONS 4  */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- Check that simple Alter statements are replicated correctly ---
>> +ALTER TABLE t1 MODIFY vc TEXT;
>> +--- Show the new improved table on the master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`,`total`)
>> +) ENGINE=InnoDB DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4
>  */
>> +--- Make sure that our tables on slave are still same engine ---
>> +--- and that the alter statements replicated correctly ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`,`total`)
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY ()
> PARTITIONS 4  */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- End test 5 key partition testing ---
>> +--- Do Cleanup ---
>> +DROP TABLE IF EXISTS t1;
>> diff -Nrup a/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result
> b/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result
>> --- /dev/null	Wed Dec 31 16:00:00 196900
>> +++ b/mysql-test/suite/rpl_ndb/r/rpl_ndb_myisam2ndb.result	2007-10-04 21:41:14
> +02:00
>> @@ -0,0 +1,855 @@
>> +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 storage_engine=myisam;
>> +--- Doing pre test cleanup --- 
>> +DROP TABLE IF EXISTS t1;
>> +--- Start test 1 Basic testing ---
>> +--- Create Table Section ---
>> +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), 
>> +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, 
>> +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, 
>> +y YEAR, t DATE,PRIMARY KEY(id));
>> +--- Show table on master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`)
>> +) ENGINE=MyISAM DEFAULT CHARSET=latin1
>> +--- Show table on slave ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`)
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- Check that simple Alter statements are replicated correctly --
>> +ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
>> +ALTER TABLE t1 MODIFY vc TEXT;
>> +--- Show the new improved table on the master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`,`total`)
>> +) ENGINE=MyISAM DEFAULT CHARSET=latin1
>> +--- Make sure that our tables on slave are still same engine ---
>> +--- and that the alter statements replicated correctly ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`,`total`)
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly --- 
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- End test 1 Basic testing ---
>> +--- Do Cleanup --
>> +DROP TABLE IF EXISTS t1;
>> +--- Start test 2 partition RANGE testing --
>> +--- Do setup --
>> +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), 
>> +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, 
>> +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, 
>> +y YEAR, t DATE)
>> +PARTITION BY RANGE (YEAR(t)) 
>> +(PARTITION p0 VALUES LESS THAN (1901), 
>> +PARTITION p1 VALUES LESS THAN (1946),  
>> +PARTITION p2 VALUES LESS THAN (1966), 
>> +PARTITION p3 VALUES LESS THAN (1986), 
>> +PARTITION p4 VALUES LESS THAN (2005), 
>> +PARTITION p5 VALUES LESS THAN MAXVALUE);
>> +--- Show table on master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL
>> +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t))
> (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN
> (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3
> VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE =
> MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
>> +--- Show table on slave --
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t))
> (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN
> (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
> PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN
> (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster)
> */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- Check that simple Alter statements are replicated correctly ---
>> +ALTER TABLE t1 ADD PRIMARY KEY(t,id);
>> +ALTER TABLE t1 MODIFY vc TEXT;
>> +--- Show the new improved table on the master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date NOT NULL DEFAULT '0000-00-00',
>> +  PRIMARY KEY (`t`,`id`)
>> +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t))
> (PARTITION p0 VALUES LESS THAN (1901) ENGINE = MyISAM, PARTITION p1 VALUES LESS THAN
> (1946) ENGINE = MyISAM, PARTITION p2 VALUES LESS THAN (1966) ENGINE = MyISAM, PARTITION p3
> VALUES LESS THAN (1986) ENGINE = MyISAM, PARTITION p4 VALUES LESS THAN (2005) ENGINE =
> MyISAM, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
>> +--- Make sure that our tables on slave are still same engine ---
>> +--- and that the alter statements replicated correctly ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date NOT NULL DEFAULT '0000-00-00',
>> +  PRIMARY KEY (`t`,`id`)
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY RANGE (YEAR(t))
> (PARTITION p0 VALUES LESS THAN (1901) ENGINE = ndbcluster, PARTITION p1 VALUES LESS THAN
> (1946) ENGINE = ndbcluster, PARTITION p2 VALUES LESS THAN (1966) ENGINE = ndbcluster,
> PARTITION p3 VALUES LESS THAN (1986) ENGINE = ndbcluster, PARTITION p4 VALUES LESS THAN
> (2005) ENGINE = ndbcluster, PARTITION p5 VALUES LESS THAN MAXVALUE ENGINE = ndbcluster)
> */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- End test 2 partition RANGE testing ---
>> +--- Do Cleanup ---
>> +DROP TABLE IF EXISTS t1;
>> +--- Start test 3 partition LIST testing ---
>> +--- Do setup ---
>> +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), 
>> +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, 
>> +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, 
>> +y YEAR, t DATE)
>> +PARTITION BY LIST(id) 
>> +(PARTITION p0 VALUES IN (2, 4), 
>> +PARTITION p1 VALUES IN (42, 142));
>> +--- Test 3 Alter to add partition ---
>> +ALTER TABLE t1 ADD PARTITION (PARTITION p2 VALUES IN (412));
>> +--- Show table on master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL
>> +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id)
> (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE =
> MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
>> +--- Show table on slave ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id)
> (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE
> = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- Check that simple Alter statements are replicated correctly ---
>> +ALTER TABLE t1 ADD PRIMARY KEY(id);
>> +ALTER TABLE t1 MODIFY vc TEXT;
>> +--- Show the new improved table on the master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`)
>> +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id)
> (PARTITION p0 VALUES IN (2,4) ENGINE = MyISAM, PARTITION p1 VALUES IN (42,142) ENGINE =
> MyISAM, PARTITION p2 VALUES IN (412) ENGINE = MyISAM) */
>> +--- Make sure that our tables on slave are still same engine ---
>> +--- and that the alter statements replicated correctly ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`)
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY LIST (id)
> (PARTITION p0 VALUES IN (2,4) ENGINE = ndbcluster, PARTITION p1 VALUES IN (42,142) ENGINE
> = ndbcluster, PARTITION p2 VALUES IN (412) ENGINE = ndbcluster) */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- End test 3 partition LIST testing ---
>> +--- Do Cleanup --
>> +DROP TABLE IF EXISTS t1;
>> +--- Start test 4 partition HASH testing ---
>> +--- Do setup ---
>> +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), 
>> +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, 
>> +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, 
>> +y YEAR, t DATE)
>> +PARTITION BY HASH( YEAR(t) ) 
>> +PARTITIONS 4;
>> +--- show that tables have been created correctly ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL
>> +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t))
> PARTITIONS 4  */
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t))
> PARTITIONS 4  */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- Check that simple Alter statements are replicated correctly ---
>> +ALTER TABLE t1 ADD PRIMARY KEY(t,id);
>> +ALTER TABLE t1 MODIFY vc TEXT;
>> +--- Show the new improved table on the master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date NOT NULL DEFAULT '0000-00-00',
>> +  PRIMARY KEY (`t`,`id`)
>> +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t))
> PARTITIONS 4  */
>> +--- Make sure that our tables on slave are still same engine ---
>> +--- and that the alter statements replicated correctly ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date NOT NULL DEFAULT '0000-00-00',
>> +  PRIMARY KEY (`t`,`id`)
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY HASH ( YEAR(t))
> PARTITIONS 4  */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- End test 4 partition HASH testing ---
>> +--- Do Cleanup --
>> +DROP TABLE IF EXISTS t1;
>> +--- Start test 5 partition by key testing ---
>> +--- Create Table Section ---
>> +CREATE TABLE t1 (id MEDIUMINT NOT NULL, b1 BIT(8), vc VARCHAR(255), 
>> +bc CHAR(255), d DECIMAL(10,4) DEFAULT 0, 
>> +f FLOAT DEFAULT 0, total BIGINT UNSIGNED, 
>> +y YEAR, t DATE,PRIMARY KEY(id))
>> +PARTITION BY KEY() 
>> +PARTITIONS 4;
>> +--- Show that tables on master are ndbcluster tables ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`)
>> +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4
>  */
>> +--- Show that tables on slave ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned DEFAULT NULL,
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`)
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY ()
> PARTITIONS 4  */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- Check that simple Alter statements are replicated correctly ---
>> +ALTER TABLE t1 DROP PRIMARY KEY, ADD PRIMARY KEY(id, total);
>> +--- Show the new improved table on the master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`,`total`)
>> +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4
>  */
>> +--- Make sure that our tables on slave are still right type ---
>> +--- and that the alter statements replicated correctly ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` varchar(255) DEFAULT NULL,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`,`total`)
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY ()
> PARTITIONS 4  */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- Check that simple Alter statements are replicated correctly ---
>> +ALTER TABLE t1 MODIFY vc TEXT;
>> +--- Show the new improved table on the master ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`,`total`)
>> +) ENGINE=MyISAM DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY () PARTITIONS 4
>  */
>> +--- Make sure that our tables on slave are still same engine ---
>> +--- and that the alter statements replicated correctly ---
>> +SHOW CREATE TABLE t1;
>> +Table	Create Table
>> +t1	CREATE TABLE `t1` (
>> +  `id` mediumint(9) NOT NULL,
>> +  `b1` bit(8) DEFAULT NULL,
>> +  `vc` text,
>> +  `bc` char(255) DEFAULT NULL,
>> +  `d` decimal(10,4) DEFAULT '0.0000',
>> +  `f` float DEFAULT '0',
>> +  `total` bigint(20) unsigned NOT NULL DEFAULT '0',
>> +  `y` year(4) DEFAULT NULL,
>> +  `t` date DEFAULT NULL,
>> +  PRIMARY KEY (`id`,`total`)
>> +) ENGINE=ndbcluster DEFAULT CHARSET=latin1 /*!50100 PARTITION BY KEY ()
> PARTITIONS 4  */
>> +--- Perform basic operation on master ---
>> +--- and ensure replicated correctly ---
>> +"--- Insert into t1 --" as "";
>> +--- Select from t1 on master --- 
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Select from t1 on slave ---
>> +select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +2	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1965-11-14
>> +4	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1985-11-14
>> +42	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1905-11-14
>> +142	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	1995-11-14
>> +412	1	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2005-11-14
>> +--- Update t1 on master --
>> +UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412;
>> +--- Check the update on master --- 
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Check Update on slave ---
>> +SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412;
>> +id	hex(b1)	vc	bc	d	f	total	y	t
>> +412	0	Testing MySQL databases is a cool 	Must make it bug free for the
> customer	654321.4321	15.21	0	1965	2006-02-22
>> +--- Remove a record from t1 on master ---
>> +DELETE FROM t1 WHERE id = 42;
>> +--- Show current count on master for t1 ---
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +--- Show current count on slave for t1 --- 
>> +SELECT COUNT(*) FROM t1;
>> +COUNT(*)
>> +4
>> +DELETE FROM t1;
>> +--- End test 5 key partition testing ---
>> +--- Do Cleanup ---
>> +DROP TABLE IF EXISTS t1;
>> diff -Nrup a/mysql-test/suite/rpl_ndb/t/disabled.def
> b/mysql-test/suite/rpl_ndb/t/disabled.def
>> --- a/mysql-test/suite/rpl_ndb/t/disabled.def	2007-07-29 20:04:00 +02:00
>> +++ b/mysql-test/suite/rpl_ndb/t/disabled.def	2007-10-04 21:41:10 +02:00
>> @@ -14,8 +14,6 @@
>>  rpl_ndb_2innodb          : BUG#19227 2006-04-20 pekka pk delete apparently not
> replicated
>>  rpl_ndb_2myisam          : BUG#19227 Seems to pass currently
>>  rpl_ndb_dd_partitions    : BUG#19259 2006-04-21 rpl_ndb_dd_partitions fails on
> s/AMD
>> -rpl_ndb_innodb2ndb       : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb
> failed on Solaris for pack_length issue
>> -rpl_ndb_myisam2ndb       : Bug#29549 rpl_ndb_myisam2ndb,rpl_ndb_innodb2ndb
> failed on Solaris for pack_length issue
>>  rpl_ndb_ddl              : BUG#28798 2007-05-31  lars  Valgrind failure in NDB
>>  rpl_ndb_mix_innodb       : BUG#28123 rpl_ndb_mix_innodb.test casue slave to core
> on sol10-sparc-a
>>  rpl_ndb_ctype_ucs2_def   : BUG#27404 util thd mysql_parse sig11 when mysqld
> default multibyte charset
>> diff -Nrup a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt
> b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt
>> --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt	2007-06-27 14:27:25
> +02:00
>> +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb-slave.opt	2007-10-04 21:41:11
> +02:00
>> @@ -1 +1 @@
>> ---default-storage-engine=ndbcluster
>> +--default-storage-engine=ndbcluster --new
>> diff -Nrup a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test
> b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test
>> --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test	2007-06-27 14:28:30
> +02:00
>> +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_innodb2ndb.test	2007-10-04 21:41:11
> +02:00
>> @@ -7,8 +7,10 @@
>>  # to be able to use the same code for all these different
>>  # test and to have control over the tests.
>>  ##############################################################
>> --- source include/have_ndb.inc
>> --- source include/have_innodb.inc
>> --- source include/ndb_master-slave.inc
>> +source include/have_ndb.inc;
>> +source include/have_innodb.inc;
>> +source include/have_log_bin.inc;
>> +source include/ndb_master-slave.inc;
>> +
>>  SET storage_engine=innodb;
>> ---source extra/rpl_tests/rpl_ndb_2multi_eng.test
>> +source extra/rpl_tests/rpl_ndb_2multi_eng.test;
>> diff -Nrup a/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt
> b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt
>> --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt	2007-06-27 14:27:30
> +02:00
>> +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb-slave.opt	2007-10-04 21:41:11
> +02:00
>> @@ -1 +1 @@
>> ---default-storage-engine=ndbcluster
>> +--default-storage-engine=ndbcluster --new
>> diff -Nrup a/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test
> b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test
>> --- a/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test	2007-06-27 14:28:30
> +02:00
>> +++ b/mysql-test/suite/rpl_ndb/t/rpl_ndb_myisam2ndb.test	2007-10-04 21:41:11
> +02:00
>> @@ -7,6 +7,9 @@
>>  # to be able to use the same code for all these different
>>  # test and to have control over the tests.
>>  ##############################################################
>> --- source include/ndb_master-slave.inc
>> +source include/have_ndb.inc;
>> +source include/have_log_bin.inc;
>> +source include/ndb_master-slave.inc;
>> +
>>  SET storage_engine=myisam;
>> ---source extra/rpl_tests/rpl_ndb_2multi_eng.test
>> +source extra/rpl_tests/rpl_ndb_2multi_eng.test;
>> diff -Nrup a/mysql-test/t/partition.test b/mysql-test/t/partition.test
>> --- a/mysql-test/t/partition.test	2007-07-02 20:11:52 +02:00
>> +++ b/mysql-test/t/partition.test	2007-10-04 21:41:11 +02:00
>> @@ -3,7 +3,8 @@
>>  # Simple test for the partition storage engine
>>  # Taken fromm the select test
>>  #
>> --- source include/have_partition.inc
>> +source include/have_partition.inc;
>> +source include/have_archive.inc;
>>  
>>  --disable_warnings
>>  drop table if exists t1;
>>     
>
>
>   
>> diff -Nrup a/sql/field.cc b/sql/field.cc
>> --- a/sql/field.cc	2007-08-13 21:39:23 +02:00
>> +++ b/sql/field.cc	2007-10-04 21:41:12 +02:00
>> @@ -1373,20 +1373,80 @@ int Field::store(const char *to, uint le
>>  
>>  
>>  /**
>> +   Pack the field into a format suitable for storage and transfer.
>> +
>> +   To implement packing functionality, only the virtual function
>> +   should be overridden. The other functions are just convenience
>> +   functions and hence should not be overridden.
>> +
>> +   The value of <code>low_byte_first</code> is dependent on how the
>> +   packed data is going to be used: for local use, e.g., temporary
>> +   store on disk or in memory, use the native format since that is
>> +   faster. For data that is going to be transfered to other machines
>> +   (e.g., when writing data to the binary log), data should always be
>> +   stored in little-endian format.
>> +
>> +   @note The default method for packing fields just copy the raw bytes
>> +   of the record into the destination, but never more than
>> +   <code>max_length</code> characters.
>> +
>> +   @param to
>> +   Pointer to memory area where representation of field should be put.
>> +
>> +   @param from
>> +   Pointer to memory area where record representation of field is
>> +   stored.
>> +
>> +   @param max_length
>> +   Maximum length of the field, as given in the column definition. For
>> +   example, for <code>CHAR(1000)</code>, the
> <code>max_length</code>
>> +   is 1000. This information is sometimes needed to decide how to pack
>> +   the data.
>> +
>> +   @param low_byte_first
>> +   @c TRUE if integers should be stored little-endian, @c FALSE if
>> +   native format should be used.
>> +*/
>> +uchar *Field::pack(uchar *to, const uchar *from,
>> +                   uint max_length, bool low_byte_first)
>> +{
>> +  uint32 length= pack_length();
>> +  set_if_smaller(length, max_length);
>> +  memcpy(to, from, length);
>> +  return to+length;
>> +}
>>     
>
> Have not you missed to __attribute__ ((unused)) the last arg?
>   

Yup.

>   
>> +
>> +/**
>>     Unpack a field from row data.
>>  
>> -   This method is used to unpack a field from a master whose size 
>> -   of the field is less than that of the slave.
>> -  
>> +   This method is used to unpack a field from a master whose size of
>> +   the field is less than that of the slave.
>> +
>> +   The @c param_data parameter is a two-byte integer (stored in the
>> +   least significant 16 bits of the unsigned integer) consisting of
>> +   two parts: the real type in the most significant byte and a
>> +   original pack length in the least significant byte.
>> +
>> +   This is the default method for unpacking a field. It just copies
>> +   the memory block in byte order (of original pack length bytes or
>> +   length of field, whichever is smaller).
>> +
>>     @param   to         Destination of the data
>>     @param   from       Source of the data
>> -   @param   param_data Pack length of the field data
>> +   @param   param_data Real type and original pack length of the field
>> +                       data
>> +
>> +   @param   low_byte_first
>> +            If this flag is @c true, all composite entities (e.g.,
>> +            lengths) should be packed in little-endian format;
>> +            otherwise, the entities are packed in native order.
>>  
>>     
>
> Thanks for extending the comments. I guess they were meant for
> ::pack() above? At least they suit more to that imo.
>   

No, it's a typo in the text: the comment is for unpack(). For pack(), 
the third parameter is max length.

>   
>>     @return  New pointer into memory based on from + length of the data
>>  */
>>  const uchar *Field::unpack(uchar* to,
>> -                           const uchar *from, 
>> -                           uint param_data)
>> +                           const uchar *from,
>> +                           uint param_data,
>> +                           bool low_byte_first __attribute__((unused)))
>>  {
>>    uint length=pack_length();
>>    int from_type= 0;
>> @@ -1401,17 +1461,14 @@ const uchar *Field::unpack(uchar* to,
>>    }
>>    uint len= (param_data && (param_data < length)) ?
>>              param_data : length;
>> -  /*
>> -    If the length is the same, use old unpack method.
>> -    If the param_data is 0, use the old unpack method.
>> -      This is possible if the table map was generated from a down-level
>> -      master or if the data was not available on the master.
>> -    If the real_types are not the same, use the old unpack method.
>> -  */
>> +
>>    if ((length == param_data) ||
>>        (param_data == 0) ||
>>        (from_type != real_type()))
>> -    return(unpack(to, from));
>> +  {
>> +    memcpy(to, from, length);
>> +    return from+length;
>> +  }
>>    memcpy(to, from, param_data > length ? length : len);
>>    return from+len;
>>  }
>> @@ -2714,10 +2771,19 @@ uint Field_new_decimal::is_equal(Create_
>>  
>>     @return  New pointer into memory based on from + length of the data
>>  */
>> -const uchar *Field_new_decimal::unpack(uchar* to, 
>> -                                       const uchar *from, 
>> -                                       uint param_data)
>> -{
>> +const uchar *
>> +Field_new_decimal::unpack(uchar* to,
>> +                          const uchar *from,
>> +                          uint param_data,
>> +                          bool low_byte_first __attribute__((unused)))
>> +{
>> +  if (param_data == 0)
>> +  {
>> +    uint const length= pack_length();
>> +    memcpy(to, from, pack_length());
>> +    return from + length;
>> +  }
>> +
>>    uint from_precision= (param_data & 0xff00) >> 8U;
>>    uint from_decimal= param_data & 0x00ff;
>>    uint length=pack_length();
>> @@ -3857,6 +3923,49 @@ void Field_longlong::sql_type(String &re
>>  }
>>  
>>  
>>     
>
>   
>> +/*
>> +  Floating-point numbers
>> + */
>> +
>> +uchar *
>> +Field_real::pack(uchar *to, const uchar *from,
>> +                 uint max_length, bool low_byte_first)
>> +{
>> +  DBUG_ENTER("Field_real::pack");
>> +  DBUG_ASSERT(max_length >= pack_length());
>> +  DBUG_PRINT("debug", ("pack_length(): %u", pack_length()));
>> +#ifdef WORDS_BIGENDIAN
>> +  if (low_byte_first != table->s->db_low_byte_first)
>> +  {
>> +    const uchar *dptr= from + pack_length();
>> +    while (dptr-- > from)
>> +      *to++ = *dptr;
>> +    DBUG_RETURN(to);
>> +  }
>> +  else
>> +#endif
>> +    DBUG_RETURN(Field::pack(to, from, max_length, low_byte_first));
>> +}
>>     
>
> A minor issue:
>
> I suggest to make arg-list for unpack to be symmetric
>
> param_data -> max_length 
>   

For pack(), the third parameter is the max length and not param_data.

> A concern:
>
> The difference of the new definitions for two endian-gnostic the short and
> the real looks suspiciously.
>
> For the former there is no ugly 
> #ifdef WORDS_BIGENDIAN
> block, whereas the float has it. Why?
> I find this is more that asymmetry as packing for binlog can happen 
> on BigEndian in reverse (1 != table->s->db_low_byte_first(0))
> but unpacking to a table with table->s->db_low_byte_first(1) does not
> exists on LittleEndian.
> The short type is free from it.
>   

The #ifdef is actually redundant on little-endian systems. For those, 
low_byte_first == TRUE and low_byte_first == FALSE produce the same 
result. Observe that low_byte_first == FALSE means that lengths are 
packed in native format, i.e., on little endian systems, the LSB will be 
stored first anyway.

I'll add the #ifdef to the other pack() and unpack() functions as well.

>   
>> +
>> +const uchar *
>> +Field_real::unpack(uchar *to, const uchar *from,
>> +                   uint param_data, bool low_byte_first)
>> +{
>> +  DBUG_ENTER("Field_real::unpack");
>> +  DBUG_PRINT("debug", ("pack_length(): %u", pack_length()));
>> +#ifdef WORDS_BIGENDIAN
>> +  if (low_byte_first != table->s->db_low_byte_first)
>> +  {
>> +    const uchar *dptr= from + pack_length();
>> +    while (dptr-- > from)
>> +      *to++ = *dptr;
>> +    DBUG_RETURN(from + pack_length());
>> +  }
>> +  else
>> +#endif
>> +    DBUG_RETURN(Field::unpack(to, from, param_data, low_byte_first));
>> +}
>> +
>>  /****************************************************************************
>>    single precision float
>>  ****************************************************************************/
>> @@ -6355,7 +6464,9 @@ void Field_string::sql_type(String &res)
>>  }
>>  
>>  
>> -uchar *Field_string::pack(uchar *to, const uchar *from, uint max_length)
>> +uchar *Field_string::pack(uchar *to, const uchar *from,
>> +                          uint max_length,
>> +                          bool low_byte_first __attribute__((unused)))
>>  {
>>    uint length=      min(field_length,max_length);
>>    uint local_char_length= max_length/field_charset->mbmaxlen;
>> @@ -6363,11 +6474,15 @@ uchar *Field_string::pack(uchar *to, con
>>      local_char_length= my_charpos(field_charset, from, from+length,
>>                                    local_char_length);
>>    set_if_smaller(length, local_char_length);
>> -  while (length && from[length-1] == ' ')
>> +  while (length && from[length-1] == field_charset->pad_char)
>>      length--;
>> +
>> +  // Length always stored little-endian
>>    *to++= (uchar) length;
>>    if (field_length > 255)
>>      *to++= (uchar) (length >> 8);
>> +
>> +  // Store the actual bytes of the string
>>    memcpy(to, from, length);
>>    return to+length;
>>  }
>> @@ -6389,34 +6504,27 @@ uchar *Field_string::pack(uchar *to, con
>>  
>>     @return  New pointer into memory based on from + length of the data
>>  */
>> -const uchar *Field_string::unpack(uchar *to,
>> -                                  const uchar *from,
>> -                                  uint param_data)
>> -{
>> -  uint from_len= param_data & 0x00ff;                 // length.
>> -  uint length= 0;
>> -  uint f_length;
>> -  f_length= (from_len < field_length) ? from_len : field_length;
>> -  DBUG_ASSERT(f_length <= 255);
>> -  length= (uint) *from++;
>> -  bitmap_set_bit(table->write_set,field_index);
>> -  store((const char *)from, length, system_charset_info);
>> -  return from+length;
>> -}
>> -
>> -
>> -const uchar *Field_string::unpack(uchar *to, const uchar *from)
>> +const uchar *
>> +Field_string::unpack(uchar *to,
>> +                     const uchar *from,
>> +                     uint param_data,
>> +                     bool low_byte_first __attribute__((unused)))
>>  {
>> +  uint from_length=
>> +    param_data ? min(param_data & 0x00ff, field_length) : field_length;
>>    uint length;
>> -  if (field_length > 255)
>> +
>> +  if (from_length > 255)
>>    {
>>      length= uint2korr(from);
>>      from+= 2;
>>    }
>>    else
>>      length= (uint) *from++;
>> -  memcpy(to, from, (int) length);
>> -  bfill(to+length, field_length - length, ' ');
>> +
>> +  memcpy(to, from, length);
>> +  // Pad the string with the pad character of the fields charset
>> +  bfill(to + length, field_length - length, field_charset->pad_char);
>>    return from+length;
>>  }
>>  
>> @@ -6796,22 +6904,30 @@ uint32 Field_varstring::data_length()
>>    Here the number of length bytes are depending on the given max_length
>>  */
>>  
>> -uchar *Field_varstring::pack(uchar *to, const uchar *from, uint max_length)
>> +uchar *Field_varstring::pack(uchar *to, const uchar *from,
>> +                             uint max_length,
>> +                             bool low_byte_first __attribute__((unused)))
>>  {
>>    uint length= length_bytes == 1 ? (uint) *from : uint2korr(from);
>>    set_if_smaller(max_length, field_length);
>>    if (length > max_length)
>>      length=max_length;
>> -  *to++= (char) (length & 255);
>> +
>> +  /* Length always stored little-endian */
>> +  *to++= length & 0xFF;
>>    if (max_length > 255)
>> -    *to++= (char) (length >> 8);
>> -  if (length)
>> +    *to++= (length >> 8) & 0xFF;
>> +
>> +  /* Store bytes of string */
>> +  if (length > 0)
>>      memcpy(to, from+length_bytes, length);
>>    return to+length;
>>  }
>>  
>>  
>> -uchar *Field_varstring::pack_key(uchar *to, const uchar *key, uint max_length)
>> +uchar *
>> +Field_varstring::pack_key(uchar *to, const uchar *key, uint max_length,
>> +                          bool low_byte_first __attribute__((unused)))
>>  {
>>    uint length=  length_bytes == 1 ? (uint) *key : uint2korr(key);
>>    uint local_char_length= ((field_charset->mbmaxlen > 1) ?
>> @@ -6850,8 +6966,9 @@ uchar *Field_varstring::pack_key(uchar *
>>      Pointer to end of 'key' (To the next key part if multi-segment key)
>>  */
>>  
>> -const uchar *Field_varstring::unpack_key(uchar *to, const uchar *key,
>> -                                         uint max_length)
>> +const uchar *
>> +Field_varstring::unpack_key(uchar *to, const uchar *key, uint max_length,
>> +                            bool low_byte_first __attribute__((unused)))
>>  {
>>    /* get length of the blob key */
>>    uint32 length= *key++;
>> @@ -6880,8 +6997,9 @@ const uchar *Field_varstring::unpack_key
>>      end of key storage
>>  */
>>  
>> -uchar *Field_varstring::pack_key_from_key_image(uchar *to, const uchar *from,
>> -                                                uint max_length)
>> +uchar *
>> +Field_varstring::pack_key_from_key_image(uchar *to, const uchar *from, uint
> max_length,
>> +                                         bool low_byte_first
> __attribute__((unused)))
>>  {
>>    /* Key length is always stored as 2 bytes */
>>    uint length= uint2korr(from);
>> @@ -6901,6 +7019,9 @@ uchar *Field_varstring::pack_key_from_ke
>>  
>>     This method is used to unpack a varstring field from a master
>>     whose size of the field is less than that of the slave.
>> +
>> +   @note
>> +   The string length is always packed little-endian.
>>    
>>     @param   to         Destination of the data
>>     @param   from       Source of the data
>> @@ -6908,9 +7029,10 @@ uchar *Field_varstring::pack_key_from_ke
>>  
>>     @return  New pointer into memory based on from + length of the data
>>  */
>> -const uchar *Field_varstring::unpack(uchar *to, 
>> -                                     const uchar *from,
>> -                                     uint param_data)
>> +const uchar *
>> +Field_varstring::unpack(uchar *to, const uchar *from,
>> +                        uint param_data,
>> +                        bool low_byte_first __attribute__((unused)))
>>  {
>>    uint length;
>>    uint l_bytes= (param_data && (param_data < field_length)) ? 
>> @@ -6922,28 +7044,7 @@ const uchar *Field_varstring::unpack(uch
>>      if (length_bytes == 2)
>>        to[1]= 0;
>>    }
>> -  else
>> -  {
>> -    length= uint2korr(from);
>> -    to[0]= *from++;
>> -    to[1]= *from++;
>> -  }
>> -  if (length)
>> -    memcpy(to+ length_bytes, from, length);
>> -  return from+length;
>> -}
>> -
>> -
>> -/*
>> -  unpack field packed with Field_varstring::pack()
>> -*/
>> -
>> -const uchar *Field_varstring::unpack(uchar *to, const uchar *from)
>> -{
>> -  uint length;
>> -  if (length_bytes == 1)
>> -    length= (uint) (*to= *from++);
>> -  else
>> +  else /* l_bytes == 2 */
>>    {
>>      length= uint2korr(from);
>>      to[0]= *from++;
>> @@ -7192,9 +7293,9 @@ void Field_blob::store_length(uchar *i_p
>>  }
>>  
>>  
>> -uint32 Field_blob::get_length(const uchar *pos, bool low_byte_first)
>> +uint32 Field_blob::get_length(const uchar *pos, uint packlength_arg, bool
> low_byte_first)
>>  {
>> -  switch (packlength) {
>> +  switch (packlength_arg) {
>>    case 1:
>>      return (uint32) pos[0];
>>    case 2:
>> @@ -7608,28 +7709,36 @@ void Field_blob::sql_type(String &res) c
>>    }
>>  }
>>  
>> -
>> -uchar *Field_blob::pack(uchar *to, const uchar *from, uint max_length)
>> +uchar *Field_blob::pack(uchar *to, const uchar *from,
>> +                        uint max_length, bool low_byte_first)
>>  {
>> +  DBUG_ENTER("Field_blob::pack");
>> +  DBUG_PRINT("enter", ("to: 0x%lx; from: 0x%lx;"
>> +                       " max_length: %u; low_byte_first: %d",
>> +                       to, from, max_length, low_byte_first));
>> +  DBUG_DUMP("record", from, table->s->reclength);
>>    uchar *save= ptr;
>>    ptr= (uchar*) from;
>>    uint32 length=get_length();			// Length of from string
>> -  if (length > max_length)
>> -  {
>> -    ptr=to;
>> -    length=max_length;
>> -    store_length(length);			// Store max length
>> -    ptr= (uchar*) from;
>> -  }
>> -  else
>> -    memcpy(to,from,packlength);			// Copy length
>> -  if (length)
>> +
>> +  /*
>> +    Store max length, which will occupy packlength bytes. If the max
>> +    length given is smaller than the actual length of the blob, we
>> +    just store the initial bytes of the blob.
>> +  */
>> +  store_length(to, packlength, min(length, max_length), low_byte_first);
>> +
>> +  /*
>> +    Store the actual blob data, which will occupy 'length' bytes.
>> +   */
>> +  if (length > 0)
>>    {
>>      get_ptr((uchar**) &from);
>>      memcpy(to+packlength, from,length);
>>    }
>>    ptr=save;					// Restore org row pointer
>> -  return to+packlength+length;
>> +  DBUG_DUMP("packed", to, packlength + length);
>> +  DBUG_RETURN(to+packlength+length);
>>  }
>>  
>>  
>> @@ -7644,28 +7753,26 @@ uchar *Field_blob::pack(uchar *to, const
>>  
>>     @param   to         Destination of the data
>>     @param   from       Source of the data
>> -   @param   param_data <not used>
>>  
>>     @return  New pointer into memory based on from + length of the data
>>  */
>>  const uchar *Field_blob::unpack(uchar *to, 
>>                                  const uchar *from,
>> -                                uint param_data)
>> +                                uint param_data,
>> +                                bool low_byte_first)
>>  {
>> -  return unpack(to, from);
>> -}
>> -
>> -
>> -const uchar *Field_blob::unpack(uchar *to, const uchar *from)
>> -{
>> -  memcpy(to,from,packlength);
>> -  uint32 length=get_length(from);
>> -  from+=packlength;
>> -  if (length)
>> -    memcpy_fixed(to+packlength, &from, sizeof(from));
>> -  else
>> -    bzero(to+packlength,sizeof(from));
>> -  return from+length;
>> +  DBUG_ENTER("Field_blob::unpack");
>> +  DBUG_PRINT("enter", ("to: 0x%lx; from: 0x%lx;"
>> +                       " param_data: %u; low_byte_first: %d",
>> +                       to, from, param_data, low_byte_first));
>> +  uint const master_packlength=
>> +    param_data > 0 ? param_data & 0xFF : packlength;
>> +  uint32 const length= get_length(from, master_packlength, low_byte_first);
>> +  DBUG_DUMP("packed", from, length + master_packlength);
>> +  store(reinterpret_cast<const char*>(from) + master_packlength,
>> +        length, field_charset);
>> +  DBUG_DUMP("record", to, table->s->reclength);
>> +  DBUG_RETURN(from + master_packlength + length);
>>  }
>>  
>>  /* Keys for blobs are like keys on varchars */
>> @@ -7715,7 +7822,9 @@ int Field_blob::pack_cmp(const uchar *b,
>>  
>>  /* Create a packed key that will be used for storage from a MySQL row */
>>  
>> -uchar *Field_blob::pack_key(uchar *to, const uchar *from, uint max_length)
>> +uchar *
>> +Field_blob::pack_key(uchar *to, const uchar *from, uint max_length,
>> +                     bool low_byte_first __attribute__((unused)))
>>  {
>>    uchar *save= ptr;
>>    ptr= (uchar*) from;
>> @@ -7760,8 +7869,9 @@ uchar *Field_blob::pack_key(uchar *to, c
>>      Pointer into 'from' past the last byte copied from packed key.
>>  */
>>  
>> -const uchar *Field_blob::unpack_key(uchar *to, const uchar *from,
>> -                                    uint max_length)
>> +const uchar *
>> +Field_blob::unpack_key(uchar *to, const uchar *from, uint max_length,
>> +                       bool low_byte_first __attribute__((unused)))
>>  {
>>    /* get length of the blob key */
>>    uint32 length= *from++;
>> @@ -7784,8 +7894,9 @@ const uchar *Field_blob::unpack_key(ucha
>>  
>>  /* Create a packed key that will be used for storage from a MySQL key */
>>  
>> -uchar *Field_blob::pack_key_from_key_image(uchar *to, const uchar *from,
>> -                                           uint max_length)
>> +uchar *
>> +Field_blob::pack_key_from_key_image(uchar *to, const uchar *from, uint
> max_length,
>> +                                    bool low_byte_first
> __attribute__((unused)))
>>  {
>>    uint length=uint2korr(from);
>>    if (length > max_length)
>> @@ -8672,9 +8783,11 @@ void Field_bit::sql_type(String &res) co
>>  }
>>  
>>  
>> -uchar *Field_bit::pack(uchar *to, const uchar *from, uint max_length)
>> +uchar *
>> +Field_bit::pack(uchar *to, const uchar *from, uint max_length,
>> +                bool low_byte_first __attribute__((unused)))
>>  {
>> -  DBUG_ASSERT(max_length);
>> +  DBUG_ASSERT(max_length > 0);
>>    uint length;
>>    if (bit_len > 0)
>>    {
>> @@ -8709,28 +8822,44 @@ uchar *Field_bit::pack(uchar *to, const 
>>  /**
>>     Unpack a bit field from row data.
>>  
>> -   This method is used to unpack a bit field from a master whose size 
>> +   This method is used to unpack a bit field from a master whose size
>>     of the field is less than that of the slave.
>> -  
>> +
>>     @param   to         Destination of the data
>>     @param   from       Source of the data
>>     @param   param_data Bit length (upper) and length (lower) values
>>  
>>     @return  New pointer into memory based on from + length of the data
>>  */
>> -const uchar *Field_bit::unpack(uchar *to,
>> -                               const uchar *from,
>> -                               uint param_data)
>> +const uchar *
>> +Field_bit::unpack(uchar *to, const uchar *from, uint param_data,
>> +                  bool low_byte_first __attribute__((unused)))
>>  {
>>    uint const from_len= (param_data >> 8U) & 0x00ff;
>>    uint const from_bit_len= param_data & 0x00ff;
>>    /*
>> -    If the master and slave have the same sizes, then use the old
>> -    unpack() method.
>> +    If the parameter data is zero (i.e., undefined), or if the master
>> +    and slave have the same sizes, then use the old unpack() method.
>>    */
>> -  if ((from_bit_len == bit_len) &&
>> -      (from_len == bytes_in_rec)) 
>> -    return(unpack(to, from));
>> +  if (param_data == 0 ||
>> +      (from_bit_len == bit_len) && (from_len == bytes_in_rec))
>> +  {
>> +    if (bit_len > 0)
>> +    {
>> +      /*
>> +        set_rec_bits is a macro, don't put the post-increment in the
>> +        argument since that might cause strange side-effects.
>> +
>> +        For the choice of the second argument, see the explanation for
>> +        Field_bit::pack().
>> +      */
>> +      set_rec_bits(*from, bit_ptr + (to - ptr), bit_ofs, bit_len);
>> +      from++;
>> +    }
>> +    memcpy(to, from, bytes_in_rec);
>> +    return from + bytes_in_rec;
>> +  }
>> +
>>    /*
>>      We are converting a smaller bit field to a larger one here.
>>      To do that, we first need to construct a raw value for the original
>> @@ -8755,25 +8884,6 @@ const uchar *Field_bit::unpack(uchar *to
>>    store(value, new_len, system_charset_info);
>>    my_afree(value);
>>    return from + len;
>> -}
>> -
>> -
>> -const uchar *Field_bit::unpack(uchar *to, const uchar *from)
>> -{
>> -  if (bit_len > 0)
>> -  {
>> -    /*
>> -      set_rec_bits is a macro, don't put the post-increment in the
>> -      argument since that might cause strange side-effects.
>> -
>> -      For the choice of the second argument, see the explanation for
>> -      Field_bit::pack().
>> -    */
>> -    set_rec_bits(*from, bit_ptr + (to - ptr), bit_ofs, bit_len);
>> -    from++;
>> -  }
>> -  memcpy(to, from, bytes_in_rec);
>> -  return from + bytes_in_rec;
>>  }
>>  
>>  
>> diff -Nrup a/sql/field.h b/sql/field.h
>> --- a/sql/field.h	2007-08-04 11:08:07 +02:00
>> +++ b/sql/field.h	2007-10-04 21:41:12 +02:00
>> @@ -339,32 +339,45 @@ public:
>>      return str;
>>    }
>>    virtual bool send_binary(Protocol *protocol);
>> -  virtual uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0)
>> +
>> +  virtual uchar *pack(uchar *to, const uchar *from,
>> +                      uint max_length, bool low_byte_first);
>> +  /**
>> +     @overload Field::pack(uchar*, const uchar*, uint, bool)
>> +  */
>> +  uchar *pack(uchar *to, const uchar *from)
>>    {
>> -    uint32 length=pack_length();
>> -    memcpy(to,from,length);
>> -    return to+length;
>> +    DBUG_ENTER("Field::pack");
>> +    uchar *result= this->pack(to, from, UINT_MAX,
> table->s->db_low_byte_first);
>> +    DBUG_RETURN(result);
>>    }
>> -  virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data);
>> -  virtual const uchar *unpack(uchar* to, const uchar *from)
>> +
>> +  virtual const uchar *unpack(uchar* to, const uchar *from,
>> +                              uint param_data, bool low_byte_first);
>> +  /**
>> +     @overload Field::unpack(uchar*, const uchar*, uint, bool)
>> +  */
>> +  const uchar *unpack(uchar* to, const uchar *from)
>>    {
>> -    uint length=pack_length();
>> -    memcpy(to,from,length);
>> -    return from+length;
>> +    DBUG_ENTER("Field::unpack");
>> +    const uchar *result= unpack(to, from, 0U,
> table->s->db_low_byte_first);
>> +    DBUG_RETURN(result);
>>    }
>> -  virtual uchar *pack_key(uchar* to, const uchar *from, uint max_length)
>> +
>> +  virtual uchar *pack_key(uchar* to, const uchar *from,
>> +                          uint max_length, bool low_byte_first)
>>    {
>> -    return pack(to,from,max_length);
>> +    return pack(to, from, max_length, low_byte_first);
>>    }
>>    virtual uchar *pack_key_from_key_image(uchar* to, const uchar *from,
>> -					uint max_length)
>> +					uint max_length, bool low_byte_first)
>>    {
>> -    return pack(to,from,max_length);
>> +    return pack(to, from, max_length, low_byte_first);
>>    }
>>    virtual const uchar *unpack_key(uchar* to, const uchar *from,
>> -                                  uint max_length)
>> +                                  uint max_length, bool low_byte_first)
>>    {
>> -    return unpack(to,from);
>> +    return unpack(to, from, max_length, low_byte_first);
>>    }
>>    virtual uint packed_col_length(const uchar *to, uint length)
>>    { return length;}
>> @@ -556,6 +569,10 @@ public:
>>    int truncate(double *nr, double max_length);
>>    uint32 max_display_length() { return field_length; }
>>    uint size_of() const { return sizeof(*this); }
>> +  virtual const uchar *unpack(uchar* to, const uchar *from,
>> +                              uint param_data, bool low_byte_first);
>> +  virtual uchar *pack(uchar* to, const uchar *from,
>> +                      uint max_length, bool low_byte_first);
>>  };
>>  
>>  
>> @@ -584,6 +601,16 @@ public:
>>    void overflow(bool negative);
>>    bool zero_pack() const { return 0; }
>>    void sql_type(String &str) const;
>> +  virtual const uchar *unpack(uchar* to, const uchar *from,
>> +                              uint param_data, bool low_byte_first)
>> +  {
>> +    return Field::unpack(to, from, param_data, low_byte_first);
>> +  }
>> +  virtual uchar *pack(uchar* to, const uchar *from,
>> +                      uint max_length, bool low_byte_first)
>> +  {
>> +    return Field::pack(to, from, max_length, low_byte_first);
>> +  }
>>  };
>>  
>>  
>> @@ -629,7 +656,8 @@ public:
>>    uint size_of() const { return sizeof(*this); } 
>>    uint32 pack_length() const { return (uint32) bin_size; }
>>    uint is_equal(Create_field *new_field);
>> -  virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data);
>> +  virtual const uchar *unpack(uchar* to, const uchar *from,
>> +                              uint param_data, bool low_byte_first);
>>  };
>>  
>>  
>> @@ -660,6 +688,20 @@ public:
>>    uint32 pack_length() const { return 1; }
>>    void sql_type(String &str) const;
>>    uint32 max_display_length() { return 4; }
>> +
>> +  virtual uchar *pack(uchar* to, const uchar *from,
>> +                      uint max_length, bool low_byte_first)
>> +  {
>> +    *to= *from;
>> +    return to + 1;
>> +  }
>> +
>> +  virtual const uchar *unpack(uchar* to, const uchar *from,
>> +                              uint param_data, bool low_byte_first)
>> +  {
>> +    *to= *from;
>> +    return from + 1;
>> +  }
>>  };
>>  
>>  
>> @@ -695,8 +737,39 @@ public:
>>    uint32 pack_length() const { return 2; }
>>    void sql_type(String &str) const;
>>    uint32 max_display_length() { return 6; }
>> -};
>>  
>> +  virtual uchar *pack(uchar* to, const uchar *from,
>> +                      uint max_length, bool low_byte_first)
>> +  {
>> +    int16 val;
>> +    if (table->s->db_low_byte_first)
>> +      val = sint2korr(from);
>> +    else
>> +      shortget(val, from);
>> +
>> +    if (low_byte_first)
>> +      int2store(to, val);
>> +    else
>> +      shortstore(to, val);
>> +    return to + sizeof(val);
>> +  }
>> +
>> +  virtual const uchar *unpack(uchar* to, const uchar *from,
>> +                              uint param_data, bool low_byte_first)
>> +  {
>> +    int16 val;
>> +    if (low_byte_first)
>> +      val = sint2korr(from);
>> +    else
>> +      shortget(val, from);
>> +
>> +    if (table->s->db_low_byte_first)
>> +      int2store(to, val);
>> +    else
>> +      shortstore(to, val);
>> +    return from + sizeof(val);
>> +  }
>> +};
>>  
>>  class Field_medium :public Field_num {
>>  public:
>> @@ -725,6 +798,18 @@ public:
>>    uint32 pack_length() const { return 3; }
>>    void sql_type(String &str) const;
>>    uint32 max_display_length() { return 8; }
>> +
>> +  virtual uchar *pack(uchar* to, const uchar *from,
>> +                      uint max_length, bool low_byte_first)
>> +  {
>> +    return Field::pack(to, from, max_length, low_byte_first);
>> +  }
>> +
>> +  virtual const uchar *unpack(uchar* to, const uchar *from,
>> +                              uint param_data, bool low_byte_first)
>> +  {
>> +    return Field::unpack(to, from, param_data, low_byte_first);
>> +  }
>>  };
>>  
>>  
>> @@ -760,6 +845,37 @@ public:
>>    uint32 pack_length() const { return 4; }
>>    void sql_type(String &str) const;
>>    uint32 max_display_length() { return MY_INT32_NUM_DECIMAL_DIGITS; }
>> +  virtual uchar *pack(uchar* to, const uchar *from,
>> +                      uint max_length, bool low_byte_first)
>> +  {
>> +    int32 val;
>> +    if (table->s->db_low_byte_first)
>> +      val = sint4korr(from);
>> +    else
>> +      longget(val, from);
>> +
>> +    if (low_byte_first)
>> +      int4store(to, val);
>> +    else
>> +      longstore(to, val);
>> +    return to + sizeof(val);
>> +  }
>> +
>> +  virtual const uchar *unpack(uchar* to, const uchar *from,
>> +                              uint param_data, bool low_byte_first)
>> +  {
>> +    int32 val;
>> +    if (low_byte_first)
>> +      val = sint4korr(from);
>> +    else
>> +      longget(val, from);
>> +
>> +    if (table->s->db_low_byte_first)
>> +      int4store(to, val);
>> +    else
>> +      longstore(to, val);
>> +    return from + sizeof(val);
>> +  }
>>  };
>>  
>>  
>> @@ -802,6 +918,37 @@ public:
>>    void sql_type(String &str) const;
>>    bool can_be_compared_as_longlong() const { return TRUE; }
>>    uint32 max_display_length() { return 20; }
>> +  virtual uchar *pack(uchar* to, const uchar *from,
>> +                      uint max_length, bool low_byte_first)
>> +  {
>> +    int64 val;
>> +    if (table->s->db_low_byte_first)
>> +      val = sint8korr(from);
>> +    else
>> +      longlongget(val, from);
>> +
>> +    if (low_byte_first)
>> +      int8store(to, val);
>> +    else
>> +      longlongstore(to, val);
>> +    return to + sizeof(val);
>> +  }
>> +
>> +  virtual const uchar *unpack(uchar* to, const uchar *from,
>> +                              uint param_data, bool low_byte_first)
>> +  {
>> +    int64 val;
>> +    if (low_byte_first)
>> +      val = sint8korr(from);
>> +    else
>> +      longlongget(val, from);
>> +
>> +    if (table->s->db_low_byte_first)
>> +      int8store(to, val);
>> +    else
>> +      longlongstore(to, val);
>> +    return from + sizeof(val);
>> +  }
>>  };
>>  #endif
>>  
>> @@ -1176,9 +1323,10 @@ public:
>>    int cmp(const uchar *,const uchar *);
>>    void sort_string(uchar *buff,uint length);
>>    void sql_type(String &str) const;
>> -  uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0);
>> -  virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data);
>> -  const uchar *unpack(uchar* to, const uchar *from);
>> +  virtual uchar *pack(uchar *to, const uchar *from,
>> +                      uint max_length, bool low_byte_first);
>> +  virtual const uchar *unpack(uchar* to, const uchar *from,
>> +                              uint param_data, bool low_byte_first);
>>    int pack_cmp(const uchar *a,const uchar *b,uint key_length,
>>                 my_bool insert_or_update);
>>    int pack_cmp(const uchar *b,uint key_length,my_bool insert_or_update);
>> @@ -1250,13 +1398,15 @@ public:
>>    uint get_key_image(uchar *buff,uint length, imagetype type);
>>    void set_key_image(const uchar *buff,uint length);
>>    void sql_type(String &str) const;
>> -  uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0);
>> -  uchar *pack_key(uchar *to, const uchar *from, uint max_length);
>> +  virtual uchar *pack(uchar *to, const uchar *from,
>> +                      uint max_length, bool low_byte_first);
>> +  uchar *pack_key(uchar *to, const uchar *from, uint max_length, bool
> low_byte_first);
>>    uchar *pack_key_from_key_image(uchar* to, const uchar *from,
>> -                                 uint max_length);
>> -  virtual const uchar *unpack(uchar* to, const uchar *from, uint param_data);
>> -  const uchar *unpack(uchar* to, const uchar *from);
>> -  const uchar *unpack_key(uchar* to, const uchar *from, uint max_length);
>> +                                 uint max_length, bool low_byte_first);
>> +  virtual const uchar *unpack(uchar* to, const uchar *from,
>> +                              uint param_data, bool low_byte_first);
>> +  const uchar *unpack_key(uchar* to, const uchar *from,
>> +                          uint max_length, bool low_byte_first);
>>    int pack_cmp(const uchar *a, const uchar *b, uint key_length,
>>                 my_bool insert_or_update);
>>    int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update);
>> @@ -1374,13 +1524,13 @@ public:
>>       @retval The length in the row plus the size of the data.
>>    */
>>    uint32 get_packed_size(const uchar *ptr_arg, bool low_byte_first)
>> -    {return packlength + get_length(ptr_arg, low_byte_first);}
>> +    {return packlength + get_length(ptr_arg, packlength, low_byte_first);}
>>  
>>    inline uint32 get_length(uint row_offset= 0)
>> -  { return get_length(ptr+row_offset, table->s->db_low_byte_first); }
>> -  uint32 get_length(const uchar *ptr, bool low_byte_first);
>> +  { return get_length(ptr+row_offset, this->packlength,
> table->s->db_low_byte_first); }
>> +  uint32 get_length(const uchar *ptr, uint packlength, bool low_byte_first);
>>    uint32 get_length(const uchar *ptr_arg)
>> -  { return get_length(ptr_arg, table->s->db_low_byte_first); }
>> +  { return get_length(ptr_arg, this->packlength,
> table->s->db_low_byte_first); }
>>    void put_length(uchar *pos, uint32 length);
>>    inline void get_ptr(uchar **str)
>>      {
>> @@ -1421,13 +1571,16 @@ public:
>>      memcpy_fixed(ptr+packlength,&tmp,sizeof(char*));
>>      return 0;
>>    }
>> -  uchar *pack(uchar *to, const uchar *from, uint max_length= ~(uint) 0);
>> -  uchar *pack_key(uchar *to, const uchar *from, uint max_length);
>> +  virtual uchar *pack(uchar *to, const uchar *from,
>> +                      uint max_length, bool low_byte_first);
>> +  uchar *pack_key(uchar *to, const uchar *from,
>> +                  uint max_length, bool low_byte_first);
>>    uchar *pack_key_from_key_image(uchar* to, const uchar *from,
>> -                                 uint max_length);
>> -  virtual const uchar *unpack(uchar *to, const uchar *from, uint param_data);
>> -  const uchar *unpack(uchar *to, const uchar *from);
>> -  const uchar *unpack_key(uchar* to, const uchar *from, uint max_length);
>> +                                 uint max_length, bool low_byte_first);
>> +  virtual const uchar *unpack(uchar *to, const uchar *from,
>> +                              uint param_data, bool low_byte_first);
>> +  const uchar *unpack_key(uchar* to, const uchar *from,
>> +                          uint max_length, bool low_byte_first);
>>    int pack_cmp(const uchar *a, const uchar *b, uint key_length,
>>                 my_bool insert_or_update);
>>    int pack_cmp(const uchar *b, uint key_length,my_bool insert_or_update);
>> @@ -1602,9 +1755,10 @@ public:
>>    uint32 pack_length() const { return (uint32) (field_length + 7) / 8; }
>>    uint32 pack_length_in_rec() const { return bytes_in_rec; }
>>    void sql_type(String &str) const;
>> -  uchar *pack(uchar *to, const uchar *from, uint max_length=~(uint) 0);
>> -  virtual const uchar *unpack(uchar *to, const uchar *from, uint param_data);
>> -  const uchar *unpack(uchar* to, const uchar *from);
>> +  virtual uchar *pack(uchar *to, const uchar *from,
>> +                      uint max_length, bool low_byte_first);
>> +  virtual const uchar *unpack(uchar *to, const uchar *from,
>> +                              uint param_data, bool low_byte_first);
>>    virtual void set_default();
>>  
>>    Field *new_key_field(MEM_ROOT *root, struct st_table *new_table,
>> diff -Nrup a/sql/log.cc b/sql/log.cc
>> --- a/sql/log.cc	2007-08-14 14:20:02 +02:00
>> +++ b/sql/log.cc	2007-10-04 21:41:12 +02:00
>> @@ -3571,9 +3571,6 @@ bool MYSQL_BIN_LOG::write(Log_event *eve
>>  	(!binlog_filter->db_ok(local_db)))
>>      {
>>        VOID(pthread_mutex_unlock(&LOCK_log));
>> -      DBUG_PRINT("info",("OPTION_BIN_LOG is %s, db_ok('%s') == %d",
>> -                         (thd->options & OPTION_BIN_LOG) ? "set" :
> "clear",
>> -                         local_db, binlog_filter->db_ok(local_db)));
>>        DBUG_RETURN(0);
>>      }
>>  #endif /* HAVE_REPLICATION */
>> diff -Nrup a/sql/log_event.cc b/sql/log_event.cc
>> --- a/sql/log_event.cc	2007-08-27 20:22:01 +02:00
>> +++ b/sql/log_event.cc	2007-10-04 21:41:13 +02:00
>> @@ -5697,7 +5697,9 @@ Rows_log_event::Rows_log_event(const cha
>>                                 *description_event)
>>    : Log_event(buf, description_event),
>>      m_row_count(0),
>> +#ifndef MYSQL_CLIENT
>>      m_table(NULL),
>> +#endif
>>      m_rows_buf(0), m_rows_cur(0), m_rows_end(0),
>>      m_curr_row(NULL), m_curr_row_end(NULL),
>>      m_key(NULL)
>> @@ -6168,6 +6170,8 @@ int Rows_log_event::do_apply_event(RELAY
>>          unpack_current_row(rli);
>>    
>>        // at this moment m_curr_row_end should be set
>> +      DBUG_PRINT("debug", ("m_curr_row_end: 0x%lx; m_curr_row: 0x%lx;
> m_rows_end: 0x%lx",
>> +                           m_curr_row_end, m_curr_row, m_rows_end));
>>        DBUG_ASSERT(error || m_curr_row_end != NULL); 
>>        DBUG_ASSERT(error || m_curr_row < m_curr_row_end);
>>        DBUG_ASSERT(error || m_curr_row_end <= m_rows_end);
>> diff -Nrup a/sql/rpl_record.cc b/sql/rpl_record.cc
>> --- a/sql/rpl_record.cc	2007-08-26 14:31:03 +02:00
>> +++ b/sql/rpl_record.cc	2007-10-04 21:41:13 +02:00
>> @@ -65,6 +65,8 @@ pack_row(TABLE *table, MY_BITMAP const* 
>>    my_ptrdiff_t const rec_offset= record - table->record[0];
>>    my_ptrdiff_t const def_offset= table->s->default_values -
> table->record[0];
>>  
>> +  DBUG_ENTER("pack_row");
>> +
>>    /*
>>      We write the null bits and the packed records using one pass
>>      through all the fields. The null bytes are written little-endian,
>> @@ -96,26 +98,11 @@ pack_row(TABLE *table, MY_BITMAP const* 
>>            For big-endian machines, we have to make sure that the
>>            length is stored in little-endian format, since this is the
>>            format used for the binlog.
>> -
>> -          We do this by setting the db_low_byte_first, which is used
>> -          inside some store_length() to decide what order to write the
>> -          bytes in.
>> -
>> -          In reality, db_log_byte_first is only set for legacy table
>> -          type Isam, but in the event of a bug, we need to guarantee
>> -          the endianess when writing to the binlog.
>> -
>> -          This is currently broken for NDB due to BUG#29549, so we
>> -          will fix it when NDB has fixed their way of handling BLOBs.
>>          */
>> -#if 0
>> -        bool save= table->s->db_low_byte_first;
>> -        table->s->db_low_byte_first= TRUE;
>> -#endif
>> -        pack_ptr= field->pack(pack_ptr, field->ptr + offset);
>> -#if 0
>> -        table->s->db_low_byte_first= save;
>> -#endif
>> +        const uchar *old_pack_ptr= pack_ptr;
>> +        pack_ptr= field->pack(pack_ptr, field->ptr + offset, UINT_MAX,
> TRUE);
>> +        DBUG_PRINT("debug", ("field: %s; pack_ptr: 0x%lx; pack_ptr':0x%lx;
> bytes: %d",
>> +                             field->field_name, old_pack_ptr, pack_ptr,
> pack_ptr - old_pack_ptr));
>>        }
>>  
>>        null_mask <<= 1;
>> @@ -143,8 +130,8 @@ pack_row(TABLE *table, MY_BITMAP const* 
>>      packed data. If it doesn't, something is very wrong.
>>    */
>>    DBUG_ASSERT(null_ptr == row_data + null_byte_count);
>> -
>> -  return static_cast<size_t>(pack_ptr - row_data);
>> +  DBUG_DUMP("row_data", row_data, pack_ptr - row_data);
>> +  DBUG_RETURN(static_cast<size_t>(pack_ptr - row_data));
>>  }
>>  #endif
>>  
>> @@ -242,18 +229,11 @@ unpack_row(RELAY_LOG_INFO const *rli,
>>            Use the master's size information if available else call
>>            normal unpack operation.
>>          */
>> -#if 0
>> -        bool save= table->s->db_low_byte_first;
>> -        table->s->db_low_byte_first= TRUE;
>> -#endif
>>          uint16 const metadata= tabledef->field_metadata(i);
>> -        if (tabledef && metadata)
>> -          pack_ptr= f->unpack(f->ptr, pack_ptr, metadata);
>> -        else
>> -          pack_ptr= f->unpack(f->ptr, pack_ptr);
>> -#if 0
>> -        table->s->db_low_byte_first= save;
>> -#endif
>> +        uchar const *const old_pack_ptr= pack_ptr;
>> +        pack_ptr= f->unpack(f->ptr, pack_ptr, metadata, TRUE);
>> +	DBUG_PRINT("debug", ("field: %s; metadata: 0x%x; pack_ptr: 0x%lx; pack_ptr':
> 0x%lx; bytes: %d",
>> +                             f->field_name, metadata, old_pack_ptr, pack_ptr,
> pack_ptr - old_pack_ptr));
>>        }
>>  
>>        null_mask <<= 1;
>> @@ -265,6 +245,7 @@ unpack_row(RELAY_LOG_INFO const *rli,
>>      throw away master's extra fields
>>    */
>>    uint max_cols= min(tabledef->size(), cols->n_bits);
>> +  DBUG_PRINT("debug", ("Master has %u fields, slave %u", tabledef->size(),
> cols->n_bits));
>>    for (; i < max_cols; i++)
>>    {
>>      if (bitmap_is_set(cols, i))
>> @@ -279,6 +260,7 @@ unpack_row(RELAY_LOG_INFO const *rli,
>>  
>>        if (!((null_bits & null_mask) && tabledef->maybe_null(i)))
>>          pack_ptr+= tabledef->calc_field_size(i, (uchar *) pack_ptr);
>> +      DBUG_PRINT("debug", ("pack_ptr: 0x%lx", pack_ptr));
>>        null_mask <<= 1;
>>      }
>>    }
>> @@ -288,6 +270,8 @@ unpack_row(RELAY_LOG_INFO const *rli,
>>      really wrong.
>>     */
>>    DBUG_ASSERT(null_ptr == row_data + master_null_byte_count);
>> +
>> +  DBUG_DUMP("row_data", row_data, pack_ptr - row_data);
>>  
>>    *row_end = pack_ptr;
>>    if (master_reclength)
>> diff -Nrup a/sql/sql_show.cc b/sql/sql_show.cc
>> --- a/sql/sql_show.cc	2007-08-16 18:04:11 +02:00
>> +++ b/sql/sql_show.cc	2007-10-04 21:41:13 +02:00
>> @@ -29,6 +29,8 @@
>>  #include "event_data_objects.h"
>>  #include <my_dir.h>
>>  
>> +#define STR_OR_NIL(S) ((S) ? (S) : "<nil>")
>> +
>>  #ifdef WITH_PARTITION_STORAGE_ENGINE
>>  #include "ha_partition.h"
>>  #endif
>> @@ -3096,8 +3098,8 @@ int get_all_tables(THD *thd, TABLE_LIST 
>>    schema_table_idx= get_schema_table_idx(schema_table);
>>    get_lookup_field_values(thd, cond, tables, &lookup_field_vals);
>>    DBUG_PRINT("INDEX VALUES",("db_name='%s', table_name='%s'",
>> -                             lookup_field_vals.db_value.str,
>> -                             lookup_field_vals.table_value.str));
>> +                             STR_OR_NIL(lookup_field_vals.db_value.str),
>> +                             STR_OR_NIL(lookup_field_vals.table_value.str)));
>>  
>>    if (!lookup_field_vals.wild_db_value &&
> !lookup_field_vals.wild_table_value)
>>    {
>>
>> -- 
>> MySQL Code Commits Mailing List
>> For list archives: http://lists.mysql.com/commits
>> To unsubscribe:    http://lists.mysql.com/commits?unsub=1
>>
>>     
>
> regards,
>
>   


-- 
Mats Kindahl
Lead Software Developer
Replication Team
MySQL AB, www.mysql.com


Thread
bk commit into 5.1 tree (mats:1.2571) BUG#29549Mats Kindahl4 Oct
  • Re: bk commit into 5.1 tree (mats:1.2571) BUG#29549Andrei Elkin5 Oct
    • Re: bk commit into 5.1 tree (mats:1.2571) BUG#29549Mats Kindahl5 Oct