hapyrus/mysql-replication-listener — pull request #12 by makinada (2014-11-07 03:09:24+00:00)
Title: @T1092:R Added support for long char whose length is more than 255 bytes...

.... This happens if the column's character encoding is set to UTF8 and the column length is set to 86 or more (86 * 3 = 258)

Tested with the following table. Column "test" is a long char column which uses 2 byte for string length. Column "smallchar" is a regular char column which uses 1 byte for string length.

```
-- MySQL dump 10.13 Distrib 5.6.17, for debian-linux-gnu (x86_64)
--
-- Host: rdss.c6dj7ech9e6t.us-east-1.rds.amazonaws.com Database: synctest
-- ------------------------------------------------------
-- Server version	5.6.21-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `chartest`
--

DROP TABLE IF EXISTS `chartest`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `chartest` (
`test` char(200) CHARACTER SET utf8 DEFAULT NULL,
`smallchar` char(10) DEFAULT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2014-11-07 3:03:09
```
With this fix, an insert record looks like this. Note that the values have been set correctly.
```
{"row":{"1":"g1","2":"g2","3":"0SL00000007"},"type":"insert","respect_order":true,"table_name":"chartest","src_pos":"mysql-bin-changelog.000582\t249","table_rev":2,"seq":9}
```