-
Notifications
You must be signed in to change notification settings - Fork 31
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
对bigint数据类型支持好像有问题 #2
Comments
if dtype == 'bigint':
_t = struct.unpack('>Q',bdata[:8])[0]
return (_t&((1<<63)-1)) if _t&(1<<63) else -(_t&((1<<63)-1))
(venv) 09:46:47 [root@ddcw21 innodb_parse]#python main.py --ddl --sql /data/mysql_3314/mysqldata/db1/t20230820.ibd
CREATE Table db1.t20230820(
id int NOT NULL ,
aa bigint NULL ,
PRIMARY KEY(id)) ENGINE=InnoDB ;
insert into db1.t20230820 values("1","1");
insert into db1.t20230820 values("111111111","11111111111111");
(venv) 09:47:36 [root@ddcw21 innodb_parse]# |
感谢🙏 |
请问下能字段备注和表备注,默认值这些能处理吗?现在的 sql不是很标准,有这些属性的话 |
我今天发现tinyint类型数据解析的数据有问题,tinyint类型数据 0,解析后是 字符串128 |
(venv) 18:57:56 [root@ddcw21 innodb_parse]#python main.py --ddl /data/mysql_3314/mysqldata/db1/t20230821_2.ibd
CREATE Table db1.t20230821_2(
id int NOT NULL ,
id2 tinyint NULL test tiny int,
id3 year NULL ,
PRIMARY KEY(id)) ENGINE=InnoDB test ibd2sql; |
好的,了解😀 |
我刚试了下, tinyint的数据 未做符号判断,(其它的也没做符号判断, 但都是当作有符号来解析的,), 下一个版本再做符号判断吧... if dtype == 'tinyint':
tdata = struct.unpack('>B',bdata)[0]
return -(128-tdata) if tdata < 128 else tdata -128 效果: (venv) 17:32:18 [root@ddcw21 innodb_parse]#python main.py --sql /data/mysql_3314/mysqldata/db1/t20230825.ibd
insert into db1.t20230825 values("1","-2");
insert into db1.t20230825 values("2","-1");
insert into db1.t20230825 values("3","0");
insert into db1.t20230825 values("4","1");
insert into db1.t20230825 values("5","2");
(venv) 17:32:19 [root@ddcw21 innodb_parse]# |
bigint类型数据做ddl里是正常能解析出来的,但是在数据里bigint类型数据都是None,而且主键字段好像也没有生成ddl标识,可以优化吗
The text was updated successfully, but these errors were encountered: