Skip to content

Add comment about golang type of RowsEvent.Rows #828

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions replication/row_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,36 @@ func (e *TableMapEvent) JsonColumnCount() uint64 {
// RowsEventStmtEndFlag is set in the end of the statement.
const RowsEventStmtEndFlag = 0x01

// RowsEvent represents a MySQL rows event like DELETE_ROWS_EVENT,
// UPDATE_ROWS_EVENT, etc.
// RowsEvent.Rows saves the rows data, and the MySQL type to golang type mapping
// is
// - MYSQL_TYPE_NULL: nil
// - MYSQL_TYPE_LONG: int32
// - MYSQL_TYPE_TINY: int8
// - MYSQL_TYPE_SHORT: int16
// - MYSQL_TYPE_INT24: int32
// - MYSQL_TYPE_LONGLONG: int64
// - MYSQL_TYPE_NEWDECIMAL: string / "github.com/shopspring/decimal".Decimal
// - MYSQL_TYPE_FLOAT: float32
// - MYSQL_TYPE_DOUBLE: float64
// - MYSQL_TYPE_BIT: int64
// - MYSQL_TYPE_TIMESTAMP: string / time.Time
// - MYSQL_TYPE_TIMESTAMP2: string / time.Time
// - MYSQL_TYPE_DATETIME: string / time.Time
// - MYSQL_TYPE_DATETIME2: string / time.Time
// - MYSQL_TYPE_TIME: string
// - MYSQL_TYPE_TIME2: string
// - MYSQL_TYPE_DATE: string
// - MYSQL_TYPE_YEAR: int
// - MYSQL_TYPE_ENUM: int64
// - MYSQL_TYPE_SET: int64
// - MYSQL_TYPE_BLOB: []byte
// - MYSQL_TYPE_VARCHAR: string
// - MYSQL_TYPE_VAR_STRING: string
// - MYSQL_TYPE_STRING: string
// - MYSQL_TYPE_JSON: []byte / *replication.JsonDiff
// - MYSQL_TYPE_GEOMETRY: []byte
type RowsEvent struct {
// 0, 1, 2
Version int
Expand Down