提交 688d527c authored 作者: Thomas Mueller's avatar Thomas Mueller

CAST('011' AS INT) will no longer use decode the value as an octal number (using…

CAST('011' AS INT) will no longer use decode the value as an octal number (using Integer.decode) but now use Integer.parseInt. The same logic applied to byte, short, and long.
上级 c3344503
......@@ -741,13 +741,13 @@ public abstract class Value {
}
}
case BYTE:
return ValueByte.get(Byte.decode(s.trim()));
return ValueByte.get(Byte.parseByte(s.trim()));
case SHORT:
return ValueShort.get(Short.decode(s.trim()));
return ValueShort.get(Short.parseShort(s.trim()));
case INT:
return ValueInt.get(Integer.decode(s.trim()));
return ValueInt.get(Integer.parseInt(s.trim()));
case LONG:
return ValueLong.get(Long.decode(s.trim()));
return ValueLong.get(Long.parseLong(s.trim()));
case DECIMAL:
return ValueDecimal.get(new BigDecimal(s.trim()));
case TIME:
......
select cast(' 011 ' as int);
> 11;
select E'test\\test';
> test\test;
create table a(id int) as select null;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论