提交 06c8cb75 authored 作者: Max Englander's avatar Max Englander

enum-support: fix bad exception throw

上级 430b8de9
...@@ -377,7 +377,7 @@ public class Column { ...@@ -377,7 +377,7 @@ public class Column {
s = s.substring(0, 128) + "..."; s = s.substring(0, 128) + "...";
} }
throw DbException.get(ErrorCode.ENUM_VALUE_NOT_PERMITTED_1, throw DbException.get(ErrorCode.ENUM_VALUE_NOT_PERMITTED_1,
getCreateSQL(), s + " (" + value.getInt() + ")"); getCreateSQL(), s);
} }
value = ValueEnum.get(enumerators, value); value = ValueEnum.get(enumerators, value);
......
...@@ -448,7 +448,7 @@ public class TestPreparedStatement extends TestBase { ...@@ -448,7 +448,7 @@ public class TestPreparedStatement extends TestBase {
Statement stat = conn.createStatement(); Statement stat = conn.createStatement();
stat.execute("CREATE TABLE test_enum(size ENUM('small', 'medium', 'large'))"); stat.execute("CREATE TABLE test_enum(size ENUM('small', 'medium', 'large'))");
String[] badSizes = new String[]{"green", "wool", "discount"}; String[] badSizes = new String[]{"green", "smalll", "0"};
for (int i = 0; i < badSizes.length; i++) { for (int i = 0; i < badSizes.length; i++) {
PreparedStatement prep = conn.prepareStatement( PreparedStatement prep = conn.prepareStatement(
"INSERT INTO test_enum VALUES(?)"); "INSERT INTO test_enum VALUES(?)");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论