@@ -522,7 +522,8 @@ type RowsEvent struct {
522
522
ColumnBitmap2 []byte
523
523
524
524
//rows: invalid: int64, float64, bool, []byte, string
525
- Rows [][]interface {}
525
+ Rows [][]interface {}
526
+ SkippedColumns [][]int
526
527
527
528
parseTime bool
528
529
timestampStringLocation * time.Location
@@ -583,6 +584,7 @@ func (e *RowsEvent) Decode(data []byte) error {
583
584
if e .needBitmap2 {
584
585
rowsLen += e .ColumnCount
585
586
}
587
+ e .SkippedColumns = make ([][]int , 0 , rowsLen )
586
588
e .Rows = make ([][]interface {}, 0 , rowsLen )
587
589
588
590
for pos < len (data ) {
@@ -608,6 +610,7 @@ func isBitSet(bitmap []byte, i int) bool {
608
610
609
611
func (e * RowsEvent ) decodeRows (data []byte , table * TableMapEvent , bitmap []byte ) (int , error ) {
610
612
row := make ([]interface {}, e .ColumnCount )
613
+ skips := make ([]int , 0 )
611
614
612
615
pos := 0
613
616
@@ -629,6 +632,7 @@ func (e *RowsEvent) decodeRows(data []byte, table *TableMapEvent, bitmap []byte)
629
632
var err error
630
633
for i := 0 ; i < int (e .ColumnCount ); i ++ {
631
634
if ! isBitSet (bitmap , i ) {
635
+ skips = append (skips , i )
632
636
continue
633
637
}
634
638
@@ -649,6 +653,7 @@ func (e *RowsEvent) decodeRows(data []byte, table *TableMapEvent, bitmap []byte)
649
653
}
650
654
651
655
e .Rows = append (e .Rows , row )
656
+ e .SkippedColumns = append (e .SkippedColumns , skips )
652
657
return pos , nil
653
658
}
654
659
0 commit comments