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

Merge pull request #1285 from katzyn/misc

Read nanoseconds of timestamps from old H2 versions properly and remove some dead code
...@@ -255,26 +255,10 @@ class MVSortedTempResult extends MVTempResult { ...@@ -255,26 +255,10 @@ class MVSortedTempResult extends MVTempResult {
@Override @Override
public int removeRow(Value[] values) { public int removeRow(Value[] values) {
assert parent == null; assert parent == null && distinct;
ValueArray key = getKey(values); // If an entry was removed decrement the counter
if (distinct) { if (map.remove(getKey(values)) != null) {
// If an entry was removed decrement the counter rowCount--;
if (map.remove(key) != null) {
rowCount--;
}
} else {
Long old = map.remove(key);
if (old != null) {
long l = old;
if (l > 1) {
/*
* We have more than one such row. Decrement its counter by 1 and put this row
* back into map.
*/
map.put(key, l - 1);
}
rowCount--;
}
} }
return rowCount; return rowCount;
} }
......
...@@ -738,7 +738,7 @@ public class Data { ...@@ -738,7 +738,7 @@ public class Data {
case Value.TIMESTAMP: { case Value.TIMESTAMP: {
return ValueTimestamp.fromMillisNanos( return ValueTimestamp.fromMillisNanos(
DateTimeUtils.getTimeUTCWithoutDst(readVarLong()), DateTimeUtils.getTimeUTCWithoutDst(readVarLong()),
readVarInt()); readVarInt() % 1_000_000);
} }
case Value.TIMESTAMP_TZ: { case Value.TIMESTAMP_TZ: {
long dateValue = readVarLong(); long dateValue = readVarLong();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论