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

1.2.5-23中masking功能里index不重复 #436

Closed
unknowissue opened this issue Mar 7, 2022 · 2 comments
Closed

1.2.5-23中masking功能里index不重复 #436

unknowissue opened this issue Mar 7, 2022 · 2 comments

Comments

@unknowissue
Copy link

描述
辛苦您对于masking功能的支持,现在有个小问题

在1.2.5-10中是

[{"index":0,"field":"id","type":"int","table":"users","schema":"db1","alias":"concat(id,phone)"},{"index":0,"field":"phone","type":"varchar(80)","table":"users","schema":"db1","alias":"concat(id,phone)"}] 

在1.2.5-23中是

 [{"index":0,"field":"id","type":"int","table":"users","schema":"db1","alias":"concat(id,phone)"},{"index":1,"field":"phone","type":"varchar(80)","table":"users","schema":"db1","alias":"concat(id,phone)"}]

看起来不符合我们的预期。。。
index: 列索引,标识为第几列,可能重复(如函数引用了多列时)

重现
模拟重现的步骤

#!/usr/bin/env python3
# -*- coding:utf-8 -*-
import pymysql
import prettytable as pt
tb = pt.PrettyTable()
sql = '''/*--user=xx;--password=xxxxx;--host=xx;--port=3308;--masking=1;*/
                          inception_magic_start;
                          use `db1`;
                          select concat(id,phone) from  users ;
                          inception_magic_commit;'''
conn = pymysql.connect(host='127.0.0.1', user='', passwd='',
                       db='', port=4000, charset="utf8mb4")
cur = conn.cursor()
ret = cur.execute(sql)
result = cur.fetchall()
print(result)
cur.close()
conn.close()
tb.field_names = [i[0] for i in cur.description]
for row in result:
    tb.add_row(row)
print(tb)

环境

  • 数据库: [mysql/mariadb]
  • 版本: [例如 5.7.21]

参数
可能与问题相关的设置参数

@hanchuanchuan
Copy link
Owner

已更新版本 v1.2.5-29 ,请升级后重试。
关联修复 #429

@unknowissue
Copy link
Author

可以了,辛苦啦,谢谢!

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

No branches or pull requests

2 participants