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

SQL语句中存在注释, 解析存在问题 #116

Closed
xiyangxixian opened this issue Nov 21, 2018 · 1 comment
Closed

SQL语句中存在注释, 解析存在问题 #116

xiyangxixian opened this issue Nov 21, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@xiyangxixian
Copy link
Collaborator

原SQL语句:

select
*
-- comment
from tb
where col = 1;

结果:

Query: 1E82204137DA4CA4

★ ★ ★ ★ ☆ 95分

SELECT  
  *

不建议使用SELECT * 类型查询

  • Item: COL.001

  • Severity: L1

  • Content: 当表结构变更时,使用*通配符选择所有列将导致查询的含义和行为会发生更改,可能导致查询返回更多的数据。

Query: 12FBD9CEB5E1C0D9

★ ★ ★ ★ ★ 100分

FROM  
  tb
 
WHERE  
  col  = 1

OK

@martianzhang martianzhang added the bug Something isn't working label Nov 21, 2018
@martianzhang
Copy link
Contributor

select * from
-- comment
tb;
select col from tb where col = 1;

two SQLs merge into one

@martianzhang martianzhang reopened this Nov 23, 2018
martianzhang added a commit that referenced this issue Nov 23, 2018
  single line comment in sql will merge next line into before one.
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