Documentation ¶
Index ¶
- func DatumToColumn(colInfo *model.ColumnInfo, datum types.Datum) (col *obinlog.Column)
- func DecodeOldAndNewRow(b []byte, cols map[int64]*model.ColumnInfo, loc *time.Location, ...) (map[int64]types.Datum, map[int64]types.Datum, error)
- func SetSQLMode(mode mysql.SQLMode)
- func TiBinlogToOracleTxn(infoGetter TableInfoGetter, schema string, table string, tiBinlog *tipb.Binlog, ...) (txn *loader.Txn, err error)
- func TiBinlogToPbBinlog(infoGetter TableInfoGetter, schema string, table string, tiBinlog *tipb.Binlog, ...) (pbBinlog *pb.Binlog, err error)
- func TiBinlogToSecondaryBinlog(infoGetter TableInfoGetter, schema string, table string, tiBinlog *pb.Binlog, ...) (*obinlog.Binlog, error)
- func TiBinlogToTxn(infoGetter TableInfoGetter, schema string, table string, tiBinlog *tipb.Binlog, ...) (txn *loader.Txn, err error)
- type BinlogGenerator
- func (g *BinlogGenerator) CanAppendDefaultValue(id int64, schemaVersion int64) bool
- func (g *BinlogGenerator) IsDroppingColumn(id int64) bool
- func (g *BinlogGenerator) SchemaAndTableName(id int64) (schema string, table string, ok bool)
- func (g *BinlogGenerator) SetAllDML(c *check.C)
- func (g *BinlogGenerator) SetDDL()
- func (g *BinlogGenerator) SetDelete(c *check.C)
- func (g *BinlogGenerator) SetInsert(c *check.C)
- func (g *BinlogGenerator) SetUpdate(c *check.C)
- func (g *BinlogGenerator) TableByID(id int64) (info *model.TableInfo, ok bool)
- func (g *BinlogGenerator) TableBySchemaVersion(id int64, schemaVersion int64) (info *model.TableInfo, ok bool)
- type TableInfoGetter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DatumToColumn ¶
DatumToColumn convert types.Datum to obinlog.Column
func DecodeOldAndNewRow ¶
func DecodeOldAndNewRow(b []byte, cols map[int64]*model.ColumnInfo, loc *time.Location, canAppendDefaultValue bool, pinfo *model.TableInfo, ) (map[int64]types.Datum, map[int64]types.Datum, error)
DecodeOldAndNewRow decodes a byte slice into datums with a existing row map. Row layout: colID1, value1, colID2, value2, .....
func TiBinlogToOracleTxn ¶
func TiBinlogToOracleTxn(infoGetter TableInfoGetter, schema string, table string, tiBinlog *tipb.Binlog, pv *tipb.PrewriteValue, shouldSkip bool, tableRouter *router.Table) (txn *loader.Txn, err error)
TiBinlogToOracleTxn translate the format to loader.Txn
func TiBinlogToPbBinlog ¶
func TiBinlogToPbBinlog(infoGetter TableInfoGetter, schema string, table string, tiBinlog *tipb.Binlog, pv *tipb.PrewriteValue) (pbBinlog *pb.Binlog, err error)
TiBinlogToPbBinlog translate the binlog format
func TiBinlogToSecondaryBinlog ¶
func TiBinlogToSecondaryBinlog( infoGetter TableInfoGetter, schema string, table string, tiBinlog *pb.Binlog, pv *pb.PrewriteValue, ) (*obinlog.Binlog, error)
TiBinlogToSecondaryBinlog translates the format to secondary binlog
func TiBinlogToTxn ¶
func TiBinlogToTxn(infoGetter TableInfoGetter, schema string, table string, tiBinlog *tipb.Binlog, pv *tipb.PrewriteValue, shouldSkip bool, loc *time.Location) (txn *loader.Txn, err error)
TiBinlogToTxn translate the format to loader.Txn
Types ¶
type BinlogGenerator ¶
type BinlogGenerator struct { TiBinlog *ti.Binlog PV *ti.PrewriteValue Schema string Table string // contains filtered or unexported fields }
BinlogGenerator is a test helper for generating some binlog.
func (*BinlogGenerator) CanAppendDefaultValue ¶
func (g *BinlogGenerator) CanAppendDefaultValue(id int64, schemaVersion int64) bool
CanAppendDefaultValue implements TableInfoGetter interface
func (*BinlogGenerator) IsDroppingColumn ¶
func (g *BinlogGenerator) IsDroppingColumn(id int64) bool
IsDroppingColumn implements TableInfoGetter interface
func (*BinlogGenerator) SchemaAndTableName ¶
func (g *BinlogGenerator) SchemaAndTableName(id int64) (schema string, table string, ok bool)
SchemaAndTableName implements TableInfoGetter interface
func (*BinlogGenerator) SetAllDML ¶
func (g *BinlogGenerator) SetAllDML(c *check.C)
SetAllDML one insert/update/delete/update in one txn.
func (*BinlogGenerator) SetDelete ¶
func (g *BinlogGenerator) SetDelete(c *check.C)
SetDelete set the info to be a delete event
func (*BinlogGenerator) SetInsert ¶
func (g *BinlogGenerator) SetInsert(c *check.C)
SetInsert set up a insert event binlog.
func (*BinlogGenerator) SetUpdate ¶
func (g *BinlogGenerator) SetUpdate(c *check.C)
SetUpdate set up a update event binlog.
func (*BinlogGenerator) TableByID ¶
func (g *BinlogGenerator) TableByID(id int64) (info *model.TableInfo, ok bool)
TableByID implements TableInfoGetter interface
func (*BinlogGenerator) TableBySchemaVersion ¶
func (g *BinlogGenerator) TableBySchemaVersion(id int64, schemaVersion int64) (info *model.TableInfo, ok bool)
TableBySchemaVersion implements TableInfoGetter interface
type TableInfoGetter ¶
type TableInfoGetter interface { TableByID(id int64) (info *model.TableInfo, ok bool) SchemaAndTableName(id int64) (string, string, bool) CanAppendDefaultValue(id int64, schemaVersion int64) bool // IsDroppingColumn(id int64) bool TableBySchemaVersion(id int64, schemaVersion int64) (info *model.TableInfo, ok bool) }
TableInfoGetter is used to get table info by table id of TiDB