This commit is contained in:
tiger.yan
2019-03-18 14:13:22 +08:00
committed by GitHub
parent 24674b31ea
commit 6d9aec3cbe

View File

@@ -126,7 +126,11 @@ public class JoinNode extends PlanNode {
Item bf = joinFilter.get(index);
bf = setUpItem(bf);
if (bf.getReferTables().size() == 1) {
throw new MySQLOutPutException(ErrorCode.ER_NONUNIQ_TABLE, "42000", "Not unique table/alias: '" + this.getLeftNode().getPureName() + "'");
if (bf.getReferTables().iterator().next().type() == PlanNodeType.TABLE) {
throw new MySQLOutPutException(ErrorCode.ER_NONUNIQ_TABLE, "42000", "Not unique table/alias: '" + this.getLeftNode().getPureName() + "'");
} else {
throw new MySQLOutPutException(ErrorCode.ER_PARSE_ERROR, "42000", "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '" + bf.toString() + "'");
}
}
joinFilter.set(index, (ItemFuncEqual) bf);
}