We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
MYSQL
5.7
1.2.24
OPENjdk 8
select a.name1, b.* from (select id , name1 from a) a join (select b.id , name2 from b) b on a.id = b.id 对于该SQL使用如下代码把b.*进行处理的时候出现解析结果不符合实际情况
select a.name1, b.* from (select id , name1 from a) a join (select b.id , name2 from b) b on a.id = b.id
SQLStatement stmt = SQLUtils.parseSingleStatement(sql, DbType.mysql); repository.resolve(stmt, ResolveAllColumn, ResolveIdentifierAlias); System.out.println(stmt.toString());
SQLStatement stmt = SQLUtils.parseSingleStatement(sql, DbType.mysql);
repository.resolve(stmt, ResolveAllColumn, ResolveIdentifierAlias);
System.out.println(stmt.toString());
控制台输出的结果为
SELECT a.name1, a.id, b.name2 FROM ( SELECT id, name1 FROM a ) a JOIN ( SELECT b.id, name2 FROM b ) b ON a.id = b.id
正确的结果应该是
SELECT a.name1, b.id, b.name2 FROM ( SELECT id, name1 FROM a ) a JOIN ( SELECT b.id, name2 FROM b ) b ON a.id = b.id
我认为这是一个SQL解析的BUG
No response
The text was updated successfully, but these errors were encountered:
fix issues:alibaba#6209
d7550cc
No branches or pull requests
Database Type
MYSQL
Database Version
5.7
Druid Version
1.2.24
JDK Version
OPENjdk 8
Error SQL
select a.name1, b.* from (select id , name1 from a) a join (select b.id , name2 from b) b on a.id = b.id
对于该SQL使用如下代码把b.*进行处理的时候出现解析结果不符合实际情况
SQLStatement stmt = SQLUtils.parseSingleStatement(sql, DbType.mysql);
repository.resolve(stmt, ResolveAllColumn, ResolveIdentifierAlias);
System.out.println(stmt.toString());
控制台输出的结果为
正确的结果应该是
我认为这是一个SQL解析的BUG
Testcase Code
No response
Stacktrace Info
No response
Error Info
No response
The text was updated successfully, but these errors were encountered: