@@ -701,6 +701,41 @@ func (t *testParserSuite) TestMinimalUpdate(c *C) {
701701
702702}
703703
704+ func (t * testParserSuite ) TestTextMax (c * C ) {
705+ t .setupTest (c , mysql .MySQLFlavor )
706+
707+ id := 100
708+
709+ // 65536 = 64k
710+ value := strings .Repeat ("a" , 1024 * 1024 * 10 )
711+
712+ t .testExecute (c , `RESET MASTER;` ,
713+ `DROP TABLE IF EXISTS test_long_text` ,
714+ `CREATE TABLE test_long_text (
715+ id BIGINT(64) UNSIGNED NOT NULL AUTO_INCREMENT,
716+ c1 longtext,
717+ PRIMARY KEY (id)
718+ ) ENGINE=InnoDB` ,
719+ fmt .Sprintf (`INSERT INTO test_long_text (id, c1) VALUES (%d, "")` , id ),
720+ fmt .Sprintf (`UPDATE test_long_text SET c1 = '%s' WHERE id = %d` , value , id ),
721+ fmt .Sprintf (`DELETE FROM test_long_text WHERE id = %d` , id ))
722+
723+ t .checkBinlog (c ,
724+ "INSERT INTO `test`.`test_long_text`(`id`,`c1`) VALUES(100,'');" ,
725+ fmt .Sprintf ("UPDATE `test`.`test_long_text` SET `id`=100, `c1`='%s' WHERE `id`=100;" , value ),
726+ "DELETE FROM `test`.`test_long_text` WHERE `id`=100;" ,
727+ )
728+
729+ t .SetFlashback (true )
730+ t .SetMinimalUpdate (true )
731+ t .checkBinlog (c ,
732+ "DELETE FROM `test`.`test_long_text` WHERE `id`=100;" ,
733+ "UPDATE `test`.`test_long_text` SET `c1`='' WHERE `id`=100;" ,
734+ fmt .Sprintf ("INSERT INTO `test`.`test_long_text`(`id`,`c1`) VALUES(100,'%s');" , value ),
735+ )
736+
737+ }
738+
704739func (t * testParserSuite ) TestUpdate2Null (c * C ) {
705740 t .setupTest (c , mysql .MySQLFlavor )
706741
@@ -761,6 +796,7 @@ func (t *testParserSuite) TestThreadID(c *C) {
761796 t .setupTest (c , mysql .MySQLFlavor )
762797
763798 t .testExecute (c , `RESET MASTER;` ,
799+ `DROP TABLE IF EXISTS test_simple` ,
764800 `DROP TABLE IF EXISTS test_simple` ,
765801 `CREATE TABLE test_simple (
766802 id BIGINT(64) UNSIGNED NOT NULL AUTO_INCREMENT,
@@ -1100,6 +1136,11 @@ func (t *testParserSuite) initTableSchema(tableName ...string) {
11001136 c2 int,
11011137 PRIMARY KEY (id)
11021138 ) ENGINE=InnoDB` ,
1139+ "test_long_text" : `CREATE TABLE test_long_text (
1140+ id BIGINT(64) UNSIGNED NOT NULL AUTO_INCREMENT,
1141+ c1 longtext,
1142+ PRIMARY KEY (id)
1143+ ) ENGINE=InnoDB` ,
11031144 }
11041145
11051146 var tables []string
0 commit comments