1
0
Fork 0

Bocadillo

This commit is contained in:
Gregory Eremin 2018-11-06 23:17:48 +01:00
parent 5ef0642499
commit aa2b3ad7b1
9 changed files with 15 additions and 17 deletions

View File

@ -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.

View File

@ -3,7 +3,7 @@ package binlog
import (
"errors"
"github.com/localhots/blt/tools"
"github.com/localhots/bocadillo/tools"
)
var (

View File

@ -1,6 +1,6 @@
package binlog
import "github.com/localhots/blt/tools"
import "github.com/localhots/bocadillo/tools"
// Position ...
type Position struct {

View File

@ -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

View File

@ -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.

View File

@ -7,7 +7,7 @@ import (
"os"
"time"
"github.com/localhots/blt/reader"
"github.com/localhots/bocadillo/reader"
"github.com/localhots/gobelt/log"
)

View File

@ -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"
)

View File

@ -7,7 +7,7 @@ import (
"io"
"os"
"github.com/localhots/blt/tools"
"github.com/localhots/bocadillo/tools"
"github.com/localhots/mysql"
)

View File

@ -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