Skip to content

Commit

Permalink
Merge pull request actiontech#932 from actiontech/issue_931
Browse files Browse the repository at this point in the history
actiontech#931 const item same with other item actiontech#865
  • Loading branch information
yanhuqing666 authored Jan 17, 2019
2 parents 296e3e0 + 4b4d309 commit a0cd8d1
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 4 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/actiontech/dble/plan/node/JoinNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,11 @@ public String getPureName() {
return null;
}

@Override
public String getPureSchema() {
return null;
}

/**
* exchangeLeftAndRight
*/
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/actiontech/dble/plan/node/MergeNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ public String getPureName() {
return null;
}

@Override
public String getPureSchema() {
return null;
}

public boolean isUnion() {
return union;
}
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/actiontech/dble/plan/node/NoNameNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ public String getPureName() {
return "";
}

@Override
public String getPureSchema() {
return "";
}


public String getCatalog() {
return this.catalog;
Expand Down
15 changes: 11 additions & 4 deletions src/main/java/com/actiontech/dble/plan/node/PlanNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ public List<Item> load(PlanNode tn) {

public abstract String getPureName();

public abstract String getPureSchema();

/* height of node */
public abstract int getHeight();

Expand Down Expand Up @@ -449,9 +451,14 @@ protected void dealStarColumn() {
}

private NamedField makeOutNamedField(Item sel) {
String schema = null;
if (keepFieldSchema && sel instanceof ItemIdent) {
schema = ((ItemIdent) sel).getDbName();
String tmpSchema = null;
if (keepFieldSchema) {
if (sel instanceof ItemIdent) {
tmpSchema = ((ItemIdent) sel).getDbName();
}
if (sel.basicConstItem()) {
tmpSchema = getPureSchema();
}
}
String tmpFieldTable = sel.getTableName();
String tmpFieldName = sel.getItemName();
Expand All @@ -461,7 +468,7 @@ private NamedField makeOutNamedField(Item sel) {
tmpFieldTable = getPureName();
if (sel.getAlias() != null)
tmpFieldName = sel.getAlias();
return new NamedField(schema, tmpFieldTable, tmpFieldName, this);
return new NamedField(tmpSchema, tmpFieldTable, tmpFieldName, this);
}

Item setUpItem(Item sel) {
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/actiontech/dble/plan/node/QueryNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ public String getPureName() {
return this.getChild().getAlias();
}

@Override
public String getPureSchema() {
return this.getChild().getPureSchema();
}

@Override
public QueryNode copy() {
QueryNode newTableNode = new QueryNode(this.getChild().copy());
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/actiontech/dble/plan/node/TableNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@ public String getPureName() {
return this.getTableName();
}

@Override
public String getPureSchema() {
return this.getSchema();
}

public String getSchema() {
return this.schema;
}
Expand Down

0 comments on commit a0cd8d1

Please sign in to comment.