add alter table modify limit: Cannot change DATETIME to DATE (#1963)

This commit is contained in:
xionglei0
2019-10-12 19:11:17 +08:00
committed by lichaoyong
parent 7370b44ab2
commit ce236bfcd4

View File

@ -260,6 +260,10 @@ public class Column implements Writable {
}
}
if (getDataType() == PrimitiveType.DATETIME && other.getDataType() == PrimitiveType.DATE) {
throw new DdlException("Cannot change from DATETIME to DATE");
}
if (this.getPrecision() != other.getPrecision()) {
throw new DdlException("Cannot change precision");
}