File tree 1 file changed +20
-10
lines changed
1 file changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -618,14 +618,19 @@ func (e *TableMapEvent) UnsignedMap() map[int]bool {
618
618
if len (e .SignednessBitmap ) == 0 {
619
619
return nil
620
620
}
621
- p := 0
622
621
ret := make (map [int ]bool )
623
- for i := 0 ; i < int (e .ColumnCount ); i ++ {
624
- if ! e .IsNumericColumn (i ) {
625
- continue
622
+ i := 0
623
+ for _ , field := range e .SignednessBitmap {
624
+ for c := 0x80 ; c != 0 ; {
625
+ if e .IsNumericColumn (i ) {
626
+ ret [i ] = field & byte (c ) != 0
627
+ c >>= 1
628
+ }
629
+ i ++
630
+ if i >= int (e .ColumnCount ) {
631
+ return ret
632
+ }
626
633
}
627
- ret [i ] = e .SignednessBitmap [p / 8 ]& (1 << uint (7 - p % 8 )) != 0
628
- p ++
629
634
}
630
635
return ret
631
636
}
@@ -747,11 +752,16 @@ func (e *TableMapEvent) VisibilityMap() map[int]bool {
747
752
if len (e .VisibilityBitmap ) == 0 {
748
753
return nil
749
754
}
750
- p := 0
751
755
ret := make (map [int ]bool )
752
- for i := 0 ; i < int (e .ColumnCount ); i ++ {
753
- ret [i ] = e .VisibilityBitmap [p / 8 ]& (1 << uint (7 - p % 8 )) != 0
754
- p ++
756
+ i := 0
757
+ for _ , field := range e .VisibilityBitmap {
758
+ for c := 0x80 ; c != 0 ; c >>= 1 {
759
+ ret [i ] = field & byte (c ) != 0
760
+ i ++
761
+ if uint64 (i ) >= e .ColumnCount {
762
+ return ret
763
+ }
764
+ }
755
765
}
756
766
return ret
757
767
}
You can’t perform that action at this time.
0 commit comments