提交 c11b7c64 authored 作者: Thomas Mueller's avatar Thomas Mueller

--no commit message

--no commit message
上级 032cba61
......@@ -3201,7 +3201,7 @@ public class Parser {
readIf("CHAR");
if (dataType.supportsScale) {
if (readIf(",")) {
scale = getPositiveInt();
scale = getInt();
original += ", " + scale;
} else {
scale = 0;
......
......@@ -66,7 +66,7 @@ public class MathUtils {
public static BigDecimal setScale(BigDecimal bd, int scale) throws SQLException {
if (scale > Constants.BIG_DECIMAL_SCALE_MAX) {
throw Message.getInvalidValueException("" + scale, "scale");
} else if (scale < 0) {
} else if (scale < -Constants.BIG_DECIMAL_SCALE_MAX) {
throw Message.getInvalidValueException("" + scale, "scale");
}
return bd.setScale(scale, BigDecimal.ROUND_HALF_UP);
......
......@@ -46,6 +46,9 @@ public class StringUtils {
}
public static String quoteStringSQL(String s) {
if (s == null) {
return "NULL";
}
StringBuffer buff = new StringBuffer(s.length() + 2);
buff.append('\'');
for (int i = 0; i < s.length(); i++) {
......
......@@ -160,6 +160,8 @@ java org.h2.test.TestAll timer
/*
create table test(d number(1, -84));
MySQL:
CREATE TABLE user (
id int(25) NOT NULL auto_increment,
......@@ -250,6 +252,8 @@ http://www.w3schools.com/sql/
History:
Roadmap:
Negative scale values for DECIMAL or NUMBER columns are not supported
in regular tables and in linked tables.
*/
if (args.length > 0) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论