环境信息
canal version 1.1.3 mysql version 5.7
问题描述
{ "data": [], "database": "XXX", "es": 1577088014000, "id": 1233420, "isDdl": false, "mysqlType": { "ID": "BIGINT", "COMPANY_ID": "BIGINT", "PUNISH_OBJECT_ID": "BIGINT", "PUNISH_OBJECT": "VARCHAR(200)", "PUNISH_OBJECT_TYPE": "DOUBLE", "RELATION": "VARCHAR(200)", "TITLE": "VARCHAR(1500)", "CONTENT": "LONGTEXT", "NOTICE_DT": "DATETIME", "CASE_CATEGORY": "VARCHAR(60)", "NOTICE_WEBSITE": "VARCHAR(255)", "DECISION_DT": "DATETIME", "DECISION_GOV_ID": "BIGINT", "DECISION_GOV": "VARCHAR(300)", "REF_NUMBER": "VARCHAR(255)", "PUNISH_TYPE": "VARCHAR(1000)", "PENALTY_BASIS": "LONGTEXT", "PENALTY_REASON": "LONGTEXT", "PENALTY_RESULT": "LONGTEXT", "PUNISH_AMT": "DECIMAL(24,6)", "PENALTY_COMMENT": "LONGTEXT", "IS_DEL": "INTEGER", "CREATE_DT": "DATETIME(6)", "UPDT_DT": "DATETIME(6)" }, "old": null, "pkNames": ["ID"], "sql": "", "sqlType": { "ID": -5, "COMPANY_ID": -5, "PUNISH_OBJECT_ID": -5, "PUNISH_OBJECT": 12, "PUNISH_OBJECT_TYPE": 8, "RELATION": 12, "TITLE": 12, "CONTENT": 2005, "NOTICE_DT": 93, "CASE_CATEGORY": 12, "NOTICE_WEBSITE": 12, "DECISION_DT": 93, "DECISION_GOV_ID": -5, "DECISION_GOV": 12, "REF_NUMBER": 12, "PUNISH_TYPE": 12, "PENALTY_BASIS": 2005, "PENALTY_REASON": 2005, "PENALTY_RESULT": -4, "PUNISH_AMT": 3, "PENALTY_COMMENT": -4, "IS_DEL": 4, "CREATE_DT": 93, "UPDT_DT": 93 }, "table": "XXX", "ts": 1577088012412, "type": "INSERT" }
字段在mysql 中为 text 或 longtext类型, 但是canal解析对应的标准sql类型变成了LONGVARBINARY(-4),在canal-adapter解析时当作byte[] 来解析字段数据(实际上字段数据人String), 导致乱码
期待结果
mysql 中 text/longtext 对应为 clob类型 ,字段内容当作String处理
现执行情况
mysql 中 text/longtext 被解析为 LONGVARBINARY类型,字段内容被当作byte[] 来解析字段数据(实际上字段数据人String), 导致乱码
原提问者GitHub用户flackyang
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。