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

binlog2sql解析日志shell命令参数拼接bug #1635

Closed
1 task
lidonghai11 opened this issue Jun 19, 2022 · 1 comment
Closed
1 task

binlog2sql解析日志shell命令参数拼接bug #1635

lidonghai11 opened this issue Jun 19, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@lidonghai11
Copy link

问题是否已经被报告?

  • 我已经搜索了当前存在的问题

重现步骤

##sql/plugins/binglog2sql.py中

def generate_args2cmd(self, args, shell):
"""
转换请求参数为命令行
:param args:
:param shell:
:return:
"""
conn_options = ['conn_options']
parse_mode_options = ['stop-never', 'no-primary-key', 'flashback']
range_options = ['back-interval', 'start-file', 'start-position', 'stop-file', 'stop-position',
'start-datetime', 'stop-datetime']
filter_options = ['databases', 'tables', 'only-dml', 'sql-type']
if shell:
cmd_args = f'python {shlex.quote(str(self.path))}' if self.path else ''
for name, value in args.items():
if name in conn_options:
cmd_args += f' {value}'
elif name in parse_mode_options and value:
cmd_args += f' --{name}'
elif name in range_options and value:
cmd_args += f" --{name}='{shlex.quote(str(value))}'"
elif name in filter_options and value:
if name == 'only-dml':
cmd_args += f' --{name}'
elif name == 'sql-type':
cmd_args += f' --{name} {value}'
else:
cmd_args += f' --{name} {shlex.quote(str(value))}'

注: cmd_args += f' --{name} {shlex.quote(str(value))}' 这句拼接的shell命令对参数加了单引号,binlog2sql无法识别,不能正常执行

预期外的结果

不需要

日志文本

不需要

版本

1.8.5

部署方式

手工部署

是否还有其他可以辅助定位问题的信息?比如数据库、浏览器、goInception等

不需要

@lidonghai11 lidonghai11 added the bug Something isn't working label Jun 19, 2022
@hhyo
Copy link
Owner

hhyo commented Jun 19, 2022

感谢反馈,近期将移除该依赖 #1636, 推荐使用my2sql进行解析

@hhyo hhyo closed this as not planned Won't fix, can't repro, duplicate, stale Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants