Skip to content

Commit b311bd7

Browse files
committed
[to dev/1.3] fix: bitmap error
1 parent a6e91ec commit b311bd7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Apache.IoTDB/DataStructure/BitMap.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#endif
2424
public class BitMap
2525
{
26-
private static byte[] BIT_UTIL = new byte[] { 1, 2, 4, 8, 16, 32, 64, 255 };
26+
private static byte[] BIT_UTIL = new byte[] { 1, 2, 4, 8, 16, 32, 64, unchecked((byte)-128) };
2727
private static byte[] UNMARK_BIT_UTIL =
2828
new byte[] {
2929
(byte) 0XFE, // 11111110
@@ -94,7 +94,7 @@ public void mark(int position)
9494
public void reset()
9595
{
9696
#if NET461_OR_GREATER || NETSTANDARD2_0
97-
bits.Fill((byte)0xFF);
97+
bits.Fill((byte)0);
9898
#else
9999
Array.Fill(bits, (byte)0);
100100
#endif

src/Apache.IoTDB/DataStructure/Tablet.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ namespace Apache.IoTDB.DataStructure
4444
*/
4545
public class Tablet
4646
{
47+
48+
private static int EMPTY_DATE_INT = 10000101;
4749
private readonly List<long> _timestamps;
4850
private readonly List<List<object>> _values;
4951

@@ -361,7 +363,7 @@ public byte[] GetBinaryValues()
361363
for (int j = 0; j < RowNumber; j++)
362364
{
363365
var value = _values[j][i];
364-
buffer.AddInt(value != null ? Utils.ParseDateToInt((DateTime)value) : int.MinValue);
366+
buffer.AddInt(value != null ? Utils.ParseDateToInt((DateTime)value) : EMPTY_DATE_INT);
365367
}
366368
break;
367369
}

0 commit comments

Comments
 (0)