Bocadillo
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/localhots/blt/tools"
|
||||
"github.com/localhots/bocadillo/tools"
|
||||
)
|
||||
|
||||
// FormatDescription is a description of binary log format.
|
||||
|
||||
@@ -3,7 +3,7 @@ package binlog
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/localhots/blt/tools"
|
||||
"github.com/localhots/bocadillo/tools"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package binlog
|
||||
|
||||
import "github.com/localhots/blt/tools"
|
||||
import "github.com/localhots/bocadillo/tools"
|
||||
|
||||
// Position ...
|
||||
type Position struct {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package binlog
|
||||
|
||||
import (
|
||||
"github.com/localhots/blt/mysql"
|
||||
"github.com/localhots/blt/tools"
|
||||
"github.com/localhots/bocadillo/mysql"
|
||||
"github.com/localhots/bocadillo/tools"
|
||||
"github.com/localhots/pretty"
|
||||
)
|
||||
|
||||
@@ -79,19 +79,17 @@ func (e *RowsEvent) decodeRows(buf *tools.Buffer, td TableDescription, bm []byte
|
||||
count = (count + 7) / 8
|
||||
|
||||
nullBM := buf.ReadStringVarLen(count)
|
||||
nullCnt := 0
|
||||
nullIdx := 0
|
||||
row := make([]interface{}, e.ColumnCount)
|
||||
|
||||
pretty.Println(count, nullBM)
|
||||
|
||||
var err error
|
||||
for i := 0; i < int(e.ColumnCount); i++ {
|
||||
if !isBitSet(bm, i) {
|
||||
continue
|
||||
}
|
||||
|
||||
isNull := (uint32(nullBM[nullCnt/8]) >> uint32(nullCnt%8)) & 0x01
|
||||
nullCnt++
|
||||
isNull := (uint32(nullBM[nullIdx/8]) >> uint32(nullIdx%8)) & 1
|
||||
nullIdx++
|
||||
if isNull > 0 {
|
||||
row[i] = nil
|
||||
continue
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package binlog
|
||||
|
||||
import (
|
||||
"github.com/localhots/blt/mysql"
|
||||
"github.com/localhots/blt/tools"
|
||||
"github.com/localhots/bocadillo/mysql"
|
||||
"github.com/localhots/bocadillo/tools"
|
||||
)
|
||||
|
||||
// TableDescription contains table details required to process rows events.
|
||||
|
||||
Reference in New Issue
Block a user