mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for issue #2114
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user