Unverified 提交 c6f12e1c authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov 提交者: GitHub

Merge pull request #1381 from katzyn/misc

Minor fixes for INTERVAL data type
...@@ -2244,7 +2244,7 @@ intType | booleanType | tinyintType | smallintType | bigintType | identityType ...@@ -2244,7 +2244,7 @@ intType | booleanType | tinyintType | smallintType | bigintType | identityType
| decimalType | doubleType | realType | dateType | timeType | timestampType | decimalType | doubleType | realType | dateType | timeType | timestampType
| timestampWithTimeZoneType | binaryType | otherType | varcharType | timestampWithTimeZoneType | binaryType | otherType | varcharType
| varcharIgnorecaseType | charType | blobType | clobType | uuidType | varcharIgnorecaseType | charType | blobType | clobType | uuidType
| arrayType | enumType | arrayType | enumType | intervalType
"," ","
A data type definition. A data type definition.
"," ","
...@@ -3048,7 +3048,7 @@ and ""ResultSet.getObject(..)"" or ""ResultSet.getString(..)"" to retrieve the v ...@@ -3048,7 +3048,7 @@ and ""ResultSet.getObject(..)"" or ""ResultSet.getString(..)"" to retrieve the v
GEOMETRY GEOMETRY
" "
"Data Types","INTERVAL Types"," "Data Types","INTERVAL Type","
intervalYearType | intervalMonthType | intervalDayType intervalYearType | intervalMonthType | intervalDayType
| intervalHourType| intervalMinuteType | intervalSecondType | intervalHourType| intervalMinuteType | intervalSecondType
| intervalYearToMonthType | intervalDayToHourType | intervalYearToMonthType | intervalDayToHourType
...@@ -3056,8 +3056,8 @@ intervalYearType | intervalMonthType | intervalDayType ...@@ -3056,8 +3056,8 @@ intervalYearType | intervalMonthType | intervalDayType
| intervalHourToMinuteType | intervalHourToSecondType | intervalHourToMinuteType | intervalHourToSecondType
| intervalMinuteToSecondType | intervalMinuteToSecondType
"," ","
Interval data types. Interval data type.
There are two classes of intervals. Year-month intervals can store years or months. There are two classes of intervals. Year-month intervals can store years and months.
Day-time intervals can store days, hours, minutes, and seconds. Day-time intervals can store days, hours, minutes, and seconds.
Year-month intervals are comparable only with another year-month intervals. Year-month intervals are comparable only with another year-month intervals.
Day-time intervals are comparable only with another day-time intervals. Day-time intervals are comparable only with another day-time intervals.
......
...@@ -1285,7 +1285,11 @@ public abstract class Value { ...@@ -1285,7 +1285,11 @@ public abstract class Value {
if (JdbcUtils.customDataTypesHandler != null) { if (JdbcUtils.customDataTypesHandler != null) {
return JdbcUtils.customDataTypesHandler.convert(this, targetType); return JdbcUtils.customDataTypesHandler.convert(this, targetType);
} }
throw DbException.throwInternalError("type=" + targetType); DataType from = DataType.getDataType(getType());
DataType to = DataType.getDataType(targetType);
throw DbException.get(ErrorCode.DATA_CONVERSION_ERROR_1,
(from != null ? from.name : "type=" + getType()) + " to "
+ (to != null ? to.name : "type=" + targetType));
} }
} catch (NumberFormatException e) { } catch (NumberFormatException e) {
throw DbException.get( throw DbException.get(
......
...@@ -527,13 +527,11 @@ public class TestCrashAPI extends TestDb implements Runnable { ...@@ -527,13 +527,11 @@ public class TestCrashAPI extends TestDb implements Runnable {
private void initMethods() { private void initMethods() {
for (Class<?> inter : INTERFACES) { for (Class<?> inter : INTERFACES) {
classMethods.put(inter, new ArrayList<Method>()); ArrayList<Method> list = new ArrayList<>();
}
for (Class<?> inter : INTERFACES) {
ArrayList<Method> list = classMethods.get(inter);
for (Method m : inter.getMethods()) { for (Method m : inter.getMethods()) {
list.add(m); list.add(m);
} }
classMethods.put(inter, list);
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论