-
Notifications
You must be signed in to change notification settings - Fork 72
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
mysql 8 ,备份包含json字段的表时报错 #46
Comments
该报错是解析JSON格式出错的, 有两种可能,
data = None # 设置该字段数据为空 如果其余数据能正常解析, 则说明是第二种情况 |
添加后,json内容导入数据库后,直接空了,数据丢了,大佬帮看下了 |
其它字段数据正常? 那就是第2种情况了. 可以任意发一条有问题的二进制json数据过来我看看. 目前没遇到过这种BUG(之前有个递归深度问题?) 在添加 |
b'\x00\x07\x00$\x025\x00\x04\x009\x00\x05\x00>\x00\x06\x00D\x00\x06\x00J\x00\x06\x00P\x00\x07\x00W\x00\x08\x00\x0c_\x00\x00g\x00\x00|\x00\x0c\xd6\x01\x0c\xe0\x01\x0c\xf7\x01\x02 \x02sortstyleconfigtypeIdvModelcontentunitList\x071505280\x01\x00\x15\x00\x0b\x00\x05\x00\x0c\x10\x00width\x04100%\x0f\x00Z\x01m\x00\x03\x00p\x00\x04\x00t\x00\x05\x00y\x00\x06\x00\x7f\x00\x07\x00\x86\x00\x07\x00\x8d\x00\x08\x00\x95\x00\t\x00\x9e\x00\t\x00\xa7\x00\x0b\x00\xb2\x00\x0b\x00\xbd\x00\x0c\x00\xc9\x00\x0c\x00\xd5\x00\r\x00\xe2\x00\x10\x00\x0c\xf2\x00\x05\x18\x00\x0c\xfc\x00\x0c\t\x01\x02 \x01\x0c$\x01\x04\x02\x00\x04\x02\x00\x0c)\x01\x04\x01\x00\x04\x02\x00\x0cM\x01\x04\x02\x00\x04\x02\x00\x04\x02\x00tagspanlabelformIdregListtagIconrequiredchangeTagrenderKeydisplayTypeshowRegListdefaultValueshowRequiredshowClearableshowDefaultValue\tdesc-text\x0c\xe6\x96\x87\xe5\xad\x97\xe6\x8f\x8f\xe8\xbf\xb0\x16desc_text1726131910633\x00\x00\x04\x00\x04text#desc_text17261319106331726131910633\x0c\xe6\x8f\x8f\xe8\xbf\xb0\xe6\x96\x87\xe5\xad\x97\tDESC_TEXT\x16desc_text1726131910633( 3.1\xe9\x9a\x8f\xe8\xae\xbf\xe6\x9c\x9f\xe9\x97\xb4\xe5\xba\xb7\xe5\xa4\x8d\xe6\x83\x85\xe5\x86\xb5\xe8\xb7\x9f\xe8\xb8\xaa \x00\x00\x04\x00'b'\x02\x00\x00\x04\x00' INSERT INTO survey-test .fm_form_item VALUES (1834470146360537089, 'CTi9RiN6', 'radio1701844190696', 'RADIO', '随访方式 ', 0, 0, 0, 1, NULL, 1, '此题为必填项目随访方式', 1048576, 24, NULL, NULL, 1764538963929927681, '1730159906595999745', '2024-9-13 13:52:20', '1765569689215361026', '2024-9-13 13:53:7');CREATE TABLE IF NOT EXISTS 你好大佬,这个就是打印出来的数据和建表语句以及正常能导入的部分。 |
获取ddl时将json转换为了blob类型导致的。重新建表,类型调整为json,然后通过表空间导入,可以了。 |
是指ibd2sql解析DDL的时候把json转为了blob吗? 上面给出的json数据格式是混乱的, 应该被平台转义了, 你可以给出如下格式,或者上传附件 b'\x00\x07\x00$\x025\x00\x04\x009\x00\x05\x00>\x00\' .... 既然表空间导入已经可以了, 也可以忽略 |
Traceback (most recent call last):
File "/root/ibd2sql-main/main.py", line 204, in
ddcw.get_sql()
File "/root/ibd2sql-main/ibd2sql/ibd2sql.py", line 256, in get_sql
for x in _tdata:
File "/root/ibd2sql-main/ibd2sql/innodb_page_index.py", line 359, in read_row
self._read_all_row()
File "/root/ibd2sql-main/ibd2sql/innodb_page_index.py", line 582, in _read_all_row
_data[colno],_expage[colno] = self._read_field(col)
File "/root/ibd2sql-main/ibd2sql/innodb_page_index.py", line 267, in _read_field
data = jsonob(_tdata[1:],int.from_bytes(_tdata[:1],'little')).init()
File "/root/ibd2sql-main/ibd2sql/mysql_json.py", line 201, in init
self.read_value()
File "/root/ibd2sql-main/ibd2sql/mysql_json.py", line 150, in read_value
value.append(_aa.init())
File "/root/ibd2sql-main/ibd2sql/mysql_json.py", line 193, in init
self.read_value()
File "/root/ibd2sql-main/ibd2sql/mysql_json.py", line 150, in read_value
value.append(_aa.init())
File "/root/ibd2sql-main/ibd2sql/mysql_json.py", line 201, in init
self.read_value()
File "/root/ibd2sql-main/ibd2sql/mysql_json.py", line 150, in read_value
value.append(_aa.init())
File "/root/ibd2sql-main/ibd2sql/mysql_json.py", line 193, in init
self.read_value()
File "/root/ibd2sql-main/ibd2sql/mysql_json.py", line 150, in read_value
value.append(_aa.init())
File "/root/ibd2sql-main/ibd2sql/mysql_json.py", line 192, in init
self.read_key()
File "/root/ibd2sql-main/ibd2sql/mysql_json.py", line 131, in read_key
key.append(self.bdata[x[0]:x[0]+x[1]].decode() )
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x90 in position 2: invalid start byte
The text was updated successfully, but these errors were encountered: