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

脚本中存在大量空格和换行导致脚本解析错误,是否可以在解析前去除空格和换行 #5686

Closed
greenhand520 opened this issue Sep 28, 2023 · 11 comments

Comments

@greenhand520
Copy link

当前使用版本(必填,否则不予处理)

版本:3.5.3.2

该问题是如何引起的?(确定最新版也有问题再提!!!)

脚本中存在大量空格和换行导致脚本解析错误,是否可以在解析前去除空格和换行
image

重现步骤(如果有就写完整)

报错信息

image

@nieqiurong
Copy link
Contributor

是自己编写的sql吗?

@qmdx
Copy link
Member

qmdx commented Sep 28, 2023

无法定位你的问题,给出详细的重现代码

@tanqiyuan
Copy link

我也遇到了,退回3.5.3.1就没有问题了, 而且3.5.3.2很多SQL查询速度都比3.5.3.1慢非常多

@QuillVot
Copy link

QuillVot commented Oct 9, 2023

能否给个能重现问题的dome

@nieqiurong
Copy link
Contributor

如果是自己业务代码里面有空格可以尝试开启.

mybatis-plus:
  configuration:
    shrink-whitespaces-in-sql: true

@nieqiurong
Copy link
Contributor

#5345

@yoyo-520
Copy link

#5345

麻烦问下,下个版本会修复这个问题嘛?

@pansong291
Copy link

类似这样?
JSQLParser/JSqlParser#1988

@pansong291
Copy link

如果是自己业务代码里面有空格可以尝试开启.

mybatis-plus:
  configuration:
    shrink-whitespaces-in-sql: true

@nieqiurong 请教一下这个会不会把数据里的空行给替换了?比如:

update shop_info set title=?,



content='abc



def'
where id=?

@gantrylau
Copy link

如果是自己业务代码里面有空格可以尝试开启.

mybatis-plus:
  configuration:
    shrink-whitespaces-in-sql: true

@nieqiurong 请教一下这个会不会把数据里的空行给替换了?比如:

update shop_info set title=?,



content='abc



def'
where id=?

实测会替换

@nieqiurong
Copy link
Contributor

自3.5.3.2开始,内置注入已经处理多余的换行.

#6187

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

No branches or pull requests

8 participants