Bocadillo
This commit is contained in:
parent
5ef0642499
commit
aa2b3ad7b1
|
@ -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.
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/localhots/blt/reader"
|
||||
"github.com/localhots/bocadillo/reader"
|
||||
"github.com/localhots/gobelt/log"
|
||||
)
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ package reader
|
|||
|
||||
import (
|
||||
"github.com/juju/errors"
|
||||
"github.com/localhots/blt/binlog"
|
||||
"github.com/localhots/blt/schema"
|
||||
"github.com/localhots/bocadillo/binlog"
|
||||
"github.com/localhots/bocadillo/schema"
|
||||
"github.com/localhots/pretty"
|
||||
)
|
||||
|
||||
|
|
|
@ -7,7 +7,7 @@ import (
|
|||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/localhots/blt/tools"
|
||||
"github.com/localhots/bocadillo/tools"
|
||||
"github.com/localhots/mysql"
|
||||
)
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ package tools
|
|||
import (
|
||||
"encoding/binary"
|
||||
|
||||
"github.com/localhots/blt/mysql"
|
||||
"github.com/localhots/bocadillo/mysql"
|
||||
)
|
||||
|
||||
// Buffer is a simple wrapper over a slice of bytes with a cursor. It allows for
|
||||
|
|
Loading…
Reference in New Issue