bug fixed for issue #2114

This commit is contained in:
wenshao
2017-12-01 22:56:40 +08:00
parent a18d4122c5
commit fd2ba2a290
@@ -20,7 +20,9 @@ import com.alibaba.druid.sql.ast.SQLObject;
import com.alibaba.druid.sql.visitor.SQLASTVisitor;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SQLVariantRefExpr extends SQLExprImpl {
@@ -128,6 +130,21 @@ public class SQLVariantRefExpr extends SQLExprImpl {
public SQLVariantRefExpr clone() {
SQLVariantRefExpr var = new SQLVariantRefExpr(name, global);
var.index = index;
if (attributes != null) {
var.attributes = new HashMap<String, Object>(attributes.size());
for (Map.Entry<String, Object> entry : attributes.entrySet()) {
String k = entry.getKey();
Object v = entry.getValue();
if (v instanceof SQLObject) {
var.attributes.put(k, ((SQLObject) v).clone());
} else {
var.attributes.put(k, v);
}
}
}
return var;
}