@@ -846,7 +846,8 @@ type RowsEvent struct {
846
846
ColumnBitmap2 []byte
847
847
848
848
//rows: invalid: int64, float64, bool, []byte, string
849
- Rows [][]interface {}
849
+ Rows [][]interface {}
850
+ SkippedColumns [][]int
850
851
851
852
parseTime bool
852
853
timestampStringLocation * time.Location
@@ -907,6 +908,7 @@ func (e *RowsEvent) Decode(data []byte) error {
907
908
if e .needBitmap2 {
908
909
rowsLen += e .ColumnCount
909
910
}
911
+ e .SkippedColumns = make ([][]int , 0 , rowsLen )
910
912
e .Rows = make ([][]interface {}, 0 , rowsLen )
911
913
912
914
for pos < len (data ) {
@@ -932,6 +934,7 @@ func isBitSet(bitmap []byte, i int) bool {
932
934
933
935
func (e * RowsEvent ) decodeRows (data []byte , table * TableMapEvent , bitmap []byte ) (int , error ) {
934
936
row := make ([]interface {}, e .ColumnCount )
937
+ skips := make ([]int , 0 )
935
938
936
939
pos := 0
937
940
@@ -953,6 +956,7 @@ func (e *RowsEvent) decodeRows(data []byte, table *TableMapEvent, bitmap []byte)
953
956
var err error
954
957
for i := 0 ; i < int (e .ColumnCount ); i ++ {
955
958
if ! isBitSet (bitmap , i ) {
959
+ skips = append (skips , i )
956
960
continue
957
961
}
958
962
@@ -973,6 +977,7 @@ func (e *RowsEvent) decodeRows(data []byte, table *TableMapEvent, bitmap []byte)
973
977
}
974
978
975
979
e .Rows = append (e .Rows , row )
980
+ e .SkippedColumns = append (e .SkippedColumns , skips )
976
981
return pos , nil
977
982
}
978
983
0 commit comments