Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持下mysql5.7 json类型解析 #187

Closed
agapple opened this issue Jun 14, 2016 · 3 comments
Closed

支持下mysql5.7 json类型解析 #187

agapple opened this issue Jun 14, 2016 · 3 comments
Labels
Milestone

Comments

@agapple
Copy link
Member

agapple commented Jun 14, 2016

RT. 支持下mysql5.7

@agapple
Copy link
Member Author

agapple commented Jun 30, 2016

测试数据格式:

+-----+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| uid | data                                                                                                                                                            |
+-----+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+
|   1 | {"mail": "jiangchengyao@gmail.com", "name": "David", "address": "Shangahai"}                                                                                    |
|   2 | {"mail": "test"}                                                                                                                                                |
|   3 | {"int": 1, "bool": true, "long1": 4294967296, "long2": 1.8446744073709552e19, "double": 1.11012}                                                                |
|   4 | {"mail": [1, true, 1.11012, 4294967296, 1.8446744073709552e19]}                                                                                                 |
|   5 | {"int": 1, "bool": true, "mail": [1, true, 1.11012, 4294967296, 1.8446744073709552e19], "long1": 4294967296, "long2": 1.8446744073709552e19, "double": 1.11012} |
|   6 | {"time": "23:59:59"}                                                                                                                                            |
|   7 | {"time": "2016-06-30 15:03:32.000000"}                                                                                                                          |
|   8 | {"time": "2016-06-30 15:51:25.041000"}                                                                                                                          |
|   9 | {"time": 123.123}                                                                                                                                               |
|  10 | {"time": "23:23:23:19"}                                                                                                                                         |
|  11 | {"time": "01:00:05.000000"}                                                                                                                                     |
|  12 | {"time": "630:19:29.000000"}                                                                                                                                    |
|  13 | {"time": "2016-06-30 16:08:58.000000"}                                                                                                                          |
|  14 | {"n1": "v1", "ne1": {"n2": "v2", "ne2": {"n3": "v3", "n32": ["v32", "v33", 1]}}}                                                                                |
+-----+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+

@agapple agapple added this to the v1.0.22 milestone Jun 30, 2016
agapple added a commit that referenced this issue Jun 30, 2016
@agapple agapple closed this as completed Jun 30, 2016
@yufeng0528
Copy link

yufeng0528 commented Mar 18, 2017

有个bug在1.0.23下
com.alibaba.otter.canal.parse.exception.CanalParseException: parse row data failed. Caused by: com.alibaba.otter.canal.parse.exception.CanalParseException: parse row data failed. Caused by: java.lang.IllegalArgumentException: illegal json data at com.taobao.tddl.dbsync.binlog.JsonConversion.parse_scalar(JsonConversion.java:150) at com.taobao.tddl.dbsync.binlog.JsonConversion.parse_value(JsonConversion.java:67)

数据库版本 mysql-5.7.11-winx64
数据库结构
CREATE TABLE customer_data (
id bigint(19) unsigned NOT NULL AUTO_INCREMENT,
supplier_id bigint(19) unsigned NOT NULL COMMENT '商户id',
customer_id bigint(19) unsigned NOT NULL,
customer_data json DEFAULT NULL COMMENT '顾客标准属性',
customer_ext_data json DEFAULT NULL COMMENT '顾客扩展属性',
PRIMARY KEY (id),
UNIQUE KEY uk_cust (customer_id)
) ENGINE=InnoDB AUTO_INCREMENT=26036 DEFAULT CHARSET=utf8mb4;

debug后就是149行str_len==0 @agapple

@agapple
Copy link
Member Author

agapple commented Mar 20, 2017

给出你测试的json字符串

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants