mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for SQLUtils.format mysql sharding sql.
This commit is contained in:
@@ -189,7 +189,7 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
}
|
||||
|
||||
public boolean isShardingSupport() {
|
||||
return shardingSupport;
|
||||
return parameterized && shardingSupport;
|
||||
}
|
||||
|
||||
public void setShardingSupport(boolean shardingSupport) {
|
||||
|
||||
@@ -631,7 +631,7 @@ public class SQLASTOutputVisitor extends SQLASTVisitorAdapter implements Paramet
|
||||
}
|
||||
|
||||
private boolean printName(SQLName x, String name) {
|
||||
boolean shardingSupport = this.shardingSupport;
|
||||
boolean shardingSupport = this.shardingSupport && parameterized;
|
||||
if (shardingSupport) {
|
||||
SQLObject parent = x.getParent();
|
||||
shardingSupport = parent instanceof SQLExprTableSource || parent instanceof SQLPropertyExpr;
|
||||
|
||||
Reference in New Issue
Block a user